AI Camera (IMX500) RP2040 GPIO bridge becomes unresponsive after ~20-25 power cycles, requires host reboot

Offen
#7,613 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
38/100
Issue-Typ
Bug
Klarheit
Muss geklärt werden
Aktivitätsstatus
Aktiv
Tech-Stack
c, linux, python, raspberry-pi

Rechercherichtung

Run the provided Picamera2 open/start/capture/stop/close loop and capture the kernel log when rp2040_gbdg_wait_until_free fails. Read the rp2040-gpio-bridge paths around rp2040_gbdg_wait_until_free(), rp2040_gbdg_gpio_dir_out(), and rp2040_gbdg_probe(), including commits 8917d44422 and 5c1a0c01ce. Done means establishing a supported recovery procedure or a reproducible driver fix that survives repeated camera cycles without a host reboot.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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 (I used about 12s between iterations). On a fresh reboot,
cycles 1 through 24 completed cleanly every time, spanning several minutes
with multiple resolutions and timings tested. Cycle 25 failed and every
attempt since 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 I'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 my 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.

Vorherrschende Sprache
C
Sterne
13.3k
Forks
5.5k
Ø Merge
4 T. 10 Std.
Gemergte PRs (30 T.)
31

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus raspberrypi/linux

Alle Issues in raspberrypi/linux

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.