2022-04-12 05:04 PM
I am using STM32CubeIDE to build a freeRTOS project. I have put my tasks in their own .h and .c files. For example I have a default_task.c file.
The problem is each time I open CubeMX and save my changes, the 'auto code update' feature does not see my default_task.c file and creates a function in main.c.
Is there a doc showing how to configure STM32CubeIDE and CubeMX so that I can have it update my code correctly? If not, is there a way to see what changes CubeMX will be making so that I can make them manually?
Solved! Go to Solution.
2022-04-13 05:54 AM
Hello @LMorr.3,
Please check whether the "General peripheral initialization as a pair of .c/.h files per peripheral " parameter is checked or not. It should be checked.
It is placed under Project Manager -> Code Generator -> Generated Files
If this isn't your issue, could you please share your ioc file and explain it more and provide us with a scenario to reproduce it.
Thanks,
Sara.
2022-04-13 05:50 AM
In CubeIDE/MX, in the FreeRTOS Tasks and Queues tab, double-click on defaultTask. Set the Code Generation Option to "As weak". Then, the generated code has the StartDefaultTask function defined as weak. I.e. the linker ignores it, if you provide a normal (non-weak) implementation of StartDefaultTask in your files.
hth
KnarfB
2022-04-13 05:54 AM
Hello @LMorr.3,
Please check whether the "General peripheral initialization as a pair of .c/.h files per peripheral " parameter is checked or not. It should be checked.
It is placed under Project Manager -> Code Generator -> Generated Files
If this isn't your issue, could you please share your ioc file and explain it more and provide us with a scenario to reproduce it.
Thanks,
Sara.
2022-04-13 06:18 AM
Thank you for the info., I will try building a new project with those settings to learn more about how it works.