简体   繁体   English

beaglebone black:启用 uart 时没有插槽

[英]beaglebone black: no slots while enable uart

I'm trying to use UART5 with python, I've edited uEnv.txt to disable HDMI我正在尝试将 UART5 与 python 一起使用,我已编辑 uEnv.txt 以禁用 HDMI

I've upgraded BeagleBone Black to Debian 10 BeagleBoard.org Debian Buster IoT Image 2020-04-06我已将 BeagleBone Black 升级到 Debian 10 BeagleBoard.org Debian Buster IoT Image 2020-04-06

uname -a shows: uname -a显示:

Linux beaglebone 4.19.94-ti-r45 #1buster SMP PREEMPT Thu Jun 18 19:18:41 UTC 2020 armv7l GNU/Linux

I'm trying to use UART5 with python, but it fails with every UART, python shows the message:我正在尝试将 UART5 与 python 一起使用,但每个 UART 都失败,python 显示消息:

py_setup_uart(UART5): set_pin_mode() failed for pin=P8_38Traceback (most recent call last):

when I execute config-pin it shows:当我执行config-pin它显示:

/sys/devices/platform/ocp/ocp:P8_34_pinmux/state failed, No such device

also there is no slots: /sys/devices/bone_capemgr.*/slots': No such file or directory也没有插槽:/sys/devices/ /sys/devices/bone_capemgr.*/slots': No such file or directory

dmesg | grep serial dmesg | grep serial shows: dmesg | grep serial显示:

[    1.667328] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 21, base_baud = 3000000) is a 8250
[    1.699936] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 28, base_baud = 3000000) is a 8250
[    1.700824] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 29, base_baud = 3000000) is a 8250
[    1.701657] 481a6000.serial: ttyS3 at MMIO 0x481a6000 (irq = 42, base_baud = 3000000) is a 8250
[    1.702467] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 43, base_baud = 3000000) is a 8250
[    1.703290] 481aa000.serial: ttyS5 at MMIO 0x481aa000 (irq = 44, base_baud = 3000000) is a 8250

here is my /boot/uEnv.txt这是我的 /boot/uEnv.txt

#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.19.94-ti-r45
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/<file0>.dtbo
#uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
#uboot_overlay_addr2=/lib/firmware/<file2>.dtbo
#uboot_overlay_addr3=/lib/firmware/<file3>.dtbo
###

###Overide capes with eeprom
uboot_overlay_addr0=/lib/firmware/BB-UART1-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/BB-UART2-00A0.dtbo
uboot_overlay_addr2=/lib/firmware/BB-UART4-00A0.dtbo
uboot_overlay_addr3=/lib/firmware/BB-UART5-00A0.dtbo


###Additional custom capes
#uboot_overlay_addr4=/lib/firmware/<file4>.dtbo
#uboot_overlay_addr5=/lib/firmware/<file5>.dtbo
#uboot_overlay_addr6=/lib/firmware/<file6>.dtbo
#uboot_overlay_addr7=/lib/firmware/<file7>.dtbo
###

###Custom Cape
#dtb_overlay=/lib/firmware/<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
enable_uboot_cape_universal=1
##Disable HDMI
cape_disable=bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
optargs=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet video=HDMI-A-1:1024x768@60e

##enable Generic eMMC Flasher:
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

please help me请帮我

The cryptic error "No such device" from config-pin means you tried to select a mode that doesn't exist for that pin.来自config-pin的神秘错误“没有这样的设备”意味着您尝试 select 一个该引脚不存在的模式。 P8_34 has no uart mode, uart 5 uses P8_37 for txd and either P8_38 or P8_31 for rxd. P8_34 没有 uart 模式,uart 5 将 P8_37 用于 txd,P8_38 或 P8_31 用于 rxd。 So for example:例如:

config-pin P8_37 uart
config-pin P8_38 uart

You can also use this tiny python module to perform the function of config-pin in your python code, eg:您还可以使用这个微型 python 模块在 python 代码中执行配置引脚的 function 代码,例如:

from bone_pinmux import set_pinmux_state  # https://pastebin.com/MKtWJ8G8
set_pinmux_state( 'P8_37', 'uart' )
set_pinmux_state( 'P8_38', 'uart' )

bone_capemgr is obsolete, it no longer exists. bone_capemgr 已过时,不再存在。 I'm guessing the cape_disable=bone_capemgr.disable_partno= line in your /boot/uEnv.txt is some old info you found on the web you tried, but that's equally obsolete.我猜 /boot/uEnv.txt 中的cape_disable=bone_capemgr.disable_partno=行是您在您尝试过的 web 上找到的一些旧信息,但这同样已过时。 optargs=capemgr.enable_partno= looks even more ancient. optargs=capemgr.enable_partno=看起来更加古老。

Typically you'd just uncomment disable_uboot_overlay_video=1 (like you did) to free up the hdmi-related pins (P8.27-46, P9.25, P9.28-29, P9.31) and use config-pin to configure the pins at runtime.通常,您只需取消注释disable_uboot_overlay_video=1 (就像您所做的那样)以释放与 hdmi 相关的引脚(P8.27-46、P9.25、P9.28-29、P9.31)并使用 config-pin 进行配置运行时的引脚。

Alternatively you can still use overlays if you want to, though preferably you should use the variables uboot_overlay_addr4..7 and dtb_overlay for those.或者,如果您愿意,您仍然可以使用叠加层,但最好使用变量 uboot_overlay_addr4..7 和 dtb_overlay 。 uboot_overlay_addr0..3 are primarily intended to override the auto-detected overlays for actual physical capes (with cape identification eeprom), though in the absence of capes you can use them for additional overlays. uboot_overlay_addr0..3 主要用于覆盖自动检测到的实际物理 cape(带有 cape 标识 eeprom)的覆盖,但在没有 cape 的情况下,您可以将它们用于其他覆盖。

Keep in mind that if pins are configured by an overlay, they cannot be reconfigured at runtime using config-pin.请记住,如果引脚由覆盖配置,则无法在运行时使用 config-pin 重新配置它们。

in /boot/uEnv.txt, uncomment disable_uboot_overlay_video=1 .在 /boot/uEnv.txt 中,取消注释disable_uboot_overlay_video=1

Things can get complicated if the uncommenting of the _video=1 line does not work.如果取消注释 _video=1 行不起作用,事情可能会变得复杂。

I can help further but please reply if it works or not.我可以提供进一步的帮助,但请回复是否有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM