cancel
Showing results for 
Search instead for 
Did you mean: 

I am using a STM32G030F6P6. I would like to know if I can use printf for debugging on USART2 (PA2, PA3) or USART1 (PA9, PA8). I believe both are valid, but I would like to check. BR Gilberto

GErma.1
Associate III
 
4 REPLIES 4
gbm
Lead III

You may redirect printf output to any interface you like. See syscalls.c file in your project folder, then implement either write or io_putchar function.

You get to chose the plumbing, and bring up the UART / PIN, and the wrapper function __io_putchar()

You could make a TX only implementation.

USART1 is PA9 (TX) PA10 (RX)

https://gist.github.com/glegrain/ca92f631e578450a933c67ac3497b4df

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
S.Ma
Principal

Printf needs 1 tx pin only. Stlinkv3 support.uart to usb virtual com port on top of debugging function.

Otherwise, android bluetooth electronics app is a different way of debugging interactively and graphically, using hc06 uart to BT radio interface. Worth having a look.

GErma.1
Associate III

Thanks