cancel
Showing results for 
Search instead for 
Did you mean: 

M24Sr02 Read and Write Problem(I2C)

Anish Venkataraman
Associate II
Posted on June 21, 2018 at 20:37

Hello Everyone!

I am currently using the dynmaic nfc tag M24SR02-Y and I am facing problems with it while communicating with I2C. I get all the correct responses but when i try to read the NDEF length something goes wrong. I would appreciate if someone could help me out with this issue, I have been coding it for 2 days now and nothing seems to work.

Here are my commands with Responses:

//Send 'Kill RF and open I2C

  Send AC 52

  //Select NFC-T4

  AC 02 00 A4 04 00 07 D2 76 00 00 85 01 01 00 CRC CRC

  //Read back answer from M24SR

  Write AD, READ 02 90 00 CRC CRC

  // select CC

  AC 03 00 A4 00 0C 02 E1 03 CRC CRC

  //Read back answer from M24SR

  Write AD Read 03 90 00 CRC CRC

  //Read CC file-length

  AC 02 00 B0 00 00 02 CRC CRC

  //Read back answer from M24SR

  Write AD Read 02 00 0F 90 00 CRC CRC

  //Read CC file

  AC 03 00 B0 00 00 0F CRC CRC

  //Read back answer from M24SR

  Write AD Read 03 00 0F 20 00 F6 00 F6 04 06 00 01 01 00 00 00 90 00 CRC CRC

Write commands

 

//Select NDEF file

 

  AC 02 00 A4 00 0C 02 00 01 CRC CRC

 

 

  Write AD Read 02 90 00 CRC CRC

 

 

 

 

 

  //Erase NDEF message length

 

  AC 02 00 A4 00 0C 02 00 01 CRC CRC

 

 

  Write AD Read 03 90 00

 

 

 

 

  //Write NDEF message

Wrote AC 02 00 D6 00 02 0D D1 01 09 54 02 65 6E 4E 69 63 6B 65 21 21 CRC CRC

Read 03 09 00 CRC CRC

//Write NDEF length

AC 03 00 D6 00 00 02 00 0E CRC CRC

  Write AD Read 02 90 00 CRC CRC

//Deselect command

AC C2 CRC CRC

when i remove supply and place my phone on top of the antenna the tag reads 0 bytes/255. What am I doing wrong?

:(

To verify the write was successful I added  read commands as well.

Read Commands

//Select NDEF file

  AC 02 00 A4 00 0C 02 00 01 CRC CRC

  //Read back answer from M24SR

  Write AD Read 02 90 00 CRC CRC

  //Read NDEF message length

  AC 03 00 B0 00 00 02 CRC CRC

  Write AD Read 03 00 0f 90 00 44 45 Similar to the response of CC file length but length shows '0x0f' whereas written is 0E 

and when I try to read the data it is similar to contents of CC file. Please help me.

Thanks in advance.

#i2c-isues #m24sr #nfc-tags #m24sr-i2c
13 REPLIES 13
Posted on June 22, 2018 at 18:27

I downloaded a new application, ST25 NFC tap from playstore and I wrote 11 bytes from the app and the tag shows 11 bytes in other android apps as well..but I am not able to read it. Any idea what might e causing this problem?

Thanks

Posted on June 24, 2018 at 19:01

Thanks for the response! I will try it out and let you know. But my project description has changed recently and I just have to read the data. I am not able to read the NDEF length nor the data. From the commands that I have used. For the NDEF length and data I am getting responses of CC/system file length and Cc/system file data. What can be the issue?

Thanks

Anish Venkataraman
Associate II
Posted on June 25, 2018 at 18:38

Thank you all for helping me with this issue. I have figured out why there was no data. The issue has been resolved and it was due to the length of the data that i was inserting in the readNDEFData command. Also, before selecting the NDEF file we need to send NDEFTagApllciation command for successful reading of NDEF file length. I will be posting my working commands for those might face problem.

Thank you once again especially to

Brochier.Beatrice

‌ and

Lemonnier.Renaud

‌.

Posted on June 25, 2018 at 16:46

I am now able to read the NDEF file length correctly but all data value is oxFF. The file has read access.