Enabling UART on Beaglebone Black

我们两清 提交于 2020-01-01 18:53:08

问题


I'm having trouble getting UART enabled. I've gone through many different directions on how to enable and troubleshoot from updating the uEnv.txt file to updating the kernel. I've come to conclude that it may be an issue with using a different kernel than the instructions, but I'm not sure? I don't know very much about the Beaglebone and I'm still learning. Whenever I try to test UART by using Python and typing the following:

import Adafruit_BBIO.UART as UART

UART.setup("UART1")

I get the error: File "stdin", line 1, in module

RuntimeError: Unable to export UART channel.

I'm also starting to worry that I simply don't have capemgr. When I run the command :

ls sys/devices

I don't have capemgr listed.

I'm using the latest Debian Image : Jessie Debian 8.3 (2016-01-24)

the Kernel version I'm running is 4.1.17-ti-rt-r46.

and my DTC version is 1.4.1-g1e75ebc9

I would really appreciate any help. I've been wrestling with this issue for a few days now. Thank you!


回答1:


Apparently the powers that be like to change files to keep us on our toes.

TamusJRoyce left a comment here: http://www.thing-printer.com/cape-manager-is-back-baby/ that helped me:

/media/BEAGLEBONE/env.txt and /boot/uBoot/uEnv.txt has moved to /etc/default/capemgr (file which may not exist). It also has a new syntax. Add "CAPE=BB-SPI-01,BB-UART1,BB-UART2,BB-UART4" to get main ports working. Then reboot.

To enable UART1 and UART2 on Beaglebone Black Running Debian 8

  • Step 1: sudo nano /etc/default/capemgr
  • Step 2: Change #CAPE= to: CAPE=BB-UART1,BB-UART2
  • Step 3: reboot
  • Step 4: ls /dev/ttyO*
  • result: /dev/ttyO0 /dev/ttyO1 /dev/ttyO2



回答2:


You can change /boot/uEnv.txt First of all enable UARTS:

cape_disable=bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
cape_enable=bone_capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5

Then don't forget to configure pinmux with appropriate dtbo's:

###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



回答3:


You need to check if the UART pins you are using are being used for other purposes. For this you need to look at the pin diagram first. If there is a conflict, you have to give up things like EMMc or hdmi and you need to make these pins possible. First disable the conflicting configurations in uEnv.txt. Then you can activate the pins as follows.

    #! /bin/sh cd /sys/devices/platform/bone_capemgr File=slots if grep -q "Override Board Name,00A0,Override Manuf,univ-emmc" "$File";  then    
    cd
    echo "\n Pin configuration available"
    echo "\n UART 4 configuration p9.11 and p9.13"
    sudo config-pin P9.11 uart
    sudo config-pin -q P9.11
    sudo config-pin P9.13 uart
    sudo config-pin -q P9.13
    echo "\n UART 1 configuration p9.26 and p9.24"
    sudo config-pin P9.24 uart
    sudo config-pin -q P9.24
    sudo config-pin P9.26 uart
    sudo config-pin -q P9.26
    echo "\n UART 5 configuration p8.38 and p8.37"
    sudo config-pin P8.38 uart
    sudo config-pin -q P8.38
    sudo config-pin P8.37 uart
    sudo config-pin -q P8.37
    echo "\n UART configuration end"  else    
    echo "Oops!!configuration is not available"
    echo "Please check uEnv.txt file and only disable HDMI" fi


来源:https://stackoverflow.com/questions/35881761/enabling-uart-on-beaglebone-black

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!