cancel
Showing results for 
Search instead for 
Did you mean: 

Getting multiple errors in ReadMultipleBlocks depending on the number of blocks I request to read

enric.puigvert
Associate II

Hi everyone,

I have just discovered that I have multiple errors when I try to read more than 30 blocks, rfalNfcvPollerReadMultipleBlocks() function depending on the number of blocks I try to read.

Firstly, I want you to talk about the TAG I am reading: 

- It is a ST25TV02KC NFC type5 - ISO/IEC 15693 (NFCV) TAG from ST 
- It has 320 bytes of memory and 4 bytes block-size.
- With the Android app ST25 I can read all the blocks correctly

The behavior I am seeing is the next:

- I can read successfully from 1 to 30 blocks. 

- When I ask for 31 blocks, I get ERR_FRAMING (0x09) error. I don't understand this error... Could you kindly explain it to me, please? I have, also, searched in ST forum for this error, but I haven't seen any solution related to my issue.

- When I ask for more than 32 blocks, I get ERR_RF_COLLISION (0x1D) error. Again, I don't understand why I get collision error because I have only one tag in the field of the RFID. Could you explain me this, also, please?

Another thing I don't understand, is the difference that makes that I get two different errors, since I have no limitations from the tag (since the tag has 320Bytes / 4Bytes_perBlock = 80 blocks I should be able to read...).

Finally, I want to share with you some code to give you the maximum information to solve this issue:

1. I have this structure defined for function parameters :

typedef struct {
    uint8_t         UID[8];
    e_addressMode_t addressMode;
    uint8_t         inicioBloques;
    uint8_t         numeroBloques;

    uint8_t  intentos;
    uint16_t rxLen;
    uint8_t *data;
} s_read_multiple_blocks_params_t;

2. The struct variables are initialized in my code like this:

param->data     = malloc(FLAGS_BYTES + (param->numeroBloques * DEMO_NFCV_BLOCK_LEN) + CRC_BYTES);

param->numeroBloques = 31; // or 32 depending

2. I use the function rfalNfcvPollerReadMultipleBlocks() like this:

ReturnCode err = ERR_NONE;

/*
 * Read block using Read Multiple Blocks command
 * with addressed mode (uid != NULL) or selected mode (uid == NULL)
 */
if (param->addressMode == ADDRESSED) {
    err = rfalNfcvPollerReadMultipleBlocks(RFAL_NFCV_REQ_FLAG_DEFAULT,
                                           &param->UID[0],
                                           param->inicioBloques,
                                           param->numeroBloques - 1,
                                           param->data,
                                           FLAGS_BYTES + (param->numeroBloques * DEMO_NFCV_BLOCK_LEN) + CRC_BYTES,
                                           &param->rxLen);
}
else if (param->addressMode == NON_ADDRESSED) {
    err = rfalNfcvPollerReadMultipleBlocks(RFAL_NFCV_REQ_FLAG_DEFAULT,
                                           NULL,
                                           param->inicioBloques,
                                           param->numeroBloques - 1,
                                           param->data,
                                           FLAGS_BYTES + (param->numeroBloques * DEMO_NFCV_BLOCK_LEN) + CRC_BYTES,
                                           &param->rxLen);
}
else if (param->addressMode == SELECTED) {
    err = rfalNfcvPollerReadMultipleBlocks(RFAL_NFCV_REQ_FLAG_DEFAULT | RFAL_NFCV_REQ_FLAG_SELECT,
                                           NULL,
                                           param->inicioBloques,
                                           param->numeroBloques - 1,
                                           param->data,
                                           FLAGS_BYTES + (param->numeroBloques * DEMO_NFCV_BLOCK_LEN) + CRC_BYTES,
                                           &param->rxLen);
}

Thank you very much for advance,

Enric Puigvert

1 ACCEPTED SOLUTION

Accepted Solutions
enric.puigvert
Associate II

Hi Ulysses and Brian,

