cancel
Showing results for 
Search instead for 
Did you mean: 

Semihosting with TrueSTUDIO for STM32 and STLINK v2

Hi,

I am using Atollic TrueSTUDIO for STM32 and the STLINK v2 debugger found on most ST dev boards. uC is STM32L476RE if thats needed.

I am trying to get semihosting to work for printf. (SDO pin is not available in my project for ITM). I have used semihosting successfully with a different IDE before.

1) So I have changed the Properties->C/C++ Build->Settings->C Linker -> Miscellaneous->Other options to include "-specs=rdimon.specs -lc -lrdimon" (default already has nano and nospecs)

2) Have put the function declaration extern void initialise_monitor_handles(void); in main.c

3) initialise_monitor_handles() is called from main()

4) Have added "monitor arm semihosting enable" to Debug Configurations->StartupScripts->Target Hardware initialization scripts (Had it under Target Software Startup Scripts before but when debugging there was a warning message box "Failure at line:x in Target Startup Scripts: Please edit the debug configuration settings. Protocol error with Rcmd", so I assume it goes under the hardware startup scripts?

The project compiles, but when its run it breaks and Atollic opens a new tab saying "No source available for initialse_monitor_handles() at 0x8008ef4"

Any ideas? I have googled extensively.

Thanks

1 REPLY 1

So I gave up on the semihosting and am just using uart instead. In any case, its much faster than semihosting