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


Semihosting does not work with codes generated by STM32CubeMX v4.15.1 on STM32F103RCT6/STM32F405RG

I use STM32CubeMx to generate code and import it to System Workbench following Importing an STM32CubeMX generated project under System Workbench for STM32Question
The code keeps blinking led and outputting constant string to uart (DMA) in a loop and works as expected. I can debug it in Eclipse so everything works perfect by here.

Problem happens while experimenting with semihosting feature (see attached).

What I changed/added to enable the semihosting:
- Add “-specs=nosys.specs -specs=nano.specs -specs=rdimon.specs -lc -lrdimon” to linker
- Add “initialise_monitor_handles();” to the beginning of main()
- Add “monitor arm semihosting enable” to Startup of debug configuration

Seems all is set up correctly but I can’t get string printed on the console. I also tried in plain makefile version (no GUI) the problem persists. Problem exists in STM32F103RCT6/STM32F405RG.

Do I miss anything? Have anyone tried semihosting with STM32CubeMX and Sys System Workbench environment?

Thanks for the support.
Johnny


I have the same problem. See attached file.

- The Hardware is STM32F405RG (olimex development board) connected with St-LinkV2
- The code is original generted from STM32CubeMX without any changes from my side.
- The Hardware is running without any problems with EmBiz
- the debugger stops in the first line of the main correctly. When continue for the next Braekpoint it stops with Sgint Interrupt anywhere in the program.
- It is a software problem may be the code from STM32CubeMX is incomplete, because I do not see any Interrupt handler in the code or there is a buck in the software from AC6.

Does anybody knows how to solve the problem


Figured out the problem finally!

With the items (listed above) properly set up Semihosting works when printing inside main() function.

To print inside FreeRTOS thread, need to e.g. “invoke setvbuf(stdout, NULL, _IOLBF, 256);” explicitly even if log strings have ‘\n’.

Tried both “-specs=nosys.specs -specs=nano.specs -specs=rdimon.specs -lc -lrdimon” and “-specs=nano.specs -specs=rdimon.specs -lc -lrdimon” and they work! Seems it’s conflicting that nosys and rdimon co-exist. In first setting the latter rdimon spec could ‘overwrite’ nosys spec that’s why it works as well (I guess)