Skip to main content
Visitor II
September 3, 2020
Question

LSM6DSM factory reset

  • September 3, 2020
  • 4 replies
  • 1865 views

I have been working with this sensor for a while. It started to give weird errors such as reading all zeros on all axis. Then sometimes it would initialize but read values like 4, 0, 4 and such. Which is impossible in a static position. I have tried writing to the BOOT and SW reset register but still it gives the same behavior. It is not shared on an SPI bus

Any help will be appreciated

    This topic has been closed for replies.

    4 replies

    ST Employee
    September 3, 2020

    Hi @FBoth.1​ , did the LSM6DSM suddenly start to be unstable on both accelerometer and gyro part? No physical (e.g. a shock) or electrical (wrong soldering or Vdd too high) causes? And is the SPI master ok? Btw, to discard MEMS-related malfunctions I suggest you to run the Self test, as described in the AN4987 application note, p.106. You can refer to the Github example page, lsm6dsm_self_test.c. Regards

    FBoth.1Author
    Visitor II
    September 4, 2020

    It started to become unstable gradually. Sometimes it would be fine sometimes not. Eventually it came to the point where it didnt want to work at all. Apparently it is the supply voltage. I am using a sensor tile with a 500mAh battery. Looks like the battery dipped below a point where the sensor tile still turns on and works but the accelerometer does not function. This looks like the issue although I am still testing. Will run self test if the problem pops up again

    FBoth.1Author
    Visitor II
    September 5, 2020

    Quick follow up question. What is the correct read procedure if you do not use interrupts to service the sensor? I thin my problem lies there

    ST Employee
    September 9, 2020

    Hi @FBoth.1​ ,

    you can check the polling data read procedure here --> lsm6dsm_read_data_polling.c

    Or double-check the interrupt driven data read --> lsm6dsm_read_data_int.c

    (source ST Github, C-drivers and examples for LSM6DSM)

    -Eleon

    Visitor II
    September 20, 2021

    I also have some problems reading data through SPI from LSM6DSM.

    I can't debug always the data. I'm working with SPI and FIFO and I think that the problem is that I reset the microcontroller (while debugging) while some SPI communication is still ongoing. As I can't unpower the sensor and it does not have a reset line, I can't debug the firmware under some circunstances.

    Is there any way of resetting the SPI communications with the sensor?