Skip to main content
GErma.1
Associate III
December 29, 2022
Question

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

  • December 29, 2022
  • 4 replies
  • 1000 views

..

This topic has been closed for replies.

4 replies

gbm
Lead III
December 29, 2022

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.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Tesla DeLorean
Guru
December 29, 2022

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 VenmoUp vote any posts that you find helpful, it shows what's working..
S.Ma
Principal
December 30, 2022

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
GErma.1Author
Associate III
December 30, 2022

Thanks