cancel
Showing results for 
Search instead for 
Did you mean: 

ST25DV64KC Multiple Block Read/Write Error with X-Nucleo-NFC03A1: Seeking Guidance

KemalUzgoren
Associate III

Hello,
I want to read and write to st25dv64kc IC with X-Nucleo-NFC03A1 reader/writer. I can write up to 4 bytes with rfalNfcvPollerWriteSingleBlock() function. But when I want to write 2 blocks or more with rfalNfcvPollerWriteMultipleBlocks() function, I get an error when I want to read at the same time.
What am I doing wrong in the code I wrote, How many blocks of multiple reads and multiple writes can I do at one time? 

void masterNFCV(rfalNfcvListenDevice *nfcvDev){

      ReturnCode  err;

      uint16_t rcvLen;

      uint8_t blockNum = 2;

      uint8_t rxBuf[1 + 2*4 + RFAL_CRC_LEN];

      uint8_t *uid;

      uint8_t reqFlag;

 

      uint8_t wrData[8] = {0x11, 0x99, 0xFF, 0x00, 0x67, 0xA5, 0xCF, 0xFF};

      

      uid = nfcvDev->InvRes.UID;

      reqFlag = RFAL_NFCV_REQ_FLAG_DEFAULT;

 

      err = rfalNfcvPollerWriteMultipleBlocks(reqFlag, uid, 1, blockNum, rxBuf, sizeof(rxBuf), 4, wrData,  sizeof(wrData) );

      platformLog("Write Block %s Data %s\r\n", (err != ERR_NONE) ? "FAIL" : "OK", hex2Str(wrData, 8));

 

      err = rfalNfcvPollerReadMultipleBlocks(reqFlag, uid, 1, blockNum, rxBuf, sizeof(rxBuf), &rcvLen);

      platformLog("Read Block: %s %s\r\n", (err != ERR_NONE) ? "FAIL": "OK Data:", (err != ERR_NONE) ? "" : hex2Str( &rxBuf[1], 8));

}

Best regards

KU

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi,

the ISO 15693 states that the number of blocks in the request is one less than the number of blocks that the tag shall return in its response. This means that

  • blocknum = 0 corresponds to 1 block
  • blocknum = 1 corresponds to 2 blocks
  • blocknum = 255 corresponds to 256 blocks

If you want to access to 2 blocks, blocknum has to be set to 1.

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 ISO 15693 states that the number of blocks in the request is one less than the number of blocks that the tag shall return in its response. This means that

  • blocknum = 0 corresponds to 1 block
  • blocknum = 1 corresponds to 2 blocks
  • blocknum = 255 corresponds to 256 blocks

If you want to access to 2 blocks, blocknum has to be set to 1.

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.

 Hi, 

I solved the error, I just wanted to save time to see if there was something I missed, thank you for your help.

Best regards,

KU

Brian TIDAL
ST Employee

Hi,

well done. Would you please mark this thread as Solved ("Accept as solution")? 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.