[PATCH 0/2] serial: introduce CONFIG_CONSOLE_FLUSH_ON_NEWLINE

Rasmus Villemoes rasmus.villemoes at prevas.dk
Mon Sep 25 13:00:59 CEST 2023


1/2 is trivial prep. Commit log from that 2/2:

When debugging, one sometimes only gets partial output lines or
nothing at all from the last printf, because the uart has a largish
buffer, and the code after the printf() may cause the CPU to hang
before the uart IP has time to actually emit all the characters. That
can be very confusing, because one doesn't then know exactly where the
hang happens.

Introduce a config knob allowing one to wait for the uart fifo to
drain whenever a newline character is printed, roughly corresponding
to the effect of setvbuf(..., _IOLBF, ...) in ordinary C programs.

Rasmus Villemoes (2):
  serial: serial-uclass.c: move definition of _serial_flush up a bit
  serial: introduce CONFIG_CONSOLE_FLUSH_ON_NEWLINE

 common/Kconfig                 | 11 +++++++++++
 drivers/serial/serial-uclass.c | 28 ++++++++++++++++------------
 2 files changed, 27 insertions(+), 12 deletions(-)

-- 
2.37.2



More information about the U-Boot mailing list