STM32H723 GCC compiler Optimization problem
STM32CubeIDE 2.1.1: My program works if I choose the GCC compiler “none” optimization and it doesn’w work if I select any other optimization; anyone may help me ?
Thank you
STM32CubeIDE 2.1.1: My program works if I choose the GCC compiler “none” optimization and it doesn’w work if I select any other optimization; anyone may help me ?
Thank you
This typically means that there is a flaw (or flaws) in your code - it’s relying on something which the C language does not guarantee.
Probably the commonest is omitting/forgetting volatile where it's needed.
Relying on timing of the C code is another.
The -Og level should give you good debuggability - see here.
You could try that …
Your could also try printf-style debugging to see where your code execution differs from what you intended
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.