AnsweredAssumed Answered

ST25R3911 No Response After second APDU Command

Question asked by Marius Celliers on Feb 8, 2018
Latest reply on Feb 12, 2018 by Marius Celliers

Hi .. I am currently sending an APDU Command to a card with the ST25R3911 and get a valid response.

I use the HAL drivers and middleware from ST-CubeMX ( CPU = STM32F401RE)

 

As soon as I try to send another APDU command ( or even the same one again) I receive 0 bytes from the card.

 

I start With rfalIsoDepPollAHandleActivation()

   then i set up may parameters (rfalIsoDepApduTxRxParam)

 

   then I send my first APDU Command. (rfalIsoDepApduBufFormat)

 

  err = rfalIsoDepStartApduTransceive(myParam);

 

   then I wait for the response in a loop with rfalworker()

 

         for (int i=0;i<TIMEOUT;i++)
            {
               // Run the RFAL Worker
               rfalWorker();
              err = rfalIsoDepGetApduTransceiveStatus(); //Check The Status of the APDU Transceive
               if (err == ERR_NONE)
               {
                     logUsart("APDU Transceive Success\r\n");
                     rfalWorker();
                     HAL_Delay(20);
                     break;

                 }
               HAL_Delay(20);
               if (err == ERR_BUSY)
               {
                  logUsart(".");
               }
            }

 

   

after I received my rxBuf data,

   I change the txBufLen  and apdu command and send the data to the card, but now i get 0 bytes returned.

   also if i send the same apdu command to the card I also get 0 bytes returned.

 

my first apdu sending code is exactly the same as the second apdu sending code.

I also clear my Rx and Tx APDU buffers before loading the next C-APDU.

 

      ST_MEMSET(&apduCommand.apdu,0x00,sizeof(apduCommand.apdu));
      ST_MEMSET(&apduResponse.apdu,0x00,sizeof(apduResponse.apdu));

 

Is there any other initialization or,  setting of parameters, that I am missing ?

I believe that I should not try to run rfalIsoDepPollAHandleActivation() again (before the next APDU Transceive) as I am not disconnecting the card in any way.

Outcomes