Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    修改D1s的串口控制台,成功了但没完全成功,只能输出,不能输入,请教原因。(转)

    D1系列-RISC-V
    d1s 串口终端
    1
    1
    279
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • whycan
      whycan晕哥 LV 9 last edited by whycan

      是这样的,D1s的MQ补丁包里控制台是串口0,我需要改为串口1,在查了帖子和资料后,我做了如下修改:

      device/config/chips/d1/configs/mangopi_mq_rgb800x480_gt9xx/env.cfg

          - earlyprintk=sunxi-uart,0x02500000
          - console=ttyS0,115200
      
          + earlyprintk=sun02i-uart,0x02500400
          + console=ttyS1,115200
      

      device/config/chips/d1/configs/mangopi_mq_rgb800x480_gt9xx/sys_config.fex

          - uart_debug_port = 0
          - uart_debug_tx   = port:PE02<6><1><default><default>
          - uart_debug_rx   = port:PE03<6><1><default><default>
      
          + uart_debug_port = 1
          + uart_debug_tx   = port:PG06<2><1><default><default>
          + uart_debug_rx   = port:PG07<2><1><default><default>
      

      device/config/chips/d1/configs/mangopi_mq_rgb800x480_gt9xx/linux5.4/board.dts

          - uart1_pins_b: uart1_pins
          - uart_index  = <0x1>;
      
          + uart1_pins_b: uart1_pins@1                // 这里让串口1格式和其他串口都一致
          + uart_index  = <0x0>;                      // 不让btlpm占用串口1
      

      lichee/linux-5.4/arch/riscv/boot/dts/sunxi/board.dts

          - uart1_pins_b: uart1_pins
          - uart_index  = <0x1>;
      
          + uart1_pins_b: uart1_pins@1                // 原因和上面一样
          + uart_index  = <0x0>;                      // 原因和上面一样
      

      lichee/linux-5.4/arch/riscv/boot/dts/sunxi/sun20iw1p1.dtsi

          - status = "disabled";
          - bootargs = "console=ttyS0,115200n8 ...
          - stdout-path = "serial0:115200n8";
      
          + status = "okay";                          // 串口1使能
          + bootargs = "console=ttyS1,115200n8 ...    // chosen 部分
          + stdout-path = "serial1:115200n8";         // chosen 部分
      

      lichee/brandy-2.0/u-boot-2018/include/configs/sunxi-common.h

          + #undef CONFIG_CONS_INDEX
          + #define CONFIG_CONS_INDEX 2
      

      修改的地方有:env.cfg里配置控制台为ttyS1、sys_config.fex里初始化调试串口为串口1、board.dts里不让外设占用串口1、sun20iw1p1.dtsi里是能串口1并配置内核启动参数里的控制台为串口1、sunxi-common.h里强制定义CONFIG_CONS_INDEX为2(即串口1)。

      目前的现象:串口线接串口1,SD启动,已经可以看到完整的打印信息。本以为正确了,结果当我输入任意字符时(包括回车)终端都会原封不动的返回来,并不能进入系统! 当我刷入xboot固件时,发现串口1可以正常输入命令并交互,说明串口1及其外围硬件是没问题的。请问是哪里修改的不到位吗?

      原帖: 修改D1s的串口控制台,成功了但没完全成功,请教原因
      地址: https://whycan.com/t_7794.html

      1 Reply Last reply Reply Quote Share 0
      • Referenced by  whycan whycan 
      • 1 / 1
      • First post
        Last post

      Copyright © 2022 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策