Delay Delay - 1 year ago 318
C Question

How to retarget printf() on an STM32F10x?

I use this code for retarget

, but it does not work

#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */

/* Place your implementation of fputc here */
/* e.g. write a character to the LCD */

return ch;

I use STM32F103RBT6

compiler : GCC with emBitz editor

Answer Source

Tank you Bence Kaulics

I use tinyprintf library and it worked quite well : github link

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download