2014-06-03 12:43 AM
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_DoCommandhttp://techwithdave.blogspot.ca/2013/04/hello-world-tutorial-for-stm-discovery.htmlThen 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-eabiAfter 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-groupflags to the linker but still nothing on the screen!Any Idea?ThanksAli #stm32f0 #printf #discovery2015-02-03 05:23 AM
And was this with an STM32F0, or something else? Because as I recall the Cortex-M0 doesn't support the ITM/SWV
2015-02-10 07:27 AM
The GNU ARM Eclipse plugins (http://gnuarmeclipse.livius.net) include templates which have a custom semihosting implementation, and provide trace_printf.
They work with the STM32F0, but don't use the ITM when on this platform.Also available separately on github:https://github.com/justyn/semihosting-cortexm-uos