First of all, sorry for my late response. We have stoped the development of the project and I didn't remember that I ask a question in this forum.

First I will answer Ulysses and then Brian.

Answering Ulysses:
- Yes, I am using an ST25R3916 driver with RFAL Version ST25RFAL002.
- In case we reopen the development of the project, I will try to track rfalIso15693VICCDecode() to try debugging this issue.


Answering Brian:
- I am using ST25R3916 in a custom board and ST25RFAL002 library
- I am using a rounded antenna TAG, not an evaluation board (you can see a picture here: https://www.tagstand.com/wp-content/uploads/2023/04/products-58fdd20500bfb596d6129f2b824141c6.jpg)
- Again, in case we reopen the development of the project, I will check https://community.st.com/t5/st25-nfc-rfid-tags-and-readers/getting-err-nomem-when-implementing-custom-quot-fast-read/m-p/166860#M3205 and try to enlarge the buffer.

 

Note: I check the last reply as a solution only to close the thread. I HAVE NOT TRY IF THE SOLUTION WORKS. 


Thank you very much for the answers,

Enric Puigvert

View solution in original post

3 REPLIES 3
Ulysses HERNIOSUS
ST Employee

Hi Enric,

rfalNfcvPollerReadMultipleBlocks() will try to read all the requested memory in one bulk. I think calling it multiple times with smaller chunks will work (I expect the Android app to do that as well).

From an RF standpoint it should work also with larger chunks.

I assume you are using an ST25R391x driver. With this chip the software has to perform the low level coding and decoding of bits. For reception it has to do the Manchester decoding. For doing this the driver allocates inside rfal_rf_st25r391x.c a codingBuffer. It could be that you are running into a size limitation here. But I would expect a different error code then. 

Which version of RFAL are you using?

You may want to debug into rfalIso15693VICCDecode(), see how often it is called with which parameters and arrays and when it returns this ERR_RF_COLLISION.

 

Best Regards, Ulysses

Brian TIDAL
ST Employee

Hi,

Which reader do you use: ST25R3916/16B, ST25R3911B or ST25R95? Do you use a custom board or an ST X-NUCLEO-NFCxxx expansion board? Which FW package do you use (and which version)?

On tag side, do you use the ST25TV02KC Evaluation board (the form factor is a kind of key)?

Also, if you want to read frames having more than 255 bytes, I would suggest to have a look on https://community.st.com/t5/st25-nfc-rfid-tags-and-readers/getting-err-nomem-when-implementing-custom-quot-fast-read/m-p/166860#M3205 about the codingBuffer. It probably needs to be enlarged to ((2 + 320 + 3)*2).

On my side, with an enlarged codingBuffer, I can retrieve the 0x4F +1 blocks from the ST25DV02KC with a single ReadMultipleBlocks command.

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.
enric.puigvert
Associate II

Hi Ulysses and Brian,

First of all, sorry for my late response. We have stoped the development of the project and I didn't remember that I ask a question in this forum.

First I will answer Ulysses and then Brian.

Answering Ulysses:
- Yes, I am using an ST25R3916 driver with RFAL Version ST25RFAL002.
- In case we reopen the development of the project, I will try to track rfalIso15693VICCDecode() to try debugging this issue.


Answering Brian:
- I am using ST25R3916 in a custom board and ST25RFAL002 library
- I am using a rounded antenna TAG, not an evaluation board (you can see a picture here: https://www.tagstand.com/wp-content/uploads/2023/04/products-58fdd20500bfb596d6129f2b824141c6.jpg)
- Again, in case we reopen the development of the project, I will check https://community.st.com/t5/st25-nfc-rfid-tags-and-readers/getting-err-nomem-when-implementing-custom-quot-fast-read/m-p/166860#M3205 and try to enlarge the buffer.

 

Note: I check the last reply as a solution only to close the thread. I HAVE NOT TRY IF THE SOLUTION WORKS. 


Thank you very much for the answers,

Enric Puigvert