| |||
| Home > Boot Monitor and platform library > Using the baseboard Boot Monitor and platform library > Redirecting character output to hardware devices | |||
The redirection of character I/O is carried out within the
Boot Monitor platform library routines in retarget.c and boot.s.
During startup, the platform library executes a SuperVisor
Call (SVC). If the image is being executed without a
debugger (or the debugger is not capturing semihosting calls) the
value returned by this SVC is -1, otherwise the value returned is
positive. The platform library uses the return value to determine
the hardware device used for outputting from the C library I/O functions. (Redirection
is through a SVC to the debugger console or directly to a hardware
device)
Supported devices for character output are:
:UART-0 (default
destination if debugger is not capturing semihosting calls)
:UART-1
:UART-2
:UART-3
:CHARLCD.
The STDIO calls are redirected within retarget.c.
Redirection depends on the setting of switches S6-2 and S6-3, see Boot Monitor configuration switches for details.