Skip to main content
Visitor II
May 22, 2025
Solved

Is LSM6DSR a drop-in replacement for LSM6DSL ?

  • May 22, 2025
  • 3 replies
  • 775 views

Hi everyone,

I'm working on a project involving the LSM6DSR sensor (very similar to the LSM6DSL), connected via SPI to a Verdin i.MX8M Plus SoM (NXP) mounted on a Dahlia Carrier Board. The firmware runs on the Cortex-M7 core (MIMX8ML8DVNLZ) using Zephyr RTOS v4.1.0.

What I've done:

  • Integrated Zephyr’s official lsm6dsl sensor sample

  • Configured the sensor in the device tree (reg = <0>, spi-max-frequency = <10000000>)

  • Enabled CONFIG_LSM6DSL=y, CONFIG_SPI=y, CONFIG_SENSOR=y in prj.conf

  • The driver appears to initialize in the logs, but always ends up saying failed to initialize chip 0x0

The issue:

No SPI activity is observed on the oscilloscope.

  • Before firmware starts: CS is low (0V)

  • After Zephyr boots: CS line goes to 1.8V (expected idle state) and remains high

  • No toggling on CS, no SCLK or MOSI/MISO activity

 

What I need help with:

I’m trying to understand:

  1. Is the LSM6DSR fully compatible with the lsm6dsl Zephyr driver in SPI mode?

  2. Does the driver automatically try to read WHO_AM_I or other registers during init?

  3. Could I be missing specific SPI config requirements (CPOL/CPHA, delay, pin state)?

Any suggestions, working SPI examples, or validation would be greatly appreciated. Thanks for your time!

    This topic has been closed for replies.
    Best answer by Andrew Neil

    @yanakk wrote:

    The issue:

    No SPI activity is observed on the oscilloscope.


    If there's no activity at all, then that's nothing to do with the sensor.

    It's the Master (so your "Verdin i.MX8M Plus SoM") which initiates the SPI activity.

    So nothing to do with ST - You'll have to go to Toradex for help with that:

    https://www.toradex.com/support

     

    3 replies

    Super User
    May 22, 2025

    @yanakk wrote:

    The issue:

    No SPI activity is observed on the oscilloscope.


    If there's no activity at all, then that's nothing to do with the sensor.

    It's the Master (so your "Verdin i.MX8M Plus SoM") which initiates the SPI activity.

    So nothing to do with ST - You'll have to go to Toradex for help with that:

    https://www.toradex.com/support

     

    yanakkAuthor
    Visitor II
    May 22, 2025

    Thanks for your reply, and you're right, in SPI, it's always the master that initiates communication, and since there's no CS/SCLK activity, the MCU is not sending anything yet.

    That said, the reason I posted here is because I'm using the LSM6DSL driver from Zephyr, and I'm trying to validate whether it should work with the LSM6DSR in SPI mode, and whether it is expected to initiate traffic (like WHO_AM_I reads) by itself during initialization.

    So while I agree it's not an ST issue per se, I thought this community might still be the best place to ask about:

    • Compatibility between LSM6DSL and LSM6DSR

    • Any known SPI-level differences

    • Whether someone has had success running this Zephyr driver with a DSR variant

    Thanks again!

    Super User
    May 22, 2025

    @yanakk wrote:

    the LSM6DSL driver from Zephyr


    Is that provided by ST?

    If not, you'd have to ask whoever did write it.

    yanakkAuthor
    Visitor II
    May 22, 2025

    Understood, thanks.

    Just to clarify: I’m mainly trying to confirm whether the LSM6DSR is fully SPI-compatible with the LSM6DSL at the register level (same SPI behavior, same timing...).

    If that’s confirmed, I’ll know I can treat the DSR as a drop-in SPI replacement for the DSL.

    Appreciate any confirmation on that.

    Super User
    May 22, 2025

    I don't know. 

    I've edited the title to reflect the actual question.