This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TRF7970A: Read multiple blocks - RFID Reader Demo sloc297

Part Number: TRF7970A
Other Parts Discussed in Thread: MSP-EXP430G2ET

Hello,

I was wondering what is the best way to read multiple blocks of an NFC Tag using the TRF7970A and the ISO15693 standard. I am using the RFID Reader Demo (sloc297) as reference and noticed that various functions are available: NFC_appIso15693ReadTag, NFC_appIso15693ReadExtendedTag and ISO15693_sendReadMultipleBlocks.

//RFID_Reader_Demo sloc297, File: nfc_app.c
//Lines 419-421
		{
			NFC_appIso15693ReadTag(0x02 | ui8AddressedFlag);					// Read an ISO15693 tag
//			NFC_appIso15693ReadExtendedTag(0x0A | ui8AddressedFlag);			// Read an ISO15693 tag which has extended protocol implemented
//			ISO15693_sendReadMultipleBlocks(0x22,0x00,25);						// Example to read 25 blocks starting @ Block 0 from a tag which supports Read Multiple Block command
		}

I would like to know what would be the best procedure in the following situations:

  1. Read an small number of blocks (e.g. 5 Blocks).
    Is there any difference between calling ISO15693_sendReadSingleBlock five times and using the ISO15693_sendReadMultipleBlocks(0x22,0x00,0x05)?
  2. Read a big number of blocks.
    I am using the hid vigo 6B0201 NFC Tag, which has 52 Blocks (1 Block - 4Bytes). I have tried to read the whole tag using the function ISO15693_sendReadMultipleBlocks(0x22,0x00,51) but I actually can only read a total of 47 blocks (e.g. 0 to 46, 1 to 47, 2 to 48). As soon as a higher number of blocks is tried to be read using that function, the function returns STATUS_FAIL.Why does it happen? Is there a maximum amount of data that can be read at a time?
    In that case, I thought I could use the NFC_appIso15693ReadExtendedTag function, which reads the blocks until no response is received. However, the same issue occurs and data does not seem to be read.

Many thanks in advance.

  • Hi JBF,

    what have seen in the code is, that the buffer for RX data is defined as 100 bytes. I wonder why you are able to read 47 blocks with 4 bytes. The command NFC_appIso15693ReadExtendedTag is implemented as a loop of ReadSingleBlock commands which brings no advantage for you. I would use multiple ISO15693_sendReadMultipleBlock commands with lets say 20 blocks to get the complete memory which seems to be the fastest way.

    Best Regards,

    Helfried

  • Hello Helfried,

    thanks for your answer.

    The size of the buffer for RX Data is defined in trf79xxa.h as NFC_FIFO_SIZE, right?

    For my project I am using an nRF5340 controller but I also have an MSP-EXP430G2ET launchpad. And I am testing the ISO15693_sendReadMultipleBlock function for both platforms.

    Here are my results and comments:

    MSP-EXP430G2ET (512 bytes of RAM, NFC_FIFO_SIZE = 100) + RFID Reader Demo sloc297

    1. I can read up to 40 blocks. How is that possible if 1 Block has 4 bytes and the RX Data has 100 bytes? Shouldn´t the maximum amount of blocks that I can read be 25 (25Blocks*4bytes=100bytes)?

    2. I have tried to increase the NFC_FIFO_SIZE to a higher value (e.g. 200) but the build process fails, as the program will not fit into the available memory. I assume this makes sense, as the launchpad has 512 bytes of RAM according to the data sheet. In that situation, I could use multiple ISO15693_sendReadMultipleBlock commands, as you suggested.

    nRF5340 (512KB RAM) + Own application based on Reader Demo

    4. Considering how much more RAM I have here, I went ahead and set the NFC_FIFO_SIZE to 256. In that situation, I assumed that it is worth to increase the RX Data buffer size and just call  ISO15693_sendReadMultipleBlock once. Or am I wrong?

    5. I thought that the required buffer size was equal to the number of blocks to read * bytes of each block. In my case, 52 blocks of 4 bytes each ->  208. However, with a FIFO size of 208, the multiple block read fails. I assume that some extra bytes are necessary and therefore it works with a size of 256?

    Regards.

  • Hi JBF,

    thanks for the additional information. Yes the define is the NFC_FIFO_SIZE. Why this is working with 40 blocks for you sound like a miracle. Defining more as the 127 byte FIFO size will not work because I could not see any code that would handle the event when the FIFO is full and saves the current RX data.

    If this is acceptable for you, I think it is best to stay with the solution to read the data in 3 passes with ReadMultibleBlocks.

    Best Regards,

    Helfried