2025-05-22 2:37 AM - last edited on 2025-05-22 6:24 AM by Andrew Neil
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.
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
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
I’m trying to understand:
Is the LSM6DSR fully compatible with the lsm6dsl Zephyr driver in SPI mode?
Does the driver automatically try to read WHO_AM_I or other registers during init?
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!
2025-05-22 2:50 AM
@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
2025-05-22 3:12 AM
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!
2025-05-22 3:59 AM
@yanakk wrote:the LSM6DSL driver from Zephyr
Is that provided by ST?
If not, you'd have to ask whoever did write it.
2025-05-22 6:20 AM
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.
2025-05-22 6:25 AM
I don't know.
I've edited the title to reflect the actual question.