Support is included in this processor HAL package for the SAM9's on-chip debug unit UART and up to four serial USART serial devices.
There are two forms of support: HAL diagnostic I/O; and a fully interrupt-driven serial driver. Unless otherwise specified in the platform HAL documentation, for all serial ports the default settings are 115200,8,N,1 with no flow control.
HAL diagnostic I/O
This first form is polled mode HAL diagnostic output, intended primarily for use during debug and development. Operations are usually performed with global interrupts disabled, and thus this mode is not usually suitable for deployed systems. This can operate on any port, according to the configuration settings.
There are several configuration options usually found within a platform HAL
which affect the use of this support in the SAM9 processor HAL.
The CDL option
selects the serial port channel to use as the console at startup time.
This will be the channel that receives output from, for example,
diag_printf(). The CDL option
CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL selects the
serial port channel to use for GDB communication by default. Note that
when using RedBoot, these options are usually inactive as it is RedBoot
that decides which channels are used. Applications may override
RedBoot's selections by enabling the
CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_COMMS CDL option
in the HAL. Baud rates for each channel are set with the
Interrupt-driven serial driver
The second form of support is an interrupt-driven serial driver, which
is integrated into the eCos standard serial I/O infrastructure
CYGPKG_IO_SERIAL). This support can be enabled
on any port.
Note that it is not recommended to share this driver when using the HAL diagnostic I/O on the same port. If the driver is shared with the GDB debugging port, it will prevent ctrl-c operation when debugging.
This driver is contained in the
package. That driver package should also be consulted for
documentation and configuration options. The driver is not active until the
CYGPKG_IO_SERIAL_DEVICES configuration option within the
generic serial driver support package
enabled in the configuration.
Note that unlike the USART devices, the serial debug port does not support modem control signals such as those used for hardware signals. In addition, USART devices for a particular platform may also not have these control signals brought out to the physical serial port.