Search by Tags

Serial port registry settings

 

Compare with Revision




Subscribe for this article updates

PXA Family Settings

Serial port settings can be made for all available ports. The serial ports are mapped as follows:

  • Serial1: FFUART
  • Serial2: BTUART
  • Serial3: STDUART
[HKLM\Drivers\BuiltIn\SerialX]
"RxBufferSize"          = "dword:0"    ;Default is 0. Size of the SW receive buffer in Bytes. Everything below 2kBytes will be set to 2kBytes.
"XmitFifoSize"          = "dword:64"   ;Default is 64. Serial Port TX FIFO can be limited (if you have LCD buffer underruns on PXA3xx)
"XmitInterruptLevel"    = "dword:0"    ;Default is 0. If 0 generates an interrupt at half FIFO level 
                                       ;otherwise generates an interrupt if FIFO is empty. (New in V3.6 beta1)
"WaterMarker"           = "dword:32"   ;Default is 32. Defines the receive fifo level which generates an interrupt. Valid are 1, 8, 16 and 32 bytes.
"DisableFifo"           = "dword:0"    ;Default is 0. If 0 use FIFOs, if 1 don't use FIFOs (New in V3.6 beta1)
"RTSToggleAlwaysOn"     = "dword:0"    ;Default is 0. If 1 DCB.fRtsControl is always set to "RTS_CONTROL_TOGGLE" 
"RTS_Pol"               = "dword:0"    ;Default is 0. Change the polarity of the RTS signal. (e.g used as enable signal in RS485 communication)
"WaitForTXcomplete"     = "dword:1"    ;Default is 1 which means it driver will wait until all data is sent before returning control to the app
                                       ;If you set this value to 0, the write function will return before all data is transmitted over the Serial port.
                                       ;This can be helpful if you transmit a lot of small packages. Be aware, that the write function doesn't return immediately,
                                       ;it returns after it wrote the last data to the transmit buffer.
"WaitTXCompleteTimeout" = "dword:-1"   ;BSP 4.1 and higher: Default is -1 (Infinite). Sets time in milliseconds until transmission gets aborted if not completed before.
"AllowAutoFlowCtrl"     = "dword:1"    ;BSP 3.9 and higher: Default is 1. 0 means the driver doesn't use the AutoFlowCtrl feature of the PXA and uses software
                                       ;RTS and CTS handling as done in earlier BSP versions. 1 enables the AutoFlowCtrl feature of the PXA (hardware handling of
                                       ;RTS and CTS) when:
                                       ; - CTS is enabled (dcb.fOutxCtsFlow=1) AND
                                       ; - RTS is set to handshake (dcb.fRtsControl=RTS_CONTROL_HANDSHAKE) AND
                                       ; - RTS_Pol is 0.
"DeviceArrayIndex"      = "dword:0x80" ;Defines which UART has to be used: 
                                       ;0x00000080: UART1 / 0x00000081: UART2 / 0x00000082: UART3 / 0x00000083: UART4

Registry keys to change the pin assignment of the serial signals, available in Image V3.4 beta 1 and onwards.

[HKLM\Drivers\BuiltIn\SerialX]
      "RXDGPIO" = "dword:-1"
      "TXDGPIO" = "dword:-1"
      "CTSGPIO" = "dword:-1"
      "DCDGPIO" = "dword:-1"
      "DSRGPIO" = "dword:-1"
      "RIGPIO"  = "dword:-1"
      "DTRGPIO" = "dword:-1"
      "RTSGPIO" = "dword:-1"

With this registry keys, you can define a GPIO for the different UART functions. But ensure that the GPIO also has the special functionality available. You find more information about the special functionality of the GPIOs in the PXA Datasheet
If you set the value to -1, No GPIO is used.
By default none of theses keys are in the registry, hence all available GPIOs for all Serial ports are initialized by the driver. The GPIOs used are selected in order to match the Colibri Evaluation Board V2.1.

Tegra Family Settings

Naming Convention Overview

For compatibility with other Colibri modules Toradex did not use the function names and order of the serial ports from NVidia. Have a look at the following table for the mapping information:

