Describe the bug
The RP2040 GPIO bridge chip on the Raspberry Pi AI Camera (IMX500) stops
responding to I2C after roughly 20-25 camera open/close cycles within a
single boot session. Once it happens, every subsequent camera access fails
identically, and only a full host reboot recovers it (a sudo reboot, not
just a driver unbind/rebind of the sensor — untested whether unbind/rebind
of the bridge chip itself recovers it, see below).
Steps to reproduce
Minimal reproducer, no application code involved beyond Picamera2 itself:
from picamera2 import Picamera2
picam2 = Picamera2()
picam2.configure(picam2.create_preview_configuration(main={"size": (960, 720)}))
picam2.start()
picam2.capture_array()
picam2.stop()
picam2.close()
Run this in a loop (we used ~12s between iterations). On a fresh reboot:
- Cycles 1-24 completed cleanly every time (spanning several minutes,
multiple resolutions/timings tested).
- Cycle 25 failed and every attempt since has failed identically, until the
next reboot.
Kernel log at the moment of failure
rp2040-gpio-bridge 10-0040: rp2040_gbdg_i2c_send() rp2040_gbdg_wait_until_free failed
rp2040-gpio-bridge 10-0040: rp2040_gbdg_gpio_dir_out(19, 0) could not ST_CL
rp2040-gpio-bridge 10-0040: rp2040_gbdg_i2c_send() rp2040_gbdg_wait_until_free failed
imx500 10-001a: setup of GPIO led failed: -121
imx500 10-001a: imx500_power_on: failed to get led gpio
rp1-cfe 1f00110000.csi: stream on failed in subdev
Followed shortly after by the well-known secondary symptom:
videobuf2_common: driver bug: stop_streaming operation is leaving buffer 0 in active state
WARNING: ... at drivers/media/common/videobuf2/videobuf2-core.c:2215 __vb2_queue_cancel+...
System
- Raspberry Pi 5, AI Camera (IMX500) on CAM/DISP0
uname -r: 6.12.34+rpt-rpi-2712
libcamera0.7/libcamera-v4l2: 0.7.2+rpt20260817-1
libpisp1: 1.7.0-1
python3-picamera2: 0.3.37-1
- RP2040 bridge firmware:
fw ver. 15 (per rp2040_gbdg_probe() log line -
matches the latest version referenced in the official RP2040 firmware
update instructions, so this isn't an outdated-firmware problem)
What we've checked so far
- Not a resource-contention issue with other I2C/GPIO consumers on the same
board (tested with all other periodic I2C/GPIO-using services on the
system stopped - same result).
- Not fixed by the RP2040 firmware already being current (v15).
- Compared
drivers/spi/spi-rp2040-gpio-bridge.ko between our running
kernel (6.12.34, built 2025-06-26) and an already-installed-but-unbooted
newer kernel (6.18.34, built 2026-06-09): the rp2040_gbdg_wait_until_free failed code path is byte-identical in both builds, and the driver's
commit history (8917d44422, 5c1a0c01ce) shows only the initial driver
and one unrelated MAX_TRANSFER_SIZE increase - nothing addressing this.
cam0_reg (the shared regulator powering both the IMX500 sensor and the
RP2040 bridge, GPIO-backed via RP1) still shows num_users: 1, state: enabled while wedged - the physical rail is not being fully
cycled by normal Picamera2 stop/start alone, since the bridge driver's
own reference keeps it continuously enabled independent of streaming.
Question / request
Is this a known failure mode? Is there a supported way to recover the RP2040
bridge (e.g., unbind+rebind the 10-0040 i2c device, which should drop
cam0_reg's use count to 0 and force a real power-cycle) without a full
host reboot? Happy to test and report back if there's a suggested
procedure.
Describe the bug
The RP2040 GPIO bridge chip on the Raspberry Pi AI Camera (IMX500) stops
responding to I2C after roughly 20-25 camera open/close cycles within a
single boot session. Once it happens, every subsequent camera access fails
identically, and only a full host reboot recovers it (a
sudo reboot, notjust a driver unbind/rebind of the sensor — untested whether unbind/rebind
of the bridge chip itself recovers it, see below).
Steps to reproduce
Minimal reproducer, no application code involved beyond Picamera2 itself:
Run this in a loop (we used ~12s between iterations). On a fresh reboot:
multiple resolutions/timings tested).
next reboot.
Kernel log at the moment of failure
Followed shortly after by the well-known secondary symptom:
System
uname -r: 6.12.34+rpt-rpi-2712libcamera0.7/libcamera-v4l2: 0.7.2+rpt20260817-1libpisp1: 1.7.0-1python3-picamera2: 0.3.37-1fw ver. 15(perrp2040_gbdg_probe()log line -matches the latest version referenced in the official RP2040 firmware
update instructions, so this isn't an outdated-firmware problem)
What we've checked so far
board (tested with all other periodic I2C/GPIO-using services on the
system stopped - same result).
drivers/spi/spi-rp2040-gpio-bridge.kobetween our runningkernel (6.12.34, built 2025-06-26) and an already-installed-but-unbooted
newer kernel (6.18.34, built 2026-06-09): the
rp2040_gbdg_wait_until_free failedcode path is byte-identical in both builds, and the driver'scommit history (
8917d44422,5c1a0c01ce) shows only the initial driverand one unrelated MAX_TRANSFER_SIZE increase - nothing addressing this.
cam0_reg(the shared regulator powering both the IMX500 sensor and theRP2040 bridge, GPIO-backed via RP1) still shows
num_users: 1, state: enabledwhile wedged - the physical rail is not being fullycycled by normal
Picamera2stop/start alone, since the bridge driver'sown reference keeps it continuously enabled independent of streaming.
Question / request
Is this a known failure mode? Is there a supported way to recover the RP2040
bridge (e.g., unbind+rebind the
10-0040i2c device, which should dropcam0_reg's use count to 0 and force a real power-cycle) without a fullhost reboot? Happy to test and report back if there's a suggested
procedure.