The phyCORE-i.MX7 Development Kit is configured by default to use UART1 (ttymxc0 in the device tree) for console input and output. UART1 is routed to the micro-USB connector X6 for ease of use. UART5 is also available via the RS-232 serial interface at the connector X2 (ttymxc4). This guide will walk through the steps needed to verify the functionality of UART5. In order to follow this guide you will need a USB to RS-232 Serial Adapter (included with your kit).
The following instructions assume the use of a windows PC as the host machine when setting up your serial connection.
- Connect the D-sub 9 ribbon cable (included with your kit) to the X2 connector (red line indicates Pin 1)
- Open the device manager on your host machine.
- Connect the USB to RS-232 Serial Adapter to your host computer and the D-sub 9 ribbon cable and make note of any new devices that appear under "Ports". We will need the COM port the device is listed under for the next step.
- Using your terminal emulator with a baud rate of 115200, begin a new connection using the COM port found in the previous step.
In your Linux console enter the following to set the communication rate for UART5:
stty -F /dev/ttymxc4 115200CODE
Now try sending a message to your host machine using the UART5 connection:
echo 'Testing UART5!' > /dev/ttymxc4CODE
You should see "Testing UART5!" output to the new UART5 console.
If you have trouble receiving or sending messages to a Console Terminal, ensure that you have the correct COM port set and the terminal is configured for 8 bit data, no parity bits, 1 stop bit, and a baud rate of 115200.
To receive messages from your host machine, set your Linux console to output any incoming data from the UART5 connection:
Now type anything you want in the new UART5 console and watch it output to the Linux console once you hit enter.
Enter Ctrl + C in the Linux console to stop waiting for incoming data.
Enable UART5 as a Console in Linux
To enable UART5 as an additional console in Linux, run the following commands. Note that this setting will persist between boots but will not affect the default console in U-Boot and Linux.
systemctl enable email@example.com systemctl start firstname.lastname@example.org
Configuring UART5 as Default Console in U-Boot and Linux
If you would like to use UART5 as the console in U-Boot and Linux, halt the boot process by pressing any key within 3 seconds of applying power to enter U-Boot.
Now modify the Linux configuration by running the following commands:
=> env set console=ttymxc4 => boot
You should see the normal Linux boot output on the UART5 serial console. You should also be able to login, send commands, and receive console output.
If you would like to enable UART5 as the default console in the BSP, modify the U-Boot file 'include/configs/mx7d_phyboard_zeta.h' to match the following lines and recompile and re-deploy U-Boot onto your boot media:
#define CONFIG_MXC_UART_BASE UART5_IPS_BASE_ADDR
#define CONFIG_CONS_INDEX 5
/* under the define for CONFIG_EXTRA_ENV_SETTINGS */ "console=ttymxc4\0"