cancel
Showing results for 
Search instead for 
Did you mean: 

printf() on Nucleo-L476 board

Posted on February 19, 2016 at 19:25

Hi there,

I have a Nucleo-L476 board I would like to have printf() working. I used the tiny-printf provided by the Atollic IDE but I still need to implement the _write() function.

Any suggestion on how this can be accomplished using this board? 

Should I use an UART or is it possible to use SWD?

Thanks!
4 REPLIES 4
Posted on February 19, 2016 at 19:35

I should be possible to use either, the SWV only being usable with things like the ST-LINK Utilities, or a debug console. The USART is workable from a Terminal application, or any program you write that can open a serial port.

Should be nothing unique about the L4, any Atollic/GNU tutorial on doing this kind of semi-hosting should get you where you want to go.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on February 19, 2016 at 22:43

Thanks for the quick reply!

I just noticed that the SWV feature in Atollic is only available in the PRO version. Is there a way I can easily (ie, not using a USB CDC stack) print some characters through an UART and ST-LINK on the Nucleo board?

Radosław
Senior
Posted on February 19, 2016 at 23:01

1. When you use attolic specific functions please ask on attolic forum or  something.

2. Why you need print standard function?

3. Why you use tool when free solution can much more?

4. If you have free uart use uart. Writee own not not neccesarry printf function for this.

OR read about system calls.  In net you can find many examples of this (syscalls.c).

Posted on February 20, 2016 at 02:44

Yes, you'd want to check the manual for the USART that connects to the ST-LINK's VCP. On other Nucleo's this is USART2 on PA2/PA3, but you'd need to double check.

The SWV will also work with the ST-LINK Utilities.

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