Skip to main content
Visitor II
July 18, 2019
Solved

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

  • July 18, 2019
  • 8 replies
  • 3467 views

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.

    This topic has been closed for replies.
    Best answer by Brian TIDAL

    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.

    8 replies

    Technical Moderator
    July 19, 2019

    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

    LEeckAuthor
    Visitor II
    July 19, 2019

    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 ?

    Technical Moderator
    July 19, 2019

    ​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

    LEeckAuthor
    Visitor II
    July 22, 2019

    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.

    Technical Moderator
    July 22, 2019

    Hi,

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

    Thanks

    Rgds

    BT

    LEeckAuthor
    Visitor II
    July 22, 2019

    Yes, I put in attachment !

    thanks,

    Louis.

    LEeckAuthor
    Visitor II
    July 22, 2019

    tell me if you succeed to open it ?!

    Technical Moderator
    July 31, 2019

    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.

    LEeckAuthor
    Visitor II
    July 31, 2019

    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 !