2022-05-05 06:39 AM
Hello everyone,
I am working with
My project is working with freeRTOS and I have been writing my code based in the FreeRTOS_polling project from ST25NFC_EMBEDDED_LIB_ST25R3916_1.3.0.
At this moment I am able to read/write different NFC Tag registers from NFC Reader without problems. I configured the NFC Reader in FTM mode so I am working with the 256 buffer.
Once I detected my card and the rfal process is able to exchange info I put the next code.
int32_t nfc_reader_wr(rfalNfcvListenDevice *nfcvDev , uint8_t *message, uint16_t len) {
ReturnCode err;
static uint8_t tx_buf[200];
uint8_t *uid;
/*TEST WRITE*/
uint8_t rxBuf[ 1 + DEMO_NFCV_BLOCK_LEN + RFAL_CRC_LEN ]; /* Flags + Block Data + CRC */
// known data
static uint8_t tx_msg[66] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20\
,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45\
,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65};
uid = nfcvDev->InvRes.UID;
uint8_t test_len = 60;
err = rfalNfcvPollerSelect(RFAL_NFCV_REQ_FLAG_DEFAULT, nfcvDev->InvRes.UID );
if( err == ERR_NONE )
{
uid = NULL;
}
// This case works correctly
err = rfalST25xVPollerWriteMessage( RFAL_NFCV_REQ_FLAG_DEFAULT, uid, 50 -1 , tx_msg, (uint8_t*)tx_buf, 200 );
osDelay(500);
// In this case I get ERR_TIMEOUT
err = rfalST25xVPollerWriteMessage( RFAL_NFCV_REQ_FLAG_DEFAULT, uid, 60 -1 , tx_msg, (uint8_t*)tx_buf, 200 );
osDelay(500);
err = rfalST25xVPollerReadDynamicConfiguration( RFAL_NFCV_REQ_FLAG_DEFAULT, uid, 0x0D, rxBuf );
osDelay(500);
err = rfalST25xVPollerReadMessageLength( RFAL_NFCV_REQ_FLAG_DEFAULT, uid, rxBuf );
}
While I can write 50 bytes of information to the NFC tag correctly (line 25) , I get the ERR_TIMEOUT when I try to write 60 bytes. (line 28)
Any help would be great!
Solved! Go to Solution.
2022-05-06 06:50 AM
Hi,
not sure about the reason. I am not an expert on the FTM but did you check also the relevant configuration the DV side to be able to write data to the mailbox? The library you are using contains also an FTM example. Maybe worth checking it out as reference.
If you suspect an issue on reader side then please attach a logic analyzer, trace SPI + SS + IRQ, then we can inspect for any potential timing issues.
BR, Ulysses
2022-05-06 06:50 AM
Hi,
not sure about the reason. I am not an expert on the FTM but did you check also the relevant configuration the DV side to be able to write data to the mailbox? The library you are using contains also an FTM example. Maybe worth checking it out as reference.
If you suspect an issue on reader side then please attach a logic analyzer, trace SPI + SS + IRQ, then we can inspect for any potential timing issues.
BR, Ulysses