Skip to main content
TTomp.1466
Associate
November 7, 2019
Question

stm32g081b-eval. Code example to get printf / or some other function to print tracing data via ST link COM port for SW4STM32. I am connecting Putty to this COM port.

  • November 7, 2019
  • 2 replies
  • 792 views

 I can't find the correct answer from Internet and I don't know do I need to write some code to USART /UART. I have those initialized by code generated by Cube MX.

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
November 7, 2019

Look at syscalls.c , how it implements _write() and the functions it calls. ST wraps these things in a couple of ways. Look/search for __io_putchar()

Yes the USART/UART needs to be up and functional, so pins, clocks, peripheral. Usually ends up calling HAL_UART_Transmit(), or functional equivalent.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
TTomp.1466
Associate
November 8, 2019

Do I need to know which USART (1,2,3) is going to ST link with this eval board? And do I need to use that information when creating project with Cube MX?