Skip to main content
Visitor II
November 17, 2024
Question

stm32f1xx.h file cannot be found

  • November 17, 2024
  • 2 replies
  • 1664 views

Hello everyone, I have a question. I am using CubemX to generate HAL library and FreeRTOS. There are no errors during the compilation, but when I write the code, the auto-completion feature does not work (I have set it up), and even the uint8_t variable does not turn blue. When I look at the project files, it says that the stm32f1xx.h file cannot be found, but the entire project was generated by CubemX, and the file is located in the file path. I have also added the path to the file in C/C++ and there were no errors during the compilation. I cannot find a solution to this problem online, so I am seeking help from the experts here.

2 replies

mƎALLEm
Technical Moderator
November 17, 2024

Hello @Wan_G @and welcome to the community,

It will be helpful if you share your project.

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question."
Andrew Neil
Super User
November 18, 2024

@Wan_G wrote:

There are no errors during the compilation, but when I write the code, the auto-completion feature does not work .


So the problem is just in the Editor - not in the compiler configuration.

You haven't said what IDE you're using. For STM32CubeIDE, try rebuilding the index:

AndrewNeil_0-1731921486712.png

https://community.st.com/t5/stm32cubeide-mcus/defines-not-changing-grayed-out-statuses/m-p/684561/highlight/true#M28079

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.