cancel
Showing results for 
Search instead for 
Did you mean: 

EEPROM- 24FC64 -stm32g474ceux based I2C -mem-read is not working.

mdudhat
Associate III

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.

1 REPLY 1
bmckenney
Associate III

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?