Pi 4 friert mit einem Kernel-Oops ein, sobald die Overlays spi4 und spi5 gleichzeitig aktiv sind
Von English mit KI übersetzt ·
Nicht mein übliches Fachgebiet, ich bin der IT-Mensch, dem der Sensor-Pi des Energieteams übergeben wurde.
Pi 4B 4 GB, Raspberry Pi OS Bookworm 64-bit, Kernel 6.6. Zwei Adafruit-MAX31865-Boards mit PT100 an der Kessel-Vor- und Rücklaufleitung. Wer das aufgebaut hat, hat jedes Board an einen eigenen SPI-Bus gehängt:
dtoverlay=spi4-1cs
dtoverlay=spi5-1cs
Jedes Overlay für sich funktioniert. Zusammen: Beim ersten Lesen des zweiten Busses kommt
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
...
pc : bcm2835_spi_transfer_one+0x...
Kernel panic - not syncing: Oops: Fatal exception
und das Gerät ist bis zum Stromaus- und -einschalten weg. Die Messwerte gehen an Hermetry, deshalb geht das Gerät natürlich offline und um 3 Uhr nachts kommt der Offline-Alarm. Ist spi4 + spi5 gleichzeitig ein bekanntes Problem? Ich möchte eigentlich nicht den Kernel-Quellcode verstehen müssen.
Not my usual area, I’m an IT guy who got handed the energy team’s sensor Pi.
Pi 4B 4 GB, Raspberry Pi OS Bookworm 64-bit, kernel 6.6. Two Adafruit MAX31865 boards with PT100s on the boiler supply and return lines. Whoever built it put each board on its own SPI bus:
dtoverlay=spi4-1cs
dtoverlay=spi5-1cs
Either overlay alone works. Both together: the first read of the second bus gives
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
...
pc : bcm2835_spi_transfer_one+0x...
Kernel panic - not syncing: Oops: Fatal exception
and the box is gone until power cycle. The readings go to Hermetry, so of course the device just goes offline and we get the offline alarm at 3 am. Is spi4 + spi5 at the same time a known problem? I’d rather not have to understand the kernel source.
Von English mit KI übersetzt ·
Ist in der config.txt sonst noch etwas aktiviert? enable_uart, weitere Overlays? Bitte die ganze Datei einfügen.
Is anything else enabled in config.txt? enable_uart, other overlays? Paste the whole file.
Von English mit KI übersetzt ·
enable_uart=1 (serielle Konsole ist aktiv, jemand nutzt sie für die kopflose Wiederherstellung), dtparam=i2c_arm=on und die beiden SPI-Zeilen.
enable_uart=1 (serial console is on, someone uses it for headless recovery), dtparam=i2c_arm=on, and the two SPI lines.
Von English mit KI übersetzt ·
Ich hatte auf einem Labor-Pi 4 mit zwei Thermoelementboards fast dasselbe Problem. Auf der Kernel-Seite bin ich nie bis auf den Grund gekommen, deshalb kann ich nicht sagen, ob es ein Treiberfehler ist. Aber spi5 liegt auf GPIO12 bis 15, und GPIO14/15 sind außerdem die UART-Pins, die deine Konsole nutzt. Mit enable_uart=1 streiten sich also zwei Overlays um dieselben Pins. Das allein reicht mir, um dem Aufbau nicht zu trauen.Was ich gemacht habe, und ich würde es wieder so machen: Für zwei MAX31865 brauchst du keine zwei Busse. Es sind SPI-Geräte mit eigenem Chip Select, also hängen beide am SPI0 mit CE0 und CE1:
# /boot/firmware/config.txt
dtparam=spi=on
# die Zeilen spi4-1cs und spi5-1cs entfernen
Verdrahtung: SCLK GPIO11, MOSI GPIO10, MISO GPIO9 gemeinsam für beide Boards. CS von Board 1 an CE0 (GPIO8), CS von Board 2 an CE1 (GPIO7). In CircuitPython / Blinka lautet das digitalio.DigitalInOut(board.CE0) und board.CE1 als CS-Pins. Der MAX31865 kommt problemlos mit 1 MHz zurecht, und der gemeinsame Bus ist bei zwei Temperaturmessungen alle paar Sekunden nicht annähernd ausgelastet.Die PT100-Konfiguration (2-/3-/4-Leiter) pro Board so lassen, wie sie war. Sonst verschieben sich deine Messwerte um einige Grad, und irgendjemand eröffnet ein Ticket wegen des Kessels.
I ran into nearly the same thing on a lab Pi 4 with two thermocouple boards. I never got to the bottom of the kernel side, so I can’t tell you whether it’s a driver bug. But spi5 sits on GPIO12 to 15, and GPIO14/15 are also the UART pins your console is using, so with enable_uart=1 two overlays are fighting over the same pins. That alone is enough for me not to trust the setup.
What I did, and I’d do it again: you don’t need two buses for two MAX31865s. They are SPI devices with their own chip select, so both sit on SPI0 with CE0 and CE1:
# /boot/firmware/config.txt
dtparam=spi=on
# remove the spi4-1cs and spi5-1cs lines
Wiring: SCLK GPIO11, MOSI GPIO10, MISO GPIO9 shared by both boards. CS of board 1 to CE0 (GPIO8), board 2 to CE1 (GPIO7). In CircuitPython / Blinka that’s digitalio.DigitalInOut(board.CE0) and board.CE1 as the CS pins. The MAX31865 is happy at 1 MHz, the shared bus is nowhere near busy reading two temperatures every few seconds.
Keep the PT100 config (2/3/4 wire) the same as it was per board, otherwise your readings shift by a few degrees and someone will open a ticket about the boiler.
Von English mit KI übersetzt ·
Eine separate Frage: Kann man einen Alarm bekommen, wenn nur einer der beiden Temperatur-Keys nicht mehr ankommt? Bei uns ist eine Platine still ausgefallen, und das Gerät blieb trotzdem online.
Separate question, can you get an alarm when only one of the two temperature keys stops arriving? We had a board die quietly and the device stayed online.
Von English mit KI übersetzt ·
Beide Boards auf SPI0 mit CE0/CE1 umgestellt, beide Overlays entfernt, drei Tage ohne Absturz, und die Messwerte stimmen mit den alten innerhalb von 0,1 °C überein. Danke Aoife. @Keisha, der Offline-Alarm würde dort nicht helfen, da der Pi noch online ist. Eine Schwellwertregel kann einen fehlenden Schlüssel meines Wissens ebenfalls nicht erkennen. Wir prüfen dafür einen Flow-Watchdog.
Moved both boards to SPI0 with CE0/CE1, removed the two overlays, three days without a crash and the readings match the old ones within 0.1 °C. Thanks Aoife. @Keisha the offline alarm wouldn’t help there since the Pi is still online. A threshold rule can’t see a missing key either, as far as I know. We’re looking at a flow watchdog for that.
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.
Mitdiskutieren
Melde dich an, um Fragen zu stellen und zu beantworten, hilfreiche Beiträge mit „Gefällt mir“ zu markieren und die Antwort zu kennzeichnen, die dein Problem gelöst hat. Jeder Beitrag bringt Punkte und Stufen.

