cancel
Showing results for 
Search instead for 
Did you mean: 

how to communicate with M24LR04 via I2c

EBen-
Associate II

Im sending the "Get System Info" command to check receiving data correctly from the M24LR04 via I2C.

The packet that I sending is {0x00 (request flags), 0x2B(get system info command), 0xF6 (CRC LSB), 0x75 (CRC MSB) }

the response that I get is 0xFF for all.

I'm using the STM32F031 MCU and keil IDE

also using the functions HAL_I2C_Master_Transmit / HAL_I2C_Master_Receive from the stm32f0xx_hal_i2c.c library.

I have on the same board another chip connecting to SDA/SCL lines and I manage to communicate with successfully.

code example:

uint8_t buffTx[4] = {0x00,0x2B, 0xF6 , 0x75 };

HAL_I2C_Master_Transmit(&hi2c1, M24LR_Add, buffTx, 4, 10);

HAL_I2C_Master_Receive(&hi2c1, M24LR_Add, dataBufferAdd, 8, 10);

Any help would be appreciated.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Rene Lenerve
ST Employee

Hi @EBen-​ ,

Are you sure this is a M24LR04 and not an M24SR, because for the M24LR, the get system info command is used only for RF side not with I²C. To access these information you just have to read registers in the system area (E2=1) at address 2332. You can check registers in the datasheet p30 https://www.st.com/content/st_com/en/products/nfc/st25-nfc-rfid-tags-readers/st25-dynamic-nfc-tags/m24lr-series-dynamic-nfc-tags/m24lr04e-r.html.

Hope this can help you.

Best Regards.

View solution in original post

2 REPLIES 2
Rene Lenerve
ST Employee

Hi @EBen-​ ,

Are you sure this is a M24LR04 and not an M24SR, because for the M24LR, the get system info command is used only for RF side not with I²C. To access these information you just have to read registers in the system area (E2=1) at address 2332. You can check registers in the datasheet p30 https://www.st.com/content/st_com/en/products/nfc/st25-nfc-rfid-tags-readers/st25-dynamic-nfc-tags/m24lr-series-dynamic-nfc-tags/m24lr04e-r.html.

Hope this can help you.

Best Regards.

EBen-
Associate II

Thank you @Rene Lenerve​ for pointing me the right direction and also for your quick reply!. Its working now.

Your help is much appreciated!

Regards :)