cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L476RG + ST25R95 : write in the NFC tag several times and put the data in the rxbuffer following without overwriting previous data.

LEeck
Associate II

I'm using the X-NUCLEO NFC03A1 board with the NUCLEO L476RG board. I'm testing the STM32L4xx-ST25R95-Polling software example to exchange datas between my PC and a NFC tag ( an ISO 15693 ICODE SLIX). my tag is a icode slix iso15693 so I use the demoPollNfcV part of the program. When i'm reading and writing on my tag, previous data are overwriting in the rxBuffer by new data. I would like to use wrData as an array of character and write characters after characters and write in the rxBuffer following without delete previous data.

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Issue discussed in private. Customer has fixed a buffer index issue in his code and succeeded to update 1 single bye in a given block.

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

9 REPLIES 9
Brian TIDAL
ST Employee

Hi,

see also https://community.st.com/s/question/0D50X0000AnrO9qSQE/how-to-write-only-one-byte-in-memory-of-st25dv04k-using-the-cr95hf-development-software for similar question

the physical memory of an ISO/IEC 15693 tag is organized in blocks (or pages) of fixed size (see ISO/IEC 15693-3 §5 VICC memory organization). Therefore, the various read or write commands follow this memory organization (e.g. Write Single Block command)

If you want to modify only one byte:

  1. read the block containing the byte (e.g. Read Single Block command)
  2. modify the value of the byte in your local buffer
  3. write the modified block into the tag memory (e.g. Write Single Block command)

Note: most of the ISO/IEC 15693 tags have 4 bytes block organization. Anyway, there are some existing tags with other block size (e.g. 16 bytes). You have to do a first Read Single Block using a 32 bytes Rx buffer to discover the block size of the tag (usually by reading block #0).

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.

Ok thanks for your answer, I will try to do this. I have another question, what is the different between addressed mode and select mode ?

Brian TIDAL
ST Employee

​Hi,

All tags in the RF field receive the commands from reader/writer. In order to communicate with a given tag:

  • either the Address_flag is set to 1 in the Flags header of the command and the command contains the UID of the tag. In this case, tags compare the received UID with their own UID. If it matches, command is executed and returns a response to the reader/writer. If it does not match, the tag remains silent.
  • or the tag has been set to Select mode thanks to the Select command. In that case, commands are sent with Select_flag set to 1 and without UID. A tag in selected state  executes the command and returns a response to the reader/writer when receiving a request with the Select_flag set to 1. Other tags in the field not in selected state remain silent

See ISO/IEC 15693 §7.2 Modes.

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.
LEeck
Associate II

Hi,

Thanks for your answer

I have tried to write in one block only, several numbers but when I write in the block, it erases the previous number in the block, so I had to create 3 blocks and write a number in each block. I don't succeed to write in one block the 3 numbers following.

Louis Eeckeloot.

Brian TIDAL
ST Employee

Hi,

can you share your code (in private if you prefer)?

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.
LEeck
Associate II

Yes, I put in attachment !

thanks,

Louis.

LEeck
Associate II

tell me if you succeed to open it ?!

Brian TIDAL
ST Employee

Issue discussed in private. Customer has fixed a buffer index issue in his code and succeeded to update 1 single bye in a given block.

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.
LEeck
Associate II

Yes, my issue is fixed, my problem is solved, I succeeded to update one single byte in a given block like I asked it at the beginning.

Thank you very much for your help !