cancel
Showing results for 
Search instead for 
Did you mean: 

Why function rfalNfcvPollerReadMultipleBlocks return ERR_REQUEST when numOfBlocks = 32?

Oros Nig
Associate II

Hi,

I use a X-NUCLEO-NFC06A1shield and a Nucleo-476RG to read a NFC chips ( M24LR64D-W or M24LR04).

For my test I use the demo program from ST provided with the shield.

I want to read 32 blocks (a block is 4 bytes) with the function rfalNfcvPollerReadMultipleBlocks.

If the numOfBlocks parameter is set to 31 the function works correctly.

If the numOfBlocks parameter is set to 32 the function returns ERR_REQUEST.

Could you help me to resolve this issue?

Thx & Regards

Nigoros

Note 1: The chip M24LR04 is on a red board M24LR-discovery.

Note 2: To read the chip M24LR64D-W I use the function rfalST25xVPollerM24LRReadMultipleBlocks with the same issue.

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi,

the M24LR04 supports a maximum of 32 blocks in one Read Multiple Blocks command (see M24LR04E-R Datasheet §26.5 "The maximum number of blocks is fixed at 32 assuming that they are all located in the same sector"). The number block is encoded in numOfBlocks  minus 1 i.e. a value of '06' in the "Number of blocks" field requests to read 7 blocks. A value of '00' requests to read a single block. 

When setting numOfBlocks to 32, this actually requests 33 blocks and the tag returns an error.

Using numOfBlocks = 31 will return 32 blocks

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

3 REPLIES 3
Brian TIDAL
ST Employee

Hi,

the M24LR04 supports a maximum of 32 blocks in one Read Multiple Blocks command (see M24LR04E-R Datasheet §26.5 "The maximum number of blocks is fixed at 32 assuming that they are all located in the same sector"). The number block is encoded in numOfBlocks  minus 1 i.e. a value of '06' in the "Number of blocks" field requests to read 7 blocks. A value of '00' requests to read a single block. 

When setting numOfBlocks to 32, this actually requests 33 blocks and the tag returns an error.

Using numOfBlocks = 31 will return 32 blocks

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.
Oros Nig
Associate II

Super!

I take into account your response and now it works.

The header of the function is not very verbose about it.

0693W000007CYChQAO.jpgThx & regards

Brian TIDAL
ST Employee

Hi,

Actually, numOfBlock is the number of blocks to read in addition to the one specified by firstBlockNum. This numOfBlocks parameter follows ISO/IE 15693-3 encoding of "number of blocks" in read Multiple Blocks command.

I will anyhow report your feedback to the developers.

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.