Debug printouts to serial port are common technique for
logging/disagnostics. SeptemberOS provides configured UART interface on
all supported platforms.
NOTE: serial interface is relatively
slow and the platform with delays introduced by printouts may behave
differently than the same platform without them. You should always
consider whether the bevaiour that you investigate was not caused by
- You may print from application code using
printf() and fprintf(), fwrite(), fputs(), fputc() etc. stdout and
stderr are by default configured to a serial port.
- You may print from any system code with
serial_printf(). It receives the same variable parameters list as
printf(), but prints out directly to serial port without passing via
POSIX file descriptors and API functions. serial_printf() busy-polls
UARt status in order to send your printout; it doesn't use any
interrupt and therefore is appropriate to debug even interrupt handlers.