AnsweredAssumed Answered

Semihosting in Eclipse or retargeting printf

Question asked by jooya.ali on Jun 3, 2014
Latest reply on Feb 10, 2015 by Butler.Justyn
Hi,
I am trying to debug some very simple code for STM32F0Discovery using Eclipse, 
ARM arm-none-eabi-gdb compiler and OpenOCD debuger.

I could build and debug my cods and now I am trying to use printf to see some variables on the screen. CoIDE has this nice semihosting which without using USART, sends printf output on the screen. I tried to use the semihosting library files with eclips to do the same. I could enable  semihosting in Eclipse but nothing showed up on the screen! I guess the problem was SH_DoCommand
http://techwithdave.blogspot.ca/2013/04/hello-world-tutorial-for-stm-discovery.html

Then I tried to use USART_Printf example from STM32F0xx_StdPeriph_Examples.
I got errors regarding _read and _write and so many errors like that. I tried to fix the errors by adding newlib_stubs.c as in 
https://sites.google.com/site/stm32discovery/open-source-development-with-the-stm32-discovery/getting-newlib-to-work-with-stm32-and-code-sourcery-lite-eabi
After small changes in the code I couldn't debug the code!
I have also tried to add 
--specs=rdimon.specs   -Wl,--start-group -lgcc -lc -lm -lrdimon -Wl,--end-group
flags to the linker but still nothing on the screen!
Any Idea?
Thanks
Ali

Outcomes