cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with headers.h files in STM32CubeIDE

GS2
Senior

Hello,

I have the follow problems with headers.h files :

1. Hard to open required header file - have to go thru source's files includes chain
to find required header and click "Open Declaration" to open.
2. If variable definitions are in the header file -
"Open Declaration" for this variable does not show it.
3. Search for text - does not bring any results from header files -
have to use Windows Explorer to search for it.

Please tell me - what I am doing wrong?
What setting can I change in STM32CubeIDE?

6 REPLIES 6
liaifat85
Senior III

STM32CubeIDE uses indexing to facilitate navigation. Sometimes the index might not be updated properly. You can force a rebuild of the index by going to ProjectC/C++ IndexRebuild.

GS2
Senior

Thank you liaifat85,

Yes, this may help with variable definitions in the header file - 2.

I have reload the project and variable definitions are showing now,

and → Rebuild is grey - not active.

But what about 1. and 3. ?

TDK
Guru

1+2) Does the project build? If not, probably the file you want isn't indexed as it doesn't think the project is valid.

3) Search for text should work. Ensure you're searching the entire workspace or wherever the file is, and that the file type is valid. Show screenshot if you're having trouble. Search -> File... has a lot of options.

 

If you feel a post has answered your question, please click "Accept as Solution".
GS2
Senior

Thank you TDK,

1. How to open required header file by name ? - have to go thru source's files includes chain
to find required header and click "Open Declaration" to open.

2. Yes, the project is build fine. Open declaration now start working after reloading the project.

3. Search does not find anything even in *.h files - see "SPI1" on right side of Search window:

SearchSearch

 

GS2
Senior

So this bugs are very well known: 

1. How to open required header file by name ? - have to go thru source's files includes chain
to find required header and click "Open Declaration" to open.

3. Search does not find anything even in *.h files

and nobody is going to fix them!!!

Hi,

just mark the text you wanna search -> right click mouse -> (in popup menu) search text -> project ...then you see:

AScha3_0-1725036635993.png

click on the file/line and the file is opened and you are at the position you want to see: (in .h or .c files)

AScha3_1-1725036742380.png

 

If you feel a post has answered your question, please click "Accept as Solution".