I'm having an issue with bringing up an ST IMU (LSM6DSM on an MKI189V1 eval board). I am using SPI to connect my host micro to the IMU and trying to read back the device ID.
The issue I'm facing is that the response from the IMU is sometimes correct and sometimes incorrect. I'm speaking to ST directly and exploring the firmware side of things, but I am seeing very similar behaviour on two separate micro controllers from two different vendors, so I'm trying to see if anyone has some suggestion as to a potential hardware issue. Here are some more detailed symptoms:
- Microcontroller, IMU, Logic Analyzer, Oscilloscope are all on the bus.
- IMU is powered from host micro VDD
- Removing scope or logic analyzer from the bus does not fix issue
- However if I am consistently reading the incorrect value, and remove the logic analyzer then while removing it the correct value will be read fairly consistently
- If I disconnect the MISO from the host micro (logic analyzer, oscilloscope still connected) the output is consistent and correct
- When the incorrect value is read it often looks close to the correct value in that I see pulses where the MISO should be toggling, but they are very short
- I've tried both supported SPI modes (and both unsupported), and tried clocking as low as 10kHz to no avail
- If I use I2C everything works fine.
All this is leading me to believe there is some sort of hardware drive strength or contention issue.
Item 4 seems to indicate the micro is holding the line somehow, however I'd be surprised if the same issue existed on two entirely different platforms.
Item 3 is very consistently able to get the correct value, however it does not stay consistent once the analyzer is removed.
Any suggestions would be appreciated.