U-Boot 不会从串行 Raspberry Pi Model 3 B 获取键盘输入

发布于 2025-01-17 02:55:09 字数 3080 浏览 3 评论 0原文

我已经有了计算模块 3+ 的工作配置。因为我需要在树莓派 Model 3 BI 上进行相同的设置,所以尝试将配置带过来。

一切都是在 buildroot 环境中编译的。使用U-Boot v2020.10。

在对设备树和 dtoverlays 进行一些小更改后,我设法让 U-Boot 在串行控制台上打印(如预期),但它忽略所有键盘输入。 以下输出由 U-Boot 在串行控制台上生成。

编辑 我在这里非常宽松地使用了串行这个术语。我使用串行 USB 适配器和 picocom 连接到串行控制台。我应用了 miniuart-bt 覆盖层来分别恢复 gpio 引脚 14/15 上的 /dev/ttyAMA0UART0。 最后我用 PL011 配置了 U-Boot。 我省略了对 mini-uart 的支持,因为这也会破坏输出。 此配置在计算模块上运行良好,但无法在模型 3B 上注册输入。

编辑 我将工作中的 u-boot.bin 从 cm 3 移至型号 B,看看会发生什么。它似乎有效,因为两者都足够接近。但同样的问题也出现了。反之亦然,但它不起作用。因此,这可能不是 U-Boot 的问题,而是 Model B 配置的问题。

  1 Isa-Boot>·                                                                     
  2                                                                                
  3 U-Boot 2020.10 (Mar 24 2022 - 12:18:38 +0000)                                  
  4                                                                                
  5 DRAM:  924 MiB                                                                 
  6 RPI 3 Model B (0xa02082)                                                       
  7 MMC:   mmc@7e202000: 0, sdhci@7e300000: 1                                      
  8 In:    serial                                                                  
  9 Out:   vidconsole                                                              
 10 Err:   vidconsole                                                              
 11 Hit any key to stop autoboot:  0·

我既无法停止自动启动,也无法使用 shell 来完成启动脚本。

我尝试了大约一百万种配置,但我不知道这种行为的原因是什么。我也从未使用 cm 模块经历过这种情况。

RPi 设置 config.txt:

enable_uart=1
start_file=start.elf
fixup_file=fixup.dat
kernel=u-boot.bin
gpu_mem=100
dtoverlay=miniuart-bt
dtparam=spi=on
device_tree=bcm2710-rpi-3-b.dtb
dtoverlay=sc16is750-spi0-ce0

U-Boot defconfig:

CONFIG_ARM=y
CONFIG_ARCH_CPU_INIT=y
CONFIG_ARCH_BCM283X=y
CONFIG_SYS_TEXT_BASE=0x00008000
CONFIG_TARGET_RPI_3_32B=y
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_NR_DRAM_BANKS=1
CONFIG_ENV_SIZE=0x4000
CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_MISC_INIT_R=y
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SYS_PROMPT="Isa-Boot> "
CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
CONFIG_OF_EMBED=y
# CONFIG_ENV_IS_IN_FAT is not set
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
# CONFIG_NET is not set
CONFIG_DM_MMC=y
# CONFIG_MMC_HW_PARTITIONING is not set
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_BCM2835=y
CONFIG_DM_ETH=y
CONFIG_PINCTRL=y
# CONFIG_PINCTRL_GENERIC is not set
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
# CONFIG_BCM283X_MU_SERIAL is not set
CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_DM_VIDEO=y
# CONFIG_VIDEO_BPP8 is not set
# CONFIG_VIDEO_BPP16 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_CONSOLE_SCROLL_LINES=10
CONFIG_PHYS_TO_BUS=y
CONFIG_OF_LIBFDT_OVERLAY=y

I already have a working config for a compute module 3+. As I need the same setup on a raspberry Pi Model 3 B I tried bringing the config over.

Everything is compiled in a buildroot environment. U-Boot v2020.10 is used.

