Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Targeted HardwarephyBOARD-Zeta (i.MX7)
Targeted Software

BSP Yocto FSL iMX7 PD18.1.1

Date

 


Summary

...

The serial console is essential for communication with and development of your design. This how-to guide will demonstrate the steps required to change the default serial debug console configuration.

This is a summary of the how to.

Specifically, the phyBOARD-Zeta uses UART5 as the default serial console. This requires a breakout cable assembly to expose the RS-232 pins that are available on a pin header on the Zeta board, a null modem cable, and finally a serial cable to the host. The PEB-EVAL-02 board exposes UART1 via RS-232 on a DB9 connector. This will be the target configuration that the how-to guide will demonstrate.

Image Added

Step-by-step guide

...

u-boot

To change the serial console for u-boot, you'll need to modify the CONFIG_CONS_INDEX and CONFIG_MXC_UART_BASE definitions in the u-boot source:.

change Change CONFIG_CONS_INDEX to indicate the index of the UART that is desired. In this case, we will change it from 5 to 1:

Code Block
firstline45
titleConfigured for UART5
linenumberstrue
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
#undef CONFIG_CONS_INDEX
#define CONFIG_CONS_INDEX 5
#define CONFIG_BAUDRATE 115200


Code Block
firstline45
titleConfigured for UART1
linenumberstrue
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
#undef CONFIG_CONS_INDEX
#define CONFIG_CONS_INDEX 1
#define CONFIG_BAUDRATE 115200

...

Change CONFIG_MXC_UART_BASE to indicate the UART base address of the UART that is desired. In this case, we will change it from 5 to 1:

Code Block
firstline43
titleConfigured for UART5
linenumberstrue
#define CONFIG_MXC_UART_BASE        UART5_IPS_BASE_ADDR


Code Block
firstline43
titleConfigured for UART1
linenumberstrue
#define CONFIG_MXC_UART_BASE        UART1_IPS_BASE_ADDR

...

Verify the desired UART pins are muxed correctly in u-boot:

Code Block
firstline118
linenumberstrue
&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1>;
	assigned-clocks = <&clks IMX7D_UART1_ROOT_SRC>;
	assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>;
	status = "okay";
};

...


Linux

Change the SERIAL_CONSOLE to indicate the desired 'ttymxc' device in the imx7d_phyboard_zeta_001 machine configuraitonconfiguration. In this case, we will change it from a 4 to a 0:

Note

In Linux the devices are zero indexed. For example, UART1 corresponds to ttymxc0 and UART5 corresponds to ttymxc4.


Code Block
firstline3
titleConfigured for UART5
linenumberstrue
SERIAL_CONSOLE = "115200 ttymxc4"

to:


code
Code Block
firstline3
titleConfigured for UART1
linenumberstrue
SERIAL_CONSOLE = "115200 ttymxc0"

...

You'll also want to verify the desired UART pins are muxed in your device tree:

Code Block
firstline118
linenumberstrue
&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1>;
	assigned-clocks = <&clks IMX7D_UART1_ROOT_SRC>;
	assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>;
	status = "okay";
};


Content by Label
showLabelsfalse
max5
spacesSUP
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "PRODUCTINFO"
labelskb-how-to-article

...

hiddentrue

...