2025-09-05 3:06 AM - edited 2025-09-05 3:10 AM
Hi all,
I am trying to read/write the EEPROM -24FC64 connected with stm32g474ceux microcontroller. The slave device address is 0x57 (1010 (control code) + 111 (chip select bus) = 0x57). I2c bus speed is 100KHz as set during stm32CubeMX configuration.
My C code is as follows:
uint8_t Data_write = 0xAA;
HAL_I2C_Mem_Write(&hi2c1, (0x57 <<1), 0x00, 2, &Data_write, 1, 100);
HAL_Delay(10);
HAL_I2C_Mem_Read(&hi2c1, (0x57 <<1), 0x00, 2, &Data_read, 1, 100);
So during the debugging, i do not see the sent data (0xaa) at variable Data_read pointer.
Can anyone suggest/guide me please what could be wrong here.?
Many thanks in advance.
2025-09-05 4:50 AM
Is there any chance WP or one of the An pins is floating? Data sheet (DS21189R) Sec 2.1 suggests there aren't any pull-ups or pull-downs on these pins.
Does HAL_I2C_Mem_Write() return an error?