AnsweredAssumed Answered

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

Question asked by johnny.shao on Jul 21, 2016
Latest reply on Jul 22, 2016 by johnny.shao
Also posted in OpenSTM32 forum http://www.openstm32.org/tiki-view_forum_thread.php?comments_parentId=3171

I use STM32CubeMx to generate code and import it to System Workbench following Importing an STM32CubeMX generated project under System Workbench for STM32

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.

I use STM32F1 customized board and STM32F4 STM32-P405 from Olimex for testing.

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


Thanks for the support.
Johnny

Outcomes