2025-02-12 04:32 AM
Short version:
Code Generator changes the line "#define TICK_INT_PRIORITY 0U" to 15U in the stm32f4xx_hal_conf.h file and i want this to not occur.
Heres's what I did in detail:
I created a project from touchgfx, created a UI, uploaded it into my board and it worked well. After this I opened the generated .ioc file from the CubeIDE. I wanted the change the on-start state of the onboard LED to high from the .ioc to see if my modifications apply, so i generated the code with CubeIDE which compiled succesfully. After this I uploaded the software, and while the led was bright, the screen was plain white and it didn't show my UI. After a lot of headache I did some comparing between the files before and after the generation, and found that the value of TICK_INT_PRIORITY has been changed from 0U to 15U. I changed it back, uploaded the code, and now it works perfectly (both the screen works and the LED is on at startup). However, obviously, if i regenerate the code with CubeIDE, it will change the value back.
I've looked into the .ioc options and found that this variable probably corresponds to the "System tick timer" setting under System Core/NVIC. However it is non-modifiable in the UI and is shown to be 15. I did some searching aswell and found that the generation changing this value was a problem even 1+ years ago, but I haven't really found a solution.
https://community.st.com/t5/stm32-mcus-products/tick-int-priority-changes-from-0-to-15-and-vice-versa/td-p/568372
One user even says it's a known bug, if it is so, is it possible that it hasn't been fixed for that long?
Is there a way to make this work, so I don't have to manually edit the value generated by CubeIDE after every code generation? I also tried to manually put a user code section after the definition, where I #undef it and then define again to 0U, but I found that the generator doesn't do manually added user code sections.
2025-02-12 05:17 AM
I have found a solution here: https://community.st.com/t5/stm32-mcus-embedded-software/stm32f4-tim6-initialization/td-p/684647
I changed the TIM6 Interrupt priority to 0 and now it seems to work well.
2025-02-12 05:22 AM