Skip to main content
Visitor II
November 10, 2023
Question

LSM6DSM interface with STM32L476 in Sensortile board

  • November 10, 2023
  • 2 replies
  • 1570 views

Hello Team,

Recently I bought Sensortile board from ST.  I tried to interface the LSM6DSM gyroscope and accelerometer sensor with STM32L476 microcontroller through SPI half duplex master, but I'm not able to read the device ID or 'Who Am I' register address in LSM6DSM.  I hope SPI is working fine it seems, but not able to receive the device ID.  It is returning constantly 0xFF instead 0x6A.  Here I attached the source code of my project, please go through and let me know the solution to interface this module.  Because of this problem I've stuck and I don't know how to proceed further, so please let me know the solution as soon as possible.

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    November 10, 2023

    Hi @Saranbabu ,

    Welcome to ST Community!

    SPI can be tricky, but first of all, make sure that it is working by uploading one of the projects available on the board page. Then can you tell me how did you develop your project? if you used CubeMX, what configuration did you use?

    Have you got a signal analyzer, so that we can see the signals of the SPI?

    SaranbabuAuthor
    Visitor II
    November 14, 2023

    Hi @Federica Bossi 

    Thanks for your reply and support.

     

    It was working fine, we were able to see the output in mobile phone through bluetooth.  We are trying to get data from LSM6DSM sensor, for that we made firmware, I hope you've gone through the source code which I've attached.  Please find the attached image of cubemx configuration images for SPI communication.  I've tried both the ways of SPI 4wire and SPI 3wire mode as well.  Please let me know the solution to communicate with LSM6DSM.

    SaranbabuAuthor
    Visitor II
    November 19, 2023

    Hello team,

    Is there any progress on my query?.  Because this issue I can't go further, please give me the solution to overcome this issue.