2025-02-10 5:58 AM
Hi,
We design a custom board with STM32L081KZ microcontroller. In this board we add an inclinometer that comunicate with the microcontroller by using SPI. In the firmware project we use this library: GitHub - ohilab/libohiboard: OHIBoard library. We use the SPI with SS managed by software and without interrupts.
The problem is: after a long time that the board acquire data (30 days more or less) from the inclinometer the SPI seems blocked and all the read value is 0x00 or 0xFF. The microcontroller continue to works because it replay by UART commands (modbus by RS485). We can not sniff the SPI message because the device is not accessible (it is covered by resine) and we don't have any idea about what's happen.
The strange behaviour is in the boards chain, all the boards lock at the same time (the difference in time is some minutes).
Has anyone encountered the same problem?
Thanks
Marco
2025-03-07 6:16 AM
Hello,
As you cannot probe SPI lines, you need to instrument your code. You don't have another way to debug the issue.
Does STM32 continue to transmit SPI frames? It could be also an issue with that inclinometer. Check the voltage levels? Could it be an EMI/EMC issue?
If you have more than board check if you have the same phenomena.