cancel
Showing results for 
Search instead for 
Did you mean: 

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.

TTomp.1466
Associate

 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.

2 REPLIES 2

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 Venmo
Up vote any posts that you find helpful, it shows what's working..
TTomp.1466
Associate

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?