2018-01-23 04:12 PM
Hi I am currently trying to send and receive APDU commands to an NFC PICC. I am using the X-NUCLEO-NFC05A1 (ST25R3911B) and the STM32F401RE Nucleo Board. For software I am using X-CUBE-NFC5 RFAL middleware and STM32CubeF4 HAL.
The Card is a ISO14443A Type 4 ( ISO-DEP)
I can read the UID and Type of the Card, but as soon as I try to select the first card (rfalNfcaPollerSelect), the function responds with timeout error ( 0x04).
I have gone through the RFAL.chm file multiple times and cant seem to find a resolution to my problem. Am I missing some initialization or setting?
Partial Code ( based on example from X-CUBE-NFC5 )
void loop()
{
rfalWorker();
//code for inductive wakeup then run scanA() //(code not shown to save space)
scanA();
}
void scanA()
{
rfalNfcaSensRes sensRes;
rfalNfcaPollerInitialize();
rfalFieldOnAndStartGT();
unit16_t err =
rfalNfcaPollerTechnologyDetection
( RFAL_COMPLIANCE_MODE_NFC_11, &sensRes );if (err == 0) //tagfound
{
rfalNfcaListenDevice nfcaDevList[1];
uint8_t devCnt;
err=
rfalNfcaPollerFullCollisionResolution
(RFAL_COMPLIANCE_MODE_NFC_11
, 1, nfcaDevList, &devCnt);if (nfcaDevList[0].type == RFAL_NFCA_T4T){
activateIsoDep
(nfcaDevList[0]);}}
void activateIsoDep(rfalNfcaListenDevice lisnDev)
{
rfalIsoDepDevice isoDepDevice;
rfalNfcaSelRes selRes;
uint8_t err =
rfalNfcaPollerSelect
(lisnDev.nfcId1,lisnDev.nfcId1Len,&selRes);
//Here I get err = 0x04 (TIMEOUT)
//.....
// next code for rfalIsoDepPollAHandleActivation
// .............................
}
#iso14443a-iso-dep #st25r3911b #x-cube-nfc5 #rfal-al #rfalnfcapollerselect #send-apduSolved! Go to Solution.
2018-01-29 02:13 AM
Hi Marius,
I rechecked: You are right. There are mainly two cases for devices after rfalNfcaPollerFullCollisionResolution().
If the isSleep==true you need to issue:
rfalNfcaPollerCheckPresence() and
rfalNfcaPollerSelect
() to have it selected.
If the device has isSleep==false then it is already selected and it will not answer to a select (you shouldn't even issue it because it would fall back to IDLE) and you immediately proceed with rfalIsoDepPollAHandleActivation().
Regards, Ulrich
2018-01-25 04:05 AM
Hi Marius,
overall your code should work if you have one device only which is known to be a T4T.
Could you in your code check after
rfalNfcaPollerFullCollisionResolution()
the values of err, devCnt and
nfcaDevList[0].isSleep please!
Regards, Ulrich
2018-01-28 10:25 AM
Hi. Thank you for the reply.
rfalNfcaPollerFullCollisionResolution()
provides no error (err = 0). devCnt = 1 andnfcaDevList[0].isSleep
= falseIt seems that when I run rfalNfcaPollerFullCollisionResolution() this function goes through all connection and anticollision routines. From REQA up to SEL.
So I believe that because the card is awake, I cannot do a select again. But what I don't know yet, is if the card is also activated for APDU communication. ( rfalIsoDepPollAHandleActivation, which also returns error)
I am going through the rfal functions now to see if this is correct.
2018-01-29 02:13 AM
Hi Marius,
I rechecked: You are right. There are mainly two cases for devices after rfalNfcaPollerFullCollisionResolution().
If the isSleep==true you need to issue:
rfalNfcaPollerCheckPresence() and
rfalNfcaPollerSelect
() to have it selected.
If the device has isSleep==false then it is already selected and it will not answer to a select (you shouldn't even issue it because it would fall back to IDLE) and you immediately proceed with rfalIsoDepPollAHandleActivation().
Regards, Ulrich