attached is the code ..I am using STMcubeID to run the I2C..I am trying to access sensor data using STM32 along with sensiron chip...but I I2C is not working...Let me know if you have any idea
uint16_t DevAddress = 0x61 << 1;
uint16_t MemAddress = 0x0036;
uint8_t env_var[6] = "";
char print_msg[100] = "";
uint16_t ret ;
if (HAL_OK == HAL_I2C_IsDeviceReady(&hi2c1, DevAddress, 200, 2000)) {
before review of SW code, would you confirm that I2C bus is well pulled up by resistors? and more detail information may be helpful instead of "not working". for example NO ACK from sensor or something else.
yes I2C is well pulled up using 4.7 K resistors and on probing also the line is showing 3.3v...when oscilloscope is connected no activity is seen on the bus...
Tried the above code with ST25R3911B disco board which has STM32L476RET..
here we are not seeing any ret value..but the sensor is responding with some LED indication..
some configuration issue is stopping the ret values to indicate whether the I2C is working or not..
kindly suggest any changes in the code if any..then same configurations can be applied for STM32F103C6...kindly help us out if you have any suggestion.