Serial UARTs — Configuration and implementation details of serial UART support
Support is included in this processor HAL package for the AT91's on-chip debug unit UART and 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 38400,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 AT91 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.
The USARTs are named "/dev/ser0", "/dev/ser1" and so on. The DEBUG serial port is given the name "/dev/dbg". These names are all configurable.
Note that unlike the USART devices, the serial debug port does not support modem control signals such as those used for hardware flow control. In addition, USART devices for a particular platform may also not have these control signals brought out to the physical serial port.
|2022-09-14||eCosPro Non-Commercial Public License|