0

I'm trying to debug my stm32f0 with eclipse(CDT), gdb and openocd. Is there any way (like you do in for example visual studio) to have a var print to the console. Something like console.writeline or debug.writeline?

thanks

Bart Teunissen
  • 1,420
  • 5
  • 20
  • 43
  • May be I missed something in your question... whats wrong with standard gdb way like "p printf("%d", ivar)" (consider ivar have type int) and so on? – Konstantin Vladimirov Jan 25 '13 at 13:16
  • You mabey miss the how to do so in eclipse with gdb in my question. I didn' t knew gdb had a printf. How do i use that? – Bart Teunissen Jan 28 '13 at 07:31
  • gdb have no printf. It just can call any function in program you debug, that in turn may have some printf-like things inside to output on your microcontroller's console. – Konstantin Vladimirov Jan 28 '13 at 07:36

1 Answers1

1

Attach USB2TTL converter to the PA9 and PA10 pins and use serial port to print any debug information.

On Linux you may use screen to view any serial port. For example:

screen /dev/ttyUSB0 115200

Try to run my template project:

https://github.com/dobromyslov/stm32f0-chibios-template

Viacheslav Dobromyslov
  • 3,168
  • 1
  • 33
  • 45