Loading...
 
Skip to main content

System Workbench for STM32


printf through uart

I got the _read(), _write() method by MSchultz to work, mostly.

STM32F437, using HAL from STM32 Cube.

This prints fine:

Copy to clipboard
printf(" Hello World \n");

The problem is when I print with a leading newline '\n' character in the print string. This

Copy to clipboard
printf("\n Hello World ");

arrives at _write as a length = 1 string containing only the newline character. The rest of the string appears to be lost, it never gets printed.

I've tried all three options of setbuf(), no buffering and line buffering work the same, as I described, losing the rest of the string after '\n'. Full buffering never prints anything.

Any ideas how I can fix this?

thanks, Michael

 
Collapse/expand modules below