2023-11-26 03:23 AM
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
Solved! Go to Solution.
2023-11-26 04:35 AM - edited 2023-11-26 04:35 AM
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
If you want to access to 2 blocks, blocknum has to be set to 1.
Rgds
BT
2023-11-26 04:35 AM - edited 2023-11-26 04:35 AM
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
If you want to access to 2 blocks, blocknum has to be set to 1.
Rgds
BT
2023-11-26 10:32 PM - edited 2023-11-26 10:59 PM
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
2023-11-27 10:10 AM
Hi,
well done. Would you please mark this thread as Solved ("Accept as solution")? Thanks
Rgds
BT