Question
HAL_I2C_Mem_Read reads only correct if the parameter is wrong
Posted on September 24, 2014 at 13:18
Hi,
I have a STMCube generated project wirh I2C memory 24LC512 with following problem. The line:Status = HAL_I2C_Mem_Read(&hi2c1, IIC_ADDRESS+1, 0, I2C_MEMADD_SIZE_8BIT, pNVRawData, NVRawDataLen, 1000);is correct feeded with parameter but reads only 0xff as data.
The line:Status = HAL_I2C_Mem_Read(&hi2c1, IIC_ADDRESS+1, 0, I2C_MEMADD_SIZE_8BIT+5, pNVRawData, NVRawDataLen, 1000);is not correct because of ''+5'' (any garbage) but is working correct and reads correct value.
I'm using newest Cube & FW.Why?Whats wrong?