i.MXRT1060 Middleware Pack  Version 1.0.0
MDK-Middleware examples and CMSIS-Drivers for NXP i.MXRT1060 devices
 All Files Pages
CMSIS-Driver for UART1 Interface

The CMSIS-Driver for UART Interface is part of NXP DFP, below is an explanation on how UART1 driver can be used with MDK.

To use the CMSIS-Driver UART1, do the following:

  • In the Manage Run-Time Environment window, enable CMSIS Driver:USART (API):lpuart_cmsis
  • Copy lpuart1.c file form <PACK_root>\Templates to <project_dir> and add it to the project
  • Copy RTE_Device.h file form <PACK_root>\CMSIS\Driver\Config to <project_dir>\RTE\Device\<selected_device>
  • In project open Device:RTE_Device.h, you can use Configuration Wizard view, and enable UART:UART1 [Driver_USART1]. Optionally enable DMA for Tx and Rx Channels.
  • Create LPUART1_InitPins and LPUART1_DeinitPins functions (refer to the pin configuration below)
Note
UART1 is routed through Virtual COM port on the USB. You need to install the Mbed Windows serial driver to be able to communicate via UART1. Download and install the driver from here: Windows serial driver.

CMSIS-Driver for UART1 Interface Setup

The CMSIS-Driver UART1 Interface requires:

  • UART1 Pins
  • UART1 Clock

Valid pin settings for UART1 peripheral on EVK-IMXRT1060 evaluation board are listed in the table below:

# Peripheral Signal Route to Direction
L14 LPUART1 RX GPIO_AD_B0_13 Input
K14 LPUART1 TX GPIO_AD_B0_12 Output

The rest of the settings can be at the default (reset) value.

For other boards or custom hardware, refer to the hardware schematics to reflect correct setup values.

In the MCUXpresso Config Tools, make sure that the following pin and clock settings are made (enter the values that are shown in italics):

  1. Select Pins -> Functional Groups main menu and create functions LPUART1_InitPins and LPUART1_DeinitPins
  2. Under the Functional Group entry in the toolbar, select LPUART1_InitPins
  3. Modify Routed Pins configuration to match the settings listed in the table above
  4. Under the Functional Group entry in the toolbar, select LPUART1_DeinitPins
  5. Modify Routed Pins configuration to match the settings required after UART pin deinitialization
  6. Go to Tools - Clocks
  7. Go to Views - Clocks Diagram and check that UART clock is set to 80 MHz
  8. Click on Update Project button to update source files