U-Boot 命令行中没有输入

问题描述 投票:0回答:2

看起来我要么失去了如何通过谷歌搜索答案的技能,要么错过了配置中太明显的选项。不管怎样,我有一个针对 x86 的 U-Boot 最新版本,它可以在命令提示符之前工作,但不幸的是我无法输入任何内容。

向 ns16550 驱动程序的 getc() 添加了调试打印,显示输入实际上存在,但屏幕上没有回显,并且如果我正确键入并按 Enter 键则不会实际执行命令。

fdtdec_get_config_string: bootcmd
fdtdec_get_config_int: bootsecure
fdtdec_get_int: bootsecure: (not found)
=> getc() d
getc() d
getc() 70
getc() 72
getc() 69
getc() 6e
getc() 74
getc() 65
getc() 6e
getc() 76
getc() d

(有 EnterEnter

printenv
+ Enter

只有串行接口,所以我无法切换到其他接口。

x86 serial-port device-driver u-boot
2个回答
1
投票

U-Boot 既不使用 Xon/Xoff 也不使用硬件握手。请检查您的终端模拟器中是否禁用了这些功能。

这三个环境变量影响使用哪个控制台:

  • stderr=串行
  • stdin=串行
  • stdout=串行

请检查它们的价值。


0
投票

问题出现在损坏的硬件中(这实际上是一个模拟),其中未对齐的 I/O 字节访问不起作用。所以,发生的事情发生在以下代码之间:

if (!(serial_in(&com_port->lsr) & UART_LSR_DR))
    return -EAGAIN;

由于 LSR 的地址为 0x3fd(偏移量 5),因此

serial_in()
返回
0xFF
,因此假设数据可用,则从此处跳过返回,而读取 RBR 时会重复返回
0x00

解决方案是修复硬件,或者为其制作自定义串行驱动程序。

© www.soinside.com 2019 - 2024. All rights reserved.