La Pi 4 se bloquea con un oops del kernel en cuanto los overlays spi4 y spi5 están activos a la vez
Traducido del English por IA ·
No es mi área habitual, soy de TI y me asignaron la Pi de sensores del equipo de energía.
Pi 4B de 4 GB, Raspberry Pi OS Bookworm de 64 bits, kernel 6.6. Dos placas Adafruit MAX31865 con PT100 en las líneas de suministro y retorno de la caldera. Quien la montó puso cada placa en su propio bus SPI:
dtoverlay=spi4-1cs
dtoverlay=spi5-1cs
Cada overlay por separado funciona. Ambos juntos: la primera lectura del segundo bus muestra
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
...
pc : bcm2835_spi_transfer_one+0x...
Kernel panic - not syncing: Oops: Fatal exception
y el equipo queda bloqueado hasta que se corta y restablece la alimentación. Las lecturas van a Hermetry, así que el dispositivo se desconecta y a las 3 de la madrugada nos llega la alarma de desconexión. ¿Es un problema conocido usar spi4 y spi5 al mismo tiempo? Prefiero no tener que entender el código fuente del kernel.
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.
Traducido del English por IA ·
¿Hay algo más activado en config.txt? ¿enable_uart, otros overlays? Pega el archivo completo.
Is anything else enabled in config.txt? enable_uart, other overlays? Paste the whole file.
Traducido del English por IA ·
enable_uart=1 (la consola serie está activada, alguien la usa para la recuperación headless), dtparam=i2c_arm=on, y las dos líneas SPI.
enable_uart=1 (serial console is on, someone uses it for headless recovery), dtparam=i2c_arm=on, and the two SPI lines.
Traducido del English por IA ·
Me encontré con algo casi igual en una Pi 4 de laboratorio con dos placas de termopar. Nunca llegué al fondo del lado del kernel, así que no puedo decirte si es un error del controlador. Pero spi5 usa GPIO12 a 15, y GPIO14/15 también son los pines UART que usa tu consola, así que con enable_uart=1 dos overlays se disputan los mismos pines. Eso solo ya basta para que no me fíe de esa configuración.Lo que hice, y lo volvería a hacer: no necesitas dos buses para dos MAX31865. Son dispositivos SPI con su propio chip select, así que ambos van en SPI0 con CE0 y CE1:
# /boot/firmware/config.txt
dtparam=spi=on
# elimina las líneas spi4-1cs y spi5-1cs
Cableado: SCLK GPIO11, MOSI GPIO10, MISO GPIO9 compartidos por ambas placas. CS de la placa 1 a CE0 (GPIO8), CS de la placa 2 a CE1 (GPIO7). En CircuitPython / Blinka eso es digitalio.DigitalInOut(board.CE0) y board.CE1 como pines CS. El MAX31865 funciona bien a 1 MHz, y el bus compartido no está ni cerca de saturarse leyendo dos temperaturas cada pocos segundos.Mantén la configuración de PT100 (2/3/4 hilos) de cada placa como estaba, o tus lecturas variarán unos grados y alguien abrirá un ticket sobre la caldera.
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.
Traducido del English por IA ·
Pregunta aparte: ¿se puede recibir una alarma cuando solo deja de llegar una de las dos claves de temperatura? Una placa se averió silenciosamente y el dispositivo siguió en línea.
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.
Traducido del English por IA ·
Pasé las dos placas a SPI0 con CE0/CE1 y quité los dos overlays: tres días sin caídas y las lecturas coinciden con las anteriores en 0,1 °C. Gracias Aoife. @Keisha, la alarma de desconexión no serviría ahí porque la Pi sigue en línea. Una regla de umbral tampoco puede ver una clave que falta, que yo sepa. Estamos evaluando un watchdog de flujo para eso.
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.
- Debes estar registrado para responder a este debate.
Únete a la conversación
Inicia sesión para preguntar y responder, dar me gusta a las publicaciones útiles y marcar la respuesta que resolvió tu problema. Cada aportación suma puntos y niveles.

