2025-06-02 11:08 AM
Using the LSM6 over SPI with the RP2040 Microcontroller for a mission-critical project (flight controller for UAVs).
The SPI works well. Well in theory. In practice, 1 in every 20-100 reads returns corrupt SPI data (WHOAMI reads as 0x68/0x58). This issue is somewhat reduced when moving the sensor (worst when still) and when adding decoupling capacitors (reduces corruption dramatically).
The project itself is ultra high volume (10k+ units), and we have already invested a very large amount of time and resources into testing.
2025-06-02 12:54 PM - edited 2025-06-02 12:54 PM
> In practice, 1 in every 20-100 reads returns corrupt SPI data (WHOAMI reads as 0x68/0x58).
> we have already invested a very large amount of time and resources into testing.
These statements are somewhat at odds. A 1-5% failure rate should be pretty easy to check.
No magic bullet here. Some things that can help:
A UAV will have higher EMI than a normal application. Consider decoupling capacitors a must rather than a recommendation.
2025-06-02 10:52 PM
Hi!
Thanks for the reply.
Yes, we have followed best practices, and the failure occurs on with bench testing, not yet on a UAV.
The 1-5% failure rate is influenced by:
1. Whether the IMU is untouched
2. Adding lots of electrolytics at input
3. Changing SPI speed (lower sometimes causes MORE problems)