Skip to main content
Daniel Mosconi
Associate
May 3, 2019
Solved

Reading NFCA_T2T (NTAG) memory. Timeout error

Hello,

I'm using ST25R3911 with my own board, and I need to read a ISO14443A/NFC-A T2T card, like NTAG213/6. I'm using the ST25R3911 DISCO FW 1.28 files.

The card is correctly detected, and I'm able to read the UID, but when I try to select the sector to read using the rfal_t2t files (rfalT2TPollerSectorSelect function) I obtain a 04 error due to timeout.

My function:

bool PollNFCA()
{
	ReturnCode err;
	rfalNfcaSensRes sensRes;
	rfalNfcaSelRes selRes;
	rfalNfcaListenDevice nfcaDevList[EXAMPLE_NFCA_DEVICES];
	uint8_t devCnt;
	uint8_t devIt;
	bool found = false;
 
	rfalNfcaPollerInitialize();		// Initialize RFAL for NFC-A
	rfalFieldOnAndStartGT(); 	// Turns the Field On and starts GT timer
	 //----------------------------------------------------------------------------
	 // Perform NFC-A Technology detection
	 err = rfalNfcaPollerTechnologyDetection( RFAL_COMPLIANCE_MODE_NFC, &sensRes ); 	// Poll for nearby NFC-A devices
	 if(err == ERR_NONE) 	// NFC-A type card found
	 {
		 err = rfalNfcaPollerFullCollisionResolution( RFAL_COMPLIANCE_MODE_NFC, 1, nfcaDevList, &devCnt);
		 if ( (err == ERR_NONE) && (devCnt > 0) )
		 {
			 found = true;
			 printf("NFC-A device(s) found %d\r\n", devCnt );
			 devIt = 0; // Use the first device on the list
			 //----------------------------------------------------------------------------
			 // Check if desired device is in Sleep
			 if( nfcaDevList[devIt].isSleep )
			 {
				 err = rfalNfcaPollerCheckPresence( RFAL_14443A_SHORTFRAME_CMD_WUPA, &sensRes ); 	// Wake up all cards
				 if( err != ERR_NONE )
				 {
					 return false;
				 }
				 err = rfalNfcaPollerSelect( nfcaDevList[devIt].nfcId1, nfcaDevList[devIt].nfcId1Len, &selRes ); 	// Select specific device
				 if( err != ERR_NONE )
				 {
					 return false;
				 }
			 }
			 printf("ISO14443A/NFC-A card found. UID: %s\r\n", hx2Str(nfcaDevList[0].nfcId1, nfcaDevList[0].nfcId1Len));
 
			 if(nfcaDevList[devIt].type == RFAL_NFCA_T2T)		// Perform protocol specific activation
			 {
 
		 		 /* NFC-A T2T device found, NFCID/UID is contained in: nfcaDev.nfcid */
		 		 /* Following communications shall be performed using:
		 		 * * - Non blocking: rfalStartTransceive() + rfalGetTransceiveState()
		 		 * * - Blocking: rfalTransceiveBlockingTx() + rfalTransceiveBlockingRx() or rfalTransceiveBlockingTxRx() */
 
				 err = rfalT2TPollerSectorSelect(4);
 
				 if( err != ERR_NONE )
				 {
					 printf(" error: %d Exit...\r\n", err);
					 return false;
				 }
			 }
		 }
	 }
	return found;
}

Thanks

    This topic has been closed for replies.
    Daniel Mosconi
    Daniel MosconiBest answer
    Associate
    May 20, 2019

    Now it works.

    The NTAG tags don't use the 0xC2 command (T2T sector select).

    1 reply

    Daniel Mosconi
    Daniel MosconiAuthorBest answer
    Associate
    May 20, 2019

    Now it works.

    The NTAG tags don't use the 0xC2 command (T2T sector select).