2024-04-16 12:26 PM - last edited on 2025-06-05 12:43 PM by Andrew Neil
Hello,
I am trying to interface a Nordic MCU to a LSM6DSV16X, but I cannot get the communication to work.
I am using 2 dev kits for this test setup, a nRF5340-DK and a STEVAL$MKI227KAA I got from the STEVAL-MKI227KA. VDD/VDD_IO are both 3V, CS/SPC/SDI/SDO are all used and connected correctly. SPC frequency is 1MHz and the SPI interface is set to Mode 0.
Even the WHO_AM_I register is read wrong from the start. The code has a 10ms delay at startup, then it tries to read the WHO_AM_I register to verify the chip ID, but instead of reading 0x70 as expected I get 0x60, as shown on the oscilloscope screenshot below (CS is yellow, SPC is red, SDI is blue, and SDO is green) . This screenshot was taken by triggering on the first falling edge of the CS pin after switching the board from OFF to ON, so no previous interaction on the SPI bus has occurred. The screenshot shows that the MCU sends 0x8F to the IMU, requesting a read of register 0x0F (WHO_AM_I), to which the IMU responds with 0x60.
I did test the STEVAL$MKI227KAA board with a STEVAL-MKI109V3 and Unico-GUI, and everything seemed to be working fine there (no errors shown on Unico-GUI, WHO_AM_I read as 0x70, accel and gyro reading ok).
What could be happening here?
Thank you,
Rafael
2024-05-02 1:03 AM
Hi @rafael_daciuk ,
Welcome to ST Community!
I think there are some non compatibility with the SPI master. You can try to increase the power-on time before the first SPI reading, then try to SPI-read a second time and share here a screenshot.
You could also try to change in SPI mode 3 and check the WhoAmI and compare the communication with MKI109V3 and with the nordic.
2024-11-05 6:45 PM
@rafael_daciukDid you ever figure this out? I have the exact same issue (LSM6DSV16X reporting WHO_AM_I of 0x60) on an RP2040 microcontroller.
2024-11-06 11:37 AM
I had already tried Federica's suggestions, and the issue remained so I gave up.
Moving on to our custom board with the same IMU and MCU the issue was not present. I have no idea why it would not work with the eval board and the MCU dev kit hooked up together.
2025-03-29 1:06 PM
@rafael_daciukSame experience here. After putting it on a custom PCB, the issues went away. I'm at a total loss for what was happening before, lol.
2025-06-05 11:53 AM - edited 2025-06-05 11:55 AM
hello, I have the nrf52840dk and this is how i am receiving my signal. I also tried both modes 0 and 3. I tried a continuous clock or something like the picture I uploaded and still get the same result. I am doing the simplest read of register who am i. I'm assuming if I do not get this register to work, then I cannot continue with the rest of the setup. I know you guys got it to work on a custom board, but is there anything you guys tried to make it work on the dev board. I am using the sparkfun lsm6dsv16x board and made sure it is setup for spi.
2025-06-05 12:36 PM - edited 2025-06-05 12:40 PM
@NullPointerException wrote:@rafael_daciukSame experience here. After putting it on a custom PCB, the issues went away.
Is there something else on the used pins on the DK ?
Does the DK have a different SPI you could try ?
Have you tried asking Nordic https://devzone.nordicsemi.com/ ?
2025-06-05 1:18 PM
I will also ask in the devzone as well. But yes i tried different spi pins on the miso line and still have the same issue. The pins I'm using are open pins, not assigned to anything
2025-06-05 1:24 PM - edited 2025-06-05 1:29 PM
@ACand.3 wrote:yes i tried different spi pins on the miso line
what about the other lines ?
what about a completely different SPI ?
PS:
It seems that Adafruit has a cheap nRF52840 board:
Sparkfun a bit more expensive:
https://www.sparkfun.com/sparkfun-pro-nrf52840-mini-bluetooth-development-board.html