Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Adafruit_BBIO BeagleBone Blue UART5 set pin mode failed
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit_BBIO BeagleBone Blue UART5 set pin mode failed

by jeff_watts2019 on Thu Dec 27, 2018 7:18 pm

Howdy folks, I'm attempting to access UART5 on the BeagleBone Blue using the Adafruit_BBIO library. I've gone in and uncommented disable_uboot_overlay_video=1 as instructed to here(https://github.com/adafruit/adafruit-be ... -io-python) from there I tried using the config-pin command to set P8.38 and P8.37 as UART but get a message saying P8_38 pinmux file not found. I've navigated into /sys/devices/platform/ocp and there definitely isn't a pinmux file for P8 at all. Having done some reading it seems that in the past the method would be to mess with capemgr in some way shape or form but that is no longer the case? Is there some way to create a pinmux file for P8 or am I on completely the wrong path there?
I will also note that I know UART5 works as tio /dev/ttyO5 -b 9600 connects and displays data just fine.

Short version is I want to use UART5 on the BeagleBone Blue in python, preferably with Adafruit_BBIO and there seems to be either something missing or some setup that I need to add/do.

Running sudo /opt/scripts/tools/version.sh gets me
Code: Select all | TOGGLE FULL SIZE
git:/opt/scripts/:[1aa73453b2c980b75e31e83dab7dd8b6696f10c7]
eeprom:[A335BNLTBLA21717EL001851]
model:[TI_AM335x_BeagleBone_Blue]
dogtag:[BeagleBoard.org Debian Image 2018-10-07]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.09-00002-g0b54a51eee]:[location: dd MBR]
kernel:[4.14.71-ti-r80]
nodejs:[v6.15.0]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.4.20181120.0-0rcnee0~stretch+20181120]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[librobotcontrol]:[1.0.4-git20181123.0-0rcnee0~stretch+20181124]
pkg:[firmware-ti-connectivity]:[20180825+dfsg-1rcnee1~stretch+20181217]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[    1.085217] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper


I went ahead and ran strace on the code below as that seemed to be a common thing in some of the other posts on the forum. The result of that is here https://gist.github.com/jeffwatts2018/9fbd211e7deb22014acf6b37436ebdf3
Code: Select all | TOGGLE FULL SIZE
#!/usr/bin/env python
#GPS test

import Adafruit_BBIO.UART as UART5
import serial

UART5.setup("UART5")

with serial.Serial(port = "/dev/ttyO5", baudrate=9600, interCharTimeout = .05, timeout = 1) as ser:
    print("beginning")
    count = 0
    while(count < 20):
        response = ser.read_until("$GPGGA")
        print(response)
        response = ser.read(65)
        print(response)
        count = count + 1


Thanks for any assistance,
Jeff Watts

jeff_watts2019
 
Posts: 2
Joined: Thu Dec 27, 2018 6:41 pm

Re: Adafruit_BBIO BeagleBone Blue UART5 set pin mode failed

by drewfustini on Fri Dec 28, 2018 1:22 pm

if you are booting from microSD and not using eMMC, then you could try this in /boot/uEnv.txt as an experiment:
Code: Select all | TOGGLE FULL SIZE
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

from https://elinux.org/Beagleboard:BeagleBo ... rd_devices

drewfustini
 
Posts: 941
Joined: Sat Dec 26, 2015 1:19 pm

Re: Adafruit_BBIO BeagleBone Blue UART5 set pin mode failed

by drewfustini on Fri Dec 28, 2018 1:29 pm

I asked Robert Nelson and he suggested that this is the device tree file that needs to be changed:
https://github.com/StrawsonDesign/libro ... evice_tree

drewfustini
 
Posts: 941
Joined: Sat Dec 26, 2015 1:19 pm

Re: Adafruit_BBIO BeagleBone Blue UART5 set pin mode failed

by drewfustini on Fri Dec 28, 2018 1:31 pm

Robert Nelson just pointed out that UART5 is enabled:
https://github.com/StrawsonDesign/libro ... #L444-L449

I think Adafruit_BBIO just needs realize that UART5 is already pinmuxed ok on the Blue. I'll look into that.

drewfustini
 
Posts: 941
Joined: Sat Dec 26, 2015 1:19 pm

Re: Adafruit_BBIO BeagleBone Blue UART5 set pin mode failed

by drewfustini on Fri Dec 28, 2018 2:46 pm

I forgot to ask,

Does the Python code that you posted above generate an error?

drewfustini
 
Posts: 941
Joined: Sat Dec 26, 2015 1:19 pm

Re: Adafruit_BBIO BeagleBone Blue UART5 set pin mode failed

by jeff_watts2019 on Fri Dec 28, 2018 3:29 pm

First, thanks for the fast reply on this. Second on a whim just now I tried just commenting out the setup line and it worked perfectly. So the problem was that it was trying to setup something that was already setup and didn't detect it, I think.

jeff_watts2019
 
Posts: 2
Joined: Thu Dec 27, 2018 6:41 pm

Re: Adafruit_BBIO BeagleBone Blue UART5 set pin mode failed

by drewfustini on Mon Dec 31, 2018 9:20 am

Thanks for letting me. I'll improve the setup logic to handle this circumstance.

drewfustini
 
Posts: 941
Joined: Sat Dec 26, 2015 1:19 pm

Please be positive and constructive with your questions and comments.