场景一:同样使用UART0,需要从PF2、PF4改到PE2、PE4

  1. 修改sys_config.fex(BOOT0与Uboot的串口)

sys_config.fex 的路径是 device/config/chips/t113/configs/evb1/sys_config.fex 中的 uart_debug_port

修改前:

[uart_para]
uart_debug_port = 0
uart_debug_tx   = port:PF02<3><1><default><default>
uart_debug_rx   = port:PF04<3><1><default><default>

修改后

[uart_para]
uart_debug_port = 0
uart_debug_tx   = port:PE02<6><1><default><default>
uart_debug_rx   = port:PE03<6><1><default><default>

其中<3>改为<6> 是查阅数据手册中 PE2、PE3 的UART0是 Function6 得知的

在这里插入图片描述

port:PE02    <6><1><default><default>
        ^     ^
       PE2脚  引脚功能6(查阅datasheet得知)
  1. 修改设备树(Linux使用的串口输出)

路径:device/config/chips/t113/configs/evb1/board.dts

修改前

uart0_pins_a: uart0_pins@0 {  /* For EVB1 board */
	pins = "PF2", "PF4";
	function = "uart0";
	drive-strength = <10>;
	allwinner,muxsel = <3>;
	bias-pull-up;
};

uart0_pins_b: uart0_pins@1 {  /* For EVB1 board */
	pins = "PF2", "PF4";
	function = "gpio_in";
};

修改后

uart0_pins_a: uart0_pins@0 {  /* For EVB1 board */
	pins = "PE2", "PE3";
	function = "uart0";
	drive-strength = <10>;
	allwinner,muxsel = <6>;
	bias-pull-up;
};

uart0_pins_b: uart0_pins@1 {  /* For EVB1 board */
	pins = "PE2", "PE3";
	function = "gpio_in";
};