cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 Nucleo with IMU (LSM6DSV16X) HAL_ERROR

JJcompE
Associate

Running into a weird issue with my teams and I's capstone senior project. We are using the Nucleo dev boards and connecting it to IMU in the title via I2C. When running either HAL_I2C_Mem_Read or HAL_I2C_IsDeviceReady the status we get back is HAL_ERROR. 

The board and the IMU are wired correctly, the code in main.c is correct. Our advisor can plug in the board to his computer and run the code and the status will come back HAL_OK, but when I run the same code and plug in the same board I get a HAL_ERROR. Same with my two other teammates, all get HAL_ERROR. We are using default settings for I2C, we have created fresh projects to test and still get the same error. 

The only difference we can find is that our advisor is using CubeIDE version 1.12.1 (an older version) while we are using 1.14.1. 

Anyone else have this error or have any insight as to what could be going wrong?

 

2 REPLIES 2
TDK
Guru

If HAL_I2C_IsDeviceReady returns HAL_ERROR, the slave device did not ACK the response. Some possibilities:

  • Bad code (wrong slave address is most common here, note that address should be left shifted)
  • I2C SDA/SCL signal lines missing external pullups.
  • Slave isn't powered or otherwise connected correctly.
If you feel a post has answered your question, please click "Accept as Solution".

Thanks for the reply TDK. That is exactly what we thought at first and spent many hours rechecking the code and rechecking the wiring but both are definitely not the source of the problem. How we determined that was plugging the exact same device and breadboard wiring config into our advisors laptop and get the IMU to work.

However, when we try the same devices/breadboard setup, with the same code on our laptops we only get HAL_ERROR