Toradex Name Old Toradex Name Nvidia Name Device Array Index Default SW Configuration
UART_A FF_UART UART1 0x80 Serial 1 / CoM1:
UART_B BT_UART UART4 0x81 Serial 2 / CoM2:
UART_C STD_UART UART2 0x82 Serial 3 / CoM3:
UART_D - UART3 0x83 No set by default
UART_E - UART5 0x84 No set by default

Colibri Tegra Registry Settings

Serial port settings can be made for all available ports if not stated different.

[HKLM\Drivers\BuiltIn\SerialX]
"RTSToggleAlwaysOn"  = "dword:0"    ; Default is 0. If 1 DCB.fRtsControl is always set to "RTS_CONTROL_TOGGLE" (New in 1.3 beta 1)
"RTSPol"             = "dword:0"    ; Default is 0. Change the polarity of the RTS signal. (e.g used as 
                                    ; enable signal in RS485 communication) (New in 1.3 beta 1)
"WaitForTXcomplete"  = "dword:1"    ; Default is 1 which means it driver will wait until all data is sent before 
                                    ; returning control to the app
"DCDPin"             = "dword:31"   ; SODIMM Pin for DCD. -1 means no DCD pin. Only on Serial1 (Default 31) (New in 1.2)
"DSRPin"             = "dword:29"   ; SODIMM Pin for DSR. -1 means no DSR pin. Only on Serial1 (Default 29) (New in 1.2)
"DmaSetting"         = "dword:1"    ; Bit Mask with Bit 0: RX DMA, Bit 1: TX DMA
                                    ; i.e. Decimal 0 means use NO DMA, 1 DMA for RX, 2 for DMA TX
                                    ; and 3 DMA for RX and TX (default is 1)
"PinMuxConfig"       = "dword:0"    ; Use different pin configuration for each of the serial ports. Only use this if there is no
                                    ; way to use the default pin configuration. (New in 1.2)
                                    ; Get in contact with support for more information. (Note 1)
"DeviceArrayIndex"   = "dword:16"   ; Defines which UART has to be used: 
                                    ; 0x00000080: UART_A | 0x00000081: UART_B | 0x00000082: UART_C 
                                    ; 0x00000083: UART_D | 0x00000084: UART_E

Notes:

  1. More details about PinMuxConfig settings can be found here.

Colibri VFxx Registry Settings

On the Vybrid-based modules three serial ports are configured by default: UARTA, UARTB, UARTC. Each port is configured under a registry key named: [HKLM\Drivers\BuiltIn\UARTX] It is possible to enable two additional ports (with some limitations) by following the instruction in this article. The serial ports signals can be multiplexed to different pins, by default singnals for UARTA,UARTB and UARTC are configured to be compatible with the other modules of the Colibri family. Each pin can be configured using registry entries.

[HKLM\Drivers\BuiltIn\UARTX]
"TXPIN"              = "dword:XX"
"TXPIN"              = "dword:XX"
"RXPIN"              = "dword:XX"
"RXAF"               = "dword:XX"
"RTSPIN"             = "dword:XX"
"RTSAF"              = "dword:XX"
"CTSPIN"             = "dword:XX"
"CTSAF"              = "dword:XX"
"DTRPIN"             = "dword:XX"
"DTRAF"              = "dword:XX"
"DSRPIN"             = "dword:XX"
"DSRAF"              = "dword:XX"
"RTSToggleAlwaysOn"  = "dword:0"    ; Default is 0. If 1 DCB.fRtsControl is always set to "RTS_CONTROL_TOGGLE" (New in 1.3 beta 1)
"RTSPol"             = "dword:0"    ; Default is 0. Change the polarity of the RTS signal. 
"Priority256"        = "dword:67"

The value specified reference a pin number on the SO-DIMM connector. If you want to use the processor's GPIO pin numbers you can do that by adding 0x80000000 to the GPIO number. ex: 0x80000002 references GPIO 2. Different combinations are available for the pins, check VFxx pinmux detail for reference. Changing pinouts for UARTA, UARTB and UARTC may break compatiblity with other Colibri modules and existing carrier boards.

Colibri iMX7, Colibri iMX6 and Apalis iMX6 Registry Settings

On the iMX6/iMX7-based modules serial port pins can be configured using the generic approach described in this article: http://developer.toradex.com/knowledge-base/pin-multiplexing-for-drivers This is not needed if you plan to use the standard pinout for the default UARTS defined for Colibri and Apalis.