Skip to main content
Visitor II
June 2, 2025
Question

LSM6DSO SPI Bug for high volume project

  • June 2, 2025
  • 1 reply
  • 316 views

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.

    This topic has been closed for replies.

    1 reply

    Super User
    June 2, 2025

    > 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:

    • Lower clock speed and/or slower edges.
    • Better shielding from EMI.
    • Terminating resistor on SPI line with or without controlled impedance.
    • LVDS or similar differential transceivers at each end.
    • Decoupling capacitors.
    • Reduced signal/wire length.
    • Better grounding (avoid loops).

     

    A UAV will have higher EMI than a normal application. Consider decoupling capacitors a must rather than a recommendation.

    ZarvanMAuthor
    Visitor II
    June 3, 2025

    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)