cancel
Showing results for 
Search instead for 
Did you mean: 

NFC Byte address issue

parakh sarda
Associate
Posted on June 12, 2018 at 09:37

Hello

I am working with  M24Sr02 NFC module and interfacing it to STM32R0F8 controller in my project. The code has been generated using CubeMX. The data send and receive functions used show SUCCESS but the data i receive back is not exactly equal to the one sent. Functions used are 'M24SR_SendI2Ccommand' and ' M24SR_ReceiveI2Cresponse'. 

Can anyone tell me where do we write the byte address where the sent data has to be written? 

The SendI2C command calls another function ' HAL_I2C_Master_Transmit(&hi2c1,I2C_WRITE, (uint8_t*)pBuffer,NbByte,1) ' . Where is the byte address specified over here ???

1 REPLY 1
Rene Lenerve
ST Employee
Posted on June 22, 2018 at 10:50

Hi

sardaparakh

,

The M24SR (in contrary of other nfc memories) has specific commands for the I2C communication, these commands are similar to the RF commands using the NFC Forum Type 4 or ISO14443A format like I-block or APDU. I would recommend you to read the M24SR

https://www.st.com/resource/en/datasheet/m24sr02-y.pdf

if you do not have already did it.

Also note, that before reading or writing to the memory you will need to open a session (select application and select NDEF file ... as same as for a reader). This memory cannot be accessed like a standard EEPROM.

So to answer your question, you have to inform the destination address in the C-APDU command 'update binary' (detailed in the DataSheet) that you need to build and insert in thepBuffer parameter of HAL_I2C_Master_Transmit.

To help you, you can consult some example codes available on st.com in the

https://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-nfc1.html

package. This software is supplied with the Nucleo extension board which includes our M24SR chip.

Best Regards.