adafruit / adafruit/adafruit-beaglebone-io-python

UART no response after upgrade to Buster (similar issue to #291)

Open
#363 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
479
Forks
214
PR merge metrics
No merged PRs in 30d

Description

This concerns a system that's been in production since 2016. My client recently asked for some new features. To do that, I needed to upgrade from Debian Jessie to Buster and from Python 2 to 3.

## The problem
The system uses `/dev/ttyO0` and `/dev/ttyO1` for ModBus serial control at 19200 baud. Since the upgrade, these ports can be opened and written to but they return no response.

## Jessie serial configuration
Under Jessie, the ports were initialized in `/etc/rc.local` with:

```bash
echo BB-UART1 > /sys/devices/bone_capemgr.9/slots
echo BB-UART2 > /sys/devices/bone_capemgr.9/slots
```

and /dev/ttyO0 was released from use as a login console by commenting out the following lines in `/etc/init/serial.conf`
```
#respawn
#exec /sbin/getty 115200 ttyO0
```

## Buster serial configuration
Under Buster, the overlay system is changed and `/etc/rc.local` and `/etc/init/serial.conf` are obsoleted in favor of `systemd`, so I'm enabling UART's with:
```bash
sudo config-pin P9.24 uart # UART1_TXD
sudo config-pin P9.26 uart # UART1_RXD
sudo config-pin P9.21 uart # UART2_TXD
sudo config-pin P9.22 uart # UART2_RXD
```
and disabling the login console mapping with:
```
sudo systemctl mask serial-getty@ttyO0.service
```

## Buster system report from /opt/scripts/tools/version.sh
```
signtex@beaglebone:~$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[]
eeprom:[A335BNLT00C03416BBBK2413]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2022-12-01]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)]:[location: dd MBR]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-g923f8b8]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0.kernel]
UBOOT: Loaded Overlay:[BB-ADC-00A0.kernel]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0.kernel]
UBOOT: Loaded Overlay:[BB-HDMI-TDA998x-00A0.kernel]
kernel:[4.19.94-ti-r73]
nodejs:[v10.24.0]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821]
pkg:[bb-customizations]:[1.20221108.0-0~buster+20221108]
pkg:[bb-usb-gadgets]:[1.20220816.0-0~buster+20220816]
pkg:[bb-wl18xx-firmware]:[1.20221130.4-0~buster+20221130]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.5-git20200715.0-0~buster+20200716]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input bluetooth netdev i2c gpio admin tisdk weston-launch cloud9ide]
cmdline:[console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[ 54.142160] remoteproc remoteproc0: wkup_m3 is available
[ 54.210850] remoteproc remoteproc0: powering up wkup_m3
[ 54.210884] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[ 54.211173] remoteproc remoteproc0: remote processor wkup_m3 is now up
[ 57.564726] remoteproc remoteproc1: 4a334000.pru is available
[ 57.567096] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[ 57.564726] remoteproc remoteproc1: 4a334000.pru is available
[ 57.564922] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[ 57.567096] remoteproc remoteproc2: 4a338000.pru is available
[ 57.567240] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[ 1.066060] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 1.079463] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository file or test is named. Start by reviewing the Buster `config-pin` commands, `serial-getty@ttyO0.service` masking, `/dev/ttyO0` and `/dev/ttyO1`, and the diagnostics from `version.sh`; compare them with the Jessie configuration. Done means identifying a reproducible cause and confirming that both ModBus UART ports receive responses after the upgrade.

Written by the indexing model from the issue text.

Assessment

Tech stack
debian, linux, python
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.