My code is working as it wishes
Hi everybody , I am not sure about am I writing to the true title but anyways I am asking. I am trying to read data from LSM9DS1 sparkfun IMU sensor using HAL i2c with STM32F4 discovery board. I was succesful and I was getting datas, then something happened and my board start not working.
I am not changing the code but it sometimes work sometimes don't. I try to just read device's adress with the code below to be sure problem is not about code. There is same problem for that code to (code is sometimes working sometimes don't).
I am trying to erase device memory with utilty occasionaly. 65% of time it erase device memory but other times it gives "device couldn't find " error.
What could this problem be caused bye? I changed jumpers and STM's cabel but problem is still same.
Adress finding code :
for(Adress=0; Adress<256; Adress++)
{
if(HAL_I2C_IsDeviceReady(&hi2c1, Adress, 1, 10)==HAL_OK)
{
break;
}
}
