Skip to main content
Graduate
November 26, 2023
Solved

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

  • November 26, 2023
  • 2 replies
  • 1303 views

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

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

    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

    2 replies

    Technical Moderator
    November 26, 2023

    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

    Graduate
    November 27, 2023

     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

    Technical Moderator
    November 27, 2023

    Hi,

    well done. Would you please mark this thread as Solved ("Accept as solution")? Thanks

    Rgds

    BT