Optimization Settings for HAL Driver (STM32F7)
Hello,
I have a project with FreeRTOS and LWIP (plus some other stuff). I ran into the problem, that if I set the optimization for my project (-O3 in my case) I get weird communication glitches. For example I only get a reply every 3rd or 4th ping, Ping reply takes up to 2 seconds, even UART isn't working properly.
I finally figured out that the Problem is caused when STM32F7xx_HAL_Driver gets optimized and I have to set -O0 for that folder manually.
How can this even happen? If the driver doesn't work, shouldn't it at least be guarded from optimization changes with something like this?
#pragma GCC push_options
#pragma GCC optimize ("O0")
//code
#pragma GCC pop_options