cancel
Showing results for 
Search instead for 
Did you mean: 

M24SR Problem 0-Capacity

JSieb.1
Associate II

If I perform like a stupid User (write Tag and before the message is published i remove it from the Tag), I am able to get an error message from the NFC-Tag. It's something like "Tag I/O-Error" or "Tag I/O-Error, Tag is not ndef". So if this happens many times in a row, i am not able to write,read,format or clear the Tag via NFC again. Not with my Phone-App or with "NFC-Tools". I am only able to reset it via I2C on the Microcontroller. If I want to get Information from the Chip, it says "Capacity 0/0Bytes" so it's not accepting any order. My Question now is, why does this happen and is there a way to Reset the tag via NFC? Did anybody else have this problem before?

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi,

just for your information, here are the steps used by readers when writing an NDEF message into a tag:

  1. write NDEF Len field to 0
  2. write NDEF message data
  3. write NDEF Len field with actual message length

If you remove the tag, this is likely to happen in step #2 or before step #3 completion. Therefore, it is likely the NDEF file inside the tag has a Len=0 (byte 0 and 1 at offset 0 are set to 0) after a tag removal during NDEF write

In M24SR64-Y product, the ReadBinary command does not allow to read more NDEF bytes than the actual length indicated in the NDEF File, i.e. if the lenght is 0, then the ReadBinary can only read the length field. This is explained in §3.1.3 and §5.6.7 of the M24SR64-Y datasheet . The Response of the ReadBinary command is successful when the data to be read is within the selected file; in other words, when the sum of P1-P2 and Le fields is equal to or lower than the selected file length.

Apps have to first read the NDEF length (ReadBinary of 2 bytes at offset 0 of the NDEF file). Then if the Length is different from 0, Apps have to read only the message content.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
Brian TIDAL
ST Employee

Hi,

can you try to read the tag with the ST25 NFC Tap App?

Can you elaborate on:

  • "write tag": is it from I2C or RF interface.
  • "before the message is published i remove it from the Tag":
    • "message" = NDEF message?
    • "I remove it from the tag:" from I2C or RF? how do you remove it?
  • "I am only able to reset it via I2C": what do you mean by reset? which command do you perform?

Thanks

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
JSieb.1
Associate II

Hey, thank you for the answer!

-The St25 NFC Tap App says: "Command Failed"

Tag Info: M24SR64-Y

NFC type4A-ISO/IEC 14443A

Manufacturer: STMicroelectonics

UID: 02840036669979

Memory size(Bytes): 8192 bytes

Tech list:

android.nfc.tech.IsoDep

android.nfc.tech.NfcA

android.nfc.tech.Ndef

I can also Read Momory, Write Memory etc. After i did this, I've send an Ndef Message to it and it worked!! Now i can write with my App again… weird..

So what happend to the M24SR that i couldn't write on it from my App/ or another one (from the Playstore) on it? Is there a function to clear it first? Should I clear the Tag everytime, before I write a new NdefMessage on it? Do you Need a Picture of the Memory?

  • I2C works fine all the time! No Problems with that, only with writing on the Tag via my developed Phone App (sometimes)
  • Yes NDef Message.
  • I mean it takes a short time to publish my Messages via NFC from the App and if the Tag is Discovered on the Phone, I remove the phone before my application was able to write the message.
  • If I write a Message on the M24SR via I2C the Tag is reset and i am able to write on it via Phone again. weird?

best regards,

Jon

JSieb.1
Associate II

Ok i tried it on another Tag I got into this state, I don't Need to do anything more than Write a NdefMessage (text) from the St25 App...

I looked in the Memory and there was only my 2 Records I've send to the Tag. But when I tried to Write a Message from another App to the "Buggy" Tag, it said Message size to big. Message was: "Hello". After I used your App to write a Message, I was able to use my old App again.

What am I doing wrong?

btw. I tried to get the Tag into this state again, it's not possible anymore. So if you don't know what I did to the Tag and how I can fix it - maybe I fixed it already myself and I don't even know ^^

JSieb.1
Associate II

Maybe this helps...

Brian TIDAL
ST Employee

Hi,

can you reproduce this issue with other Type 4 tags such as ST25TA?

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
JSieb.1
Associate II

Hi,

if i get you right, you are asking if I have any other Tags. No I don't. I only hve your M24SR Discovery, M24SR Nucleo Expansion and some ant7-t-m24sr. The Bug was possible with all of them.

Greetings,

Jon

Brian TIDAL
ST Employee

Hi,

just for your information, here are the steps used by readers when writing an NDEF message into a tag:

  1. write NDEF Len field to 0
  2. write NDEF message data
  3. write NDEF Len field with actual message length

If you remove the tag, this is likely to happen in step #2 or before step #3 completion. Therefore, it is likely the NDEF file inside the tag has a Len=0 (byte 0 and 1 at offset 0 are set to 0) after a tag removal during NDEF write

In M24SR64-Y product, the ReadBinary command does not allow to read more NDEF bytes than the actual length indicated in the NDEF File, i.e. if the lenght is 0, then the ReadBinary can only read the length field. This is explained in §3.1.3 and §5.6.7 of the M24SR64-Y datasheet . The Response of the ReadBinary command is successful when the data to be read is within the selected file; in other words, when the sum of P1-P2 and Le fields is equal to or lower than the selected file length.

Apps have to first read the NDEF length (ReadBinary of 2 bytes at offset 0 of the NDEF file). Then if the Length is different from 0, Apps have to read only the message content.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.