YMMV

* your mileage may vary

Tuesday, 29 December 2015

Beaglebone Black (BBB) UART2 loopback test

Check UART port on BBB using loop-back test.  Normally UART2 is used by HDMI so it is necessary to disable the HDMI on boot.
BBB Environment
root@beaglebone:~# uname -r && cat /etc/dogtag
4.1.13-ti-r33BeagleBoard.org Debian Image 2015-11-12 

changed /boot/uEnv.txt to disable HDMI:
##BeagleBone Black: HDMI (Audio/Video) disabled:
dtb=am335x-boneblack-emmc-overlay.dtb

Reboot

Setup the UART2
export SLOTS=/sys/devices/platform/bone_capemgr/slots
echo 'BB-UART2' > $SLOTS

Check the setup
cat $SLOTS 
0: PF----  -1
1: PF----  -1
2: PF----  -1
3: PF----  -1
4: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-UART2

root@beaglebone:~# ls /dev/ttyO*
/dev/ttyO0  /dev/ttyO2


Setup the serial port
root@beaglebone:~# stty -F /dev/ttyO2 115200 raw -echo

Wire the BBB
Jumper pins P9.21<=>P9.22

Run the loop-back test

Putty Session 1
cat /dev/ttyO2

Putty Session 2
echo "hello world" >/dev/ttyO2

3 comments:

  1. I got this working on debian 9.2 by edditing /boot/uEnv.txt (there is no slots file on there).
    change the line: #cape_enable=bone_capemgr.enable_partno= to cape_enable=bone_capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5. This should enable all UART ports.

    ReplyDelete
  2. ## for completeness: this is my whole /boot/uEnv.txt;

    uname_r=4.4.94-bone19
    enable_uboot_overlays=1
    ###
    ###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

    disable_uboot_overlay_emmc=1
    disable_uboot_overlay_video=1
    disable_uboot_overlay_audio=1

    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

    ReplyDelete