Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Disassembly looks funny and doesn't correspond with C code

Sorry for the late reply - I tried to respond yesterday but ran into multiple, severe networking issues.

Check your project’s optimization level:

Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU GCC Compiler -> Optimzation -> Optimization Level.

You want “None (-O0)” or “Optimize for Debug (-Og)”.

Your “missing code” has been optimized out by the compiler. It did not see any subsequent reference to the calculated values, so it omitted the calculations themselves.

Add the “volatile” keyword to your variable declaration to force the compiler to not make assumptions about your variable usage.

More information about optimization levels in GCC:

https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.htmlQuestion

I hope this helps.

I originally wrote a slightly longer and more methodical response to your question, but the web site decided I was no longer logged in and “optimized” it away :-D


Dale