Adafruit_Blinka: adafruit-circuitpython-motor fails with "RuntimeError: Cannot determine SOC peripheral base address" on Raspberry Pi 5
Board Name
Raspberry Pi 5
Steps
Following the instructions to install adafruit on a Raspberry Pi 5. I used the automated raspi-blinka.py script (see logs below). I then ran the blinkatest.py file, changing board.D4 to board.D0 as I have the onewire interface enabled. The script runs successfully. I then tried to follow the example on servo control and the following script:
import board
import pwmio
pwm = pwmio.PWMOut(board.D0, frequency=50)
Fails with:
Traceback (most recent call last):
File "/opt/fufarm_sensors/sensors/rpi_arduino_shield/foo.py", line 5, in <module>
pwm = pwmio.PWMOut(board.D5, frequency=50)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/fufarm_sensors/sensors/rpi_arduino_shield/env/lib/python3.11/site-packages/adafruit_blinka/microcontroller/bcm283x/pwmio/PWMOut.py", line 27, in __init__
self._open(pin, duty_cycle, frequency, variable_frequency)
File "/opt/fufarm_sensors/sensors/rpi_arduino_shield/env/lib/python3.11/site-packages/adafruit_blinka/microcontroller/bcm283x/pwmio/PWMOut.py", line 40, in _open
GPIO.setup(pin.id, GPIO.OUT)
RuntimeError: Cannot determine SOC peripheral base address
I saw that there was an issue #776 that was supposed to fix this, but the code from that PR is present and I’m still seeing the above error.
Description
This is on a Raspberry Pi 5
Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm
uname -a: Linux jenspi 6.6.31+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux
Additional information
Logs from raspi-blinka.py:
This script configures your
Raspberry Pi and installs Blinka
RASPBERRY_PI_5 detected.
Updating System Packages
Blinka Hit:1 http://deb.debian.org/debian bookworm InRelease
Blinka Hit:2 http://deb.debian.org/debian-security bookworm-security InRelease
Blinka Hit:3 http://archive.raspberrypi.com/debian bookworm InRelease
Blinka Hit:4 http://deb.debian.org/debian bookworm-updates InRelease
Blinka Hit:5 https://download.docker.com/linux/debian bookworm InRelease
Blinka Get:6 https://pkgs.tailscale.com/stable/raspbian bookworm InRelease
Blinka Fetched 6,578 B in 1s (9,899 B/s)
Reading package lists...
Blinka
Blinka W: https://download.docker.com/linux/debian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Upgrading packages...
Blinka Reading package lists...
Blinka
Blinka Building dependency tree...
Blinka
Blinka Reading state information...
Blinka
Blinka Calculating upgrade...
Blinka
Blinka The following packages have been kept back:
Blinka lxplug-updater wf-panel-pi
Blinka 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Making sure the required version of Python is installed
Enabling I2C
Enabling SPI
Enabling Serial
Enabling SSH
Enabling Camera
Disable raspi-config at Boot
Making sure Python 3 is the default
Making sure PIP and setuptools is installed
Blinka Reading package lists...
Blinka
Blinka Building dependency tree...
Blinka Reading state information...
Blinka
Blinka python3-pip is already the newest version (23.0.1+dfsg-1+rpt1).
python3-setuptools is already the newest version (66.1.1-1).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Installing latest version of Blinka locally
Blinka Reading package lists...
Blinka
Blinka Building dependency tree...
Blinka
Blinka Reading state information...
Blinka
Blinka i2c-tools is already the newest version (4.3-2+b3).
libgpiod-dev is already the newest version (1.6.3-1+b3).
python3-libgpiod is already the newest version (1.6.3-1+b3).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Blinka Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Blinka Requirement already satisfied: RPi.GPIO in /usr/lib/python3/dist-packages (0.7.1a4)
Blinka Collecting RPi.GPIO
Blinka Using cached RPi.GPIO-0.7.1-cp311-cp311-linux_aarch64.whl
Blinka Installing collected packages: RPi.GPIO
Blinka Attempting uninstall: RPi.GPIO
Blinka Found existing installation: RPi.GPIO 0.7.1a4
Blinka Not uninstalling rpi-gpio at /usr/lib/python3/dist-packages, outside environment /opt/fufarm_sensors/sensors/rpi_arduino_shield/env
Blinka Can't uninstall 'RPi.GPIO'. No files were found to uninstall.
Blinka Successfully installed RPi.GPIO-0.7.1
Blinka Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Blinka Collecting adafruit-blinka
Blinka Using cached https://www.piwheels.org/simple/adafruit-blinka/Adafruit_Blinka-8.41.2-py3-none-any.whl (348 kB)
Blinka Requirement already satisfied: Adafruit-PlatformDetect>=3.62.0 in ./env/lib/python3.11/site-packages (from adafruit-blinka) (3.69.0)
Blinka Collecting Adafruit-PureIO>=1.1.7
Blinka Using cached https://www.piwheels.org/simple/adafruit-pureio/Adafruit_PureIO-1.1.11-py3-none-any.whl (10 kB)
Blinka Collecting pyftdi>=0.40.0
Blinka Using cached https://www.piwheels.org/simple/pyftdi/pyftdi-0.55.4-py3-none-any.whl (145 kB)
Blinka Collecting adafruit-circuitpython-typing
Blinka Using cached https://www.piwheels.org/simple/adafruit-circuitpython-typing/adafruit_circuitpython_typing-1.10.3-py3-none-any.whl (11 kB)
Blinka Requirement already satisfied: RPi.GPIO in ./env/lib/python3.11/site-packages (from adafruit-blinka) (0.7.1)
Blinka Collecting rpi-ws281x>=4.0.0
Blinka Using cached rpi_ws281x-5.0.0-cp311-cp311-linux_aarch64.whl
Blinka Collecting sysv-ipc>=1.1.0
Blinka Using cached sysv_ipc-1.1.0-cp311-cp311-linux_aarch64.whl
Blinka Collecting pyusb!=1.2.0,>=1.0.0
Blinka Using cached https://www.piwheels.org/simple/pyusb/pyusb-1.2.1-py3-none-any.whl (58 kB)
Blinka Requirement already satisfied: pyserial>=3.0 in /usr/lib/python3/dist-packages (from pyftdi>=0.40.0->adafruit-blinka) (3.5)
Blinka Collecting adafruit-circuitpython-busdevice
Blinka Using cached https://www.piwheels.org/simple/adafruit-circuitpython-busdevice/adafruit_circuitpython_busdevice-5.2.9-py3-none-any.whl (7.5 kB)
Blinka Collecting adafruit-circuitpython-requests
Blinka Using cached https://www.piwheels.org/simple/adafruit-circuitpython-requests/adafruit_circuitpython_requests-4.0.0-py3-none-any.whl (10 kB)
Blinka Requirement already satisfied: typing-extensions~=4.0 in /usr/lib/python3/dist-packages (from adafruit-circuitpython-typing->adafruit-blinka) (4.4.0)
Blinka Collecting Adafruit-Circuitpython-ConnectionManager
Blinka Using cached https://www.piwheels.org/simple/adafruit-circuitpython-connectionmanager/adafruit_circuitpython_connectionmanager-3.1.0-py3-none-any.whl (7.8 kB)
Blinka Installing collected packages: sysv-ipc, rpi-ws281x, pyusb, Adafruit-PureIO, pyftdi, Adafruit-Circuitpython-ConnectionManager, adafruit-circuitpython-requests, adafruit-circuitpython-busdevice, adafruit-circuitpython-typing, adafruit-blinka
Blinka Successfully installed Adafruit-Circuitpython-ConnectionManager-3.1.0 Adafruit-PureIO-1.1.11 adafruit-blinka-8.41.2 adafruit-circuitpython-busdevice-5.2.9 adafruit-circuitpython-requests-4.0.0 adafruit-circuitpython-typing-1.10.3 pyftdi-0.55.4 pyusb-1.2.1 rpi-ws281x-5.0.0 sysv-ipc-1.1.0
DONE.
Settings take effect on next boot.
REBOOT NOW? [Y/n]
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (1 by maintainers)
Yeah, that might be a good idea, however, it should already be automatic as it is part of the setup script: https://github.com/adafruit/Adafruit_Blinka/blob/main/setup.py#L40
I’ll have to take a look more closely after I wrap up some CircuitPython Code Editor changes.
Thanks @makermelissa if it looks like a genuine bug and there’s anything I can do to help you get to the bottom of it, just let me know