2021-11-25 02:53 AM
Hello!
I know that this is not a new topic, and maybe somewhere (even in this forum) someone already answered this question multiple times, but still.....
I crawled the forum looking for advice about using the HAL without CUBE, because where I work they have a nice proprietary c++ hal and I was starting to port it for STM32.
C++ classes would operate on top of the hal, but I'd like the possibility to, say, instantiate an UART class without previous cube initialization, and so on with other peripherals (timers, adc, dac ecc).
I followed the following steps but I'm stuck (no compilation errors but no autocomplete, like the IDE knows the files are there but doesn't really know...):
My idea is to have an header file that will be included in "stm32l4xx_hal_conf.h" (manually added, 'cause cube obviously erases it) where basically I can activate/deactivate the various peripherals like cube does (comment/uncomment above).
I'm no include-wizard so I can't figure out what's the correct way to do this. Any pointers?
Thank you!
2021-11-25 06:55 AM
The general idea would be to include files, try to compile, and address the errors that come up.
You need the CMSIS header file as well, and the HAL_Tick type functions.
> no compilation errors but no autocomplete
So it works/builds, and the problem is solely that you don't have autocomplete? Rebuilding the index should fix it, assuming your defines are set correctly.
2021-11-25 07:14 AM
> The general idea would be to include files, try to compile, and address the errors that come up.
Ok! I was following the right path then, I'll continue that way.
> You need the CMSIS header file as well, and the HAL_Tick type functions.
I'm including "main.h" in my cpp files, and it seems to give access to HAL_Tick functions. I'm not sure I understood your statement: where do I have to include CMSIS header?
My Classes (.cpp/.h) will always go in cubeMX generated projects, so (I don't really know why) I assume including "main.h" would suffice as it's including all that's needed in the main.c source file.
>So it works/builds, and the problem is solely that you don't have autocomplete? Rebuilding the index should fix it, assuming your defines are set correctly.
Autocomplete is fixed thanks to the index rebuilding! I always forget about index rebuilding... :grinning_face_with_sweat: thanks a lot!
I'll make some more development tomorrow and eventually close this question.
2021-11-25 07:25 AM
The CMSIS header file is included from within "stm32l4xx.h" based on your defines. If it's compiling, then it's being included somewhere in the chain.
2022-01-21 07:16 PM
Is there any comply with-up right here? I am getting what I trust to be a similar blunders on an F2 tool the use of a custom document descriptor here. It reasons class parsing mistakes ensuing in intermittent USB enumeration.