Connecting Serial Console to the NXP i.MX RT10XX EVK Board
Running Linux (uClinux) on the i.MX RT10XX will require a serial console. U-Boot and Linux make use of the serial console to print messages and provide an interactive user interface. You won't be able to do much unless you have access to the serial console.
Both U-Boot and Linux are configured to use LPUART1 for the serial console on the NXP i.MX RT10XX EVK.
The connector and jumper designators differ from board to board, and in some cases between revisions of the same board. The tables below give the designators for each of the supported boards. They refer to the following NXP schematics:
Note that both revisions of the i.MX RT1050 EVKB are branded "EVKB" but use different designators for the connectors of interest. The board revision is printed on the PCB; alternatively, the two are easy to tell apart by the isolation jumpers described in section 2 - they are labelled J30 and J31 on rev A, and J45 and J46 on rev B.
The original i.MX RT1050 EVK, the board that precedes the EVKB, is not supported by this BSP and is not covered here.
1. Connecting Serial Console Using a microUSB Cable
Each of the EVK boards carries an on-board debug probe (Freelink / OpenSDA) that bridges LPUART1 to a USB CDC device. Connect a microUSB cable between the development host and the debug USB connector on the baseboard:
Assuming a connection using a microUSB cable on the Linux PC the i.MX RT10XX serial console will be visible as a /dev/ttyACMx device. The U-Boot and Linux software configures the console for 115200 bps operation.
There are various serial communication tools available for Linux, the most popular perhaps being kermit. kermit is a very powerful tool that can be run in interactive mode or controlled by a script. There is abundant documentation on kermit available in the Internet, if you require details.
One possibility is to define on the host a shell script similar to the one below:
$ vi console-imxrt.script
#!/usr/bin/kermit
set port /dev/ttyACM0
set speed 115200
set carrier-watch off
set flow-control none
set prefixing all
cChange the file mode to make the script an executable file:
$ chmod +x console-imxrt.scriptThen run the script whenever you need to get access to the console (you will need sufficient system privileges to run this script):
$ sudo ./console-imxrt.script
[sudo] password for :
Connecting to /dev/ttyACM0, speed 115200
Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
=>To exit kermit, type Ctrl-\ and then q.
2. Connecting Serial Console Using a USB UART Dongle
On the NXP i.MX RT10XX EVK, the LPUART1 signals are brought out at UART level on a pair of 1x2 isolation jumpers. In the default configuration these jumpers are installed, connecting LPUART1 to the on-board debug probe described in the previous section. Pin 1 of each jumper is the debug probe side, pin 2 is the i.MX RT side.
Remove both jumpers to disconnect the on-board debug probe, then connect the dongle to pin 2 of each.
The i.MX RT pins used for LPUART1 differ between the i.MX RT1024 and the i.MX RT1050 / i.MX RT1060:
In order to connect the serial console to a PC, you must convert the UART interface either to an RS-232 interface or to a USB interface. This requires connecting an external device ("dongle") to the i.MX RT10XX EVK. There are various such devices available on the market. One specific device we have been using (among others) is the WaveShare FT232 USB UART board:
Note that the dongle receives on the pin the board transmits on, and vice versa:
WaveShare FT232 USB UART Board Connection | Connect To |
|---|---|
CON6.3 (TXD) | lpuart1.RX |
CON6.4 (RXD) | lpuart1.TX |
CON6.2 (GND) | GND |
The board still has to be powered. The power source is selected by a 2x5 jumper block, J1 on the i.MX RT1024 EVK, on both revisions of the i.MX RT1050 EVKB and on the i.MX RT1060 EVK (rev A), and J40 on the i.MX RT1060 EVKB (rev B). The positions are the same on all of them:
Jumper Position | Power Source |
|---|---|
1-2 | 5V power jack |
3-4 | USB OTG connector |
5-6 | Debug USB connector (the default) |
With the jumper in the default 5-6 position the board is powered from the debug USB connector listed in the previous section, so that cable must remain plugged in even when the console is taken from a dongle.
Assuming a connection using an USB UART board, on the Linux PC the i.MX RT10XX serial console will be visible as a /dev/ttyUSBx device. The U-Boot and Linux software configures the console for 115200 bps operation.
One possibility is to define on the host a shell script similar to the one below:
$ vi console-imxrt.script
#!/usr/local/bin/kermit
set port /dev/ttyUSB0
set speed 115200
set carrier-watch off
set flow-control none
set prefixing all
cChange the file mode to make the script an executable file:
$ chmod +x console-imxrt.scriptThen run the script whenever you need to get access to the console (you will need sufficient system privelegies to run this script):
$ sudo ./console-imxrt.script
[sudo] password for :
Connecting to /dev/ttyUSB0, speed 115200
Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
=> To exit kermit, type Ctrl-\ and then q.