Name

Serial UARTs — Configuration and Implementation Details of Serial UART Support

Overview

Support is included in this processor HAL package for up to five of the i.MXxx's on-chip serial UART devices. Interfaces CYGINT_HAL_IMX_UART1 to CYGINT_HAL_IMX_UART5 indicate for each UART whether it is connected to an external port and should be implemented as appropriate by the platform HAL CDL.

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 IMX processor HAL. The CDL option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL 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 CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD and CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD options.

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.

The main part of this driver is contained in the generic CYGPKG_IO_SERIAL_ARM_IMX package. A platform specific package, for example CYGPKG_IO_SERIAL_ARM_MCIMX25, contains definitions that configure the generic driver for the platform. 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 CYGPKG_IO_SERIAL is enabled in the configuration.

Support for hardware flow control and modem control lines is present in the driver, but will only be enabled if these control signals are brought out to the physical serial port.