cancel
Showing results for 
Search instead for 
Did you mean: 

Is LSM6DSR a drop-in replacement for LSM6DSL ?

yanakk
Visitor

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!

5 REPLIES 5
Andrew Neil
Super User

@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

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

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!


@yanakk wrote:

the LSM6DSL driver from Zephyr


Is that provided by ST?

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

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
yanakk
Visitor

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.

I don't know. 

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

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.