After some small changes regarding the device tree and dtoverlays I managed to get U-Boot to print on the serial console(as expected), but it ignores all keyboard input.
The following output is produced by U-Boot on serial console.

EDIT
I used the term serial very loosely here. I'm connected to the serial console with a serial-USB adapter and picocom. I applied the miniuart-bt overlay to restore /dev/ttyAMA0 respectively UART0 on gpio pins 14/15.
Lastely I configured U-Boot with PL011.
I left out support for mini-uart as this would break the output too.
This configuration works just fine on the compute module, but doen't register input on the model 3B.

EDIT
I moved the working u-boot.bin from the cm 3 to the model B to see what happens. It seemingly works as both are close enough. But the same problem occurs. The other way around though it does not work. So it is potential not a problem with U-Boot but with the Model B configuration.

  1 Isa-Boot>·                                                                     
  2                                                                                
  3 U-Boot 2020.10 (Mar 24 2022 - 12:18:38 +0000)                                  
  4                                                                                
  5 DRAM:  924 MiB                                                                 
  6 RPI 3 Model B (0xa02082)                                                       
  7 MMC:   mmc@7e202000: 0, sdhci@7e300000: 1                                      
  8 In:    serial                                                                  
  9 Out:   vidconsole                                                              
 10 Err:   vidconsole                                                              
 11 Hit any key to stop autoboot:  0·

Neither can I stop autoboot nor can I use the shell to complete the boot script.

I tried what feels like a million configurations and I'm out of ideas what could be the reason for this behavior. I also never experienced this with the cm module.

RPi setup config.txt:

enable_uart=1
start_file=start.elf
fixup_file=fixup.dat
kernel=u-boot.bin
gpu_mem=100
dtoverlay=miniuart-bt
dtparam=spi=on
device_tree=bcm2710-rpi-3-b.dtb
dtoverlay=sc16is750-spi0-ce0

U-Boot defconfig:

CONFIG_ARM=y
CONFIG_ARCH_CPU_INIT=y
CONFIG_ARCH_BCM283X=y
CONFIG_SYS_TEXT_BASE=0x00008000
CONFIG_TARGET_RPI_3_32B=y
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_NR_DRAM_BANKS=1
CONFIG_ENV_SIZE=0x4000
CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_SYS_STDIO_DEREGISTER=y
CONFIG_MISC_INIT_R=y
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SYS_PROMPT="Isa-Boot> "
CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
CONFIG_OF_EMBED=y
# CONFIG_ENV_IS_IN_FAT is not set
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
# CONFIG_NET is not set
CONFIG_DM_MMC=y
# CONFIG_MMC_HW_PARTITIONING is not set
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_BCM2835=y
CONFIG_DM_ETH=y
CONFIG_PINCTRL=y
# CONFIG_PINCTRL_GENERIC is not set
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
# CONFIG_BCM283X_MU_SERIAL is not set
CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_DM_VIDEO=y
# CONFIG_VIDEO_BPP8 is not set
# CONFIG_VIDEO_BPP16 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_CONSOLE_SCROLL_LINES=10
CONFIG_PHYS_TO_BUS=y
CONFIG_OF_LIBFDT_OVERLAY=y

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红焚 2025-01-24 02:55:09

从 U-boot 文档“U-boot 环境变量”中:

bootdelay:重置后,U-Boot 将等待此秒数,然后再执行 bootcmd 变量的内容。在此期间会打印倒计时,可以通过按任意键中断。

将此变量设置为 0 立即启动。请注意:根据 bootcmd 变量的内容,这可能会永远阻止您再次输入交互式命令!

在您的情况下这个值是 0 吗?

From U-boot documentation, "U-boot Environment Variables":

bootdelay: After reset, U-Boot will wait this number of seconds before it executes the contents of the bootcmd variable. During this time a countdown is printed, which can be interrupted by pressing any key.

Set this variable to 0 boot without delay. Be careful: depending on the contents of your bootcmd variable, this can prevent you from entering interactive commands again forever!

Is this value 0 in your case?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文