cancel
Showing results for 
Search instead for 
Did you mean: 

Only 0 received when reading from M24128-BRMN6TP. Valid data received when reading directly after writing.

ATrug.1
Associate II

Hello,

I am trying to write and read data to/from an M24128-BRMN6TP.

Communication Interface is I2C, I am using a STM32G474 as Master and the HAL lib for communication.

I have written a wrapper driver for the memory and I2C which i cannot post here, but in the end i am calling HAL_I2C_Mem_Write_IT and HAL_I2C_Mem_Read_IT.

I appended two screenshots of the I2C SCL and SDA lines.

The first Screenshot shows an read cycle directly called after writing into the EEPROM.

The second one shows a read cycle called 1 second after the first screenshot (or directly independently of the first one).

When reading directly after a write cycle i get valid data, when reading independantly I only get back zeros.

Write control is driven low at all time and not touched.

0693W00000DmG7BQAV.png0693W00000DmG9XQAV.png 

The read routine looks identical to me and the EEPROM is responding. The ISRs are called correctly when the transfer is finished. Am i missing something?

Thank you very much.

Edit: Typos

1 REPLY 1
ATrug.1
Associate II

Found the problem. I accidently overwrote the EEPROM Space after the direct Read after writing.