cancel
Showing results for 
Search instead for 
Did you mean: 

Reduce the wake up time of ST25R95 RFID card reader from 300ms to 100ms

mustaqim007
Associate II

Hello, am using RFID card reader ST25R95 using its stack. I want to reduce the fixed wake up time from 300ms to 100ms. 

#define RFAL_ST25R95_IDLE_DEFAULT_WUPERIOD 0x24U /*!< Fixed WU Period to reach ~300ms timeout with Max Sleep = 0 */

Is there any method how i can reduce it, this delay is affecting my product as the user has to hold the card until it is detected. 

I have also set the 

RFAL WUM Period period; /*!< Wake-Up Timer period ; how often measurement(s) is performed */    ==>100ms

in struct RFAL Wake Up Config.

But it is of no use..

Is there any method how I can resolve it.

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi

here are my findings:

  • the ST25R95 is configured for operating in NFC-A and NFC-B. If your application is designed to operate with NFC-A tags only, RFAL_FEATURE_NFCB should set to false in platform.h and RFAL_NFC_POLL_TECH_B should be removed from discParam.techs2Find
  • the wake up mode of the ST25R95 is not used (low power consumption state with tag detection. See tag detector in the datasheet. See also discParam.wakeupEnabled parameter). Only the polling loop is used. The duration of polling cycle seems to be around 270ms. This can be changed thanks to the  discParam.totalDuration parameter (for example discParam.totalDuration = 100U;).
  • the first successful polling starts at 2.430400 s with a SEL_RES response at 2.641800, so the overall technology detection + collision resolution activities duration is about 210 ms. This can be reduced if NFC-B is not used by your application and removed from the supported technologies.

See also UM289 RF/NFC abstraction layer (RFAL) User Manual

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
Brian TIDAL
ST Employee

Hi,

the current instanciation of the rfalWakeUpModeStart API for the ST25R95 uses a fixed WakeUp period of 304 ms. See WU Period formula in the ST25R95 datasheet : timeout (ms) = 256 * 1/32 *(WU Period + 2) *(MaxSleep +1) with WU Period = 0x24 and MaxSleep = 0, the timeout is 304ms.

If the RFAL_ST25R95_IDLE_DEFAULT_WUPERIOD is set to 0x0A, the timeout is 96 ms (and 104ms for a WU Period = 0x0B).

Can you share more details about "this delay is affecting my product as the user has to hold the card until it is detected."? The wake up mode should be exited at worse 304 ms after a tag is presented on the antenna and then the technolody detection, collision resolution and activation activities should be quite fast. Which tag technology is being used (NFCA, B, F or V)? Which technolgies are enabled on reader side (A, B, F, V)? Which HW is being used (ST board or custom design)? Is it possible to connect a logic analyzer on the SPI + IRQ_IN + IRQ_OUT + tag present event and provide a trace?

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi Brian

Please find attched the waveform(please extract it) and the link to download the viewing software.

Which tag technology is being used (NFCA, B, F or V)?  NFCA

Which technolgies are enabled on reader side (A, B, F, V)?  A

Which HW is being used (ST board or custom design)? Custom design board

I tried RFAL_ST25R95_IDLE_DEFAULT_WUPERIOD = 0x0A, but still am getting the wake up time as 304ms.

"The wake up mode should be exited at worse 304 ms after a tag is presented on ..." is there any method i can reduce this.

https://support.saleae.com/logic-software/legacy-software/older-software-releases#logic-1-x-download-links

 

Brian TIDAL
ST Employee

Hi

here are my findings:

  • the ST25R95 is configured for operating in NFC-A and NFC-B. If your application is designed to operate with NFC-A tags only, RFAL_FEATURE_NFCB should set to false in platform.h and RFAL_NFC_POLL_TECH_B should be removed from discParam.techs2Find
  • the wake up mode of the ST25R95 is not used (low power consumption state with tag detection. See tag detector in the datasheet. See also discParam.wakeupEnabled parameter). Only the polling loop is used. The duration of polling cycle seems to be around 270ms. This can be changed thanks to the  discParam.totalDuration parameter (for example discParam.totalDuration = 100U;).
  • the first successful polling starts at 2.430400 s with a SEL_RES response at 2.641800, so the overall technology detection + collision resolution activities duration is about 210 ms. This can be reduced if NFC-B is not used by your application and removed from the supported technologies.

See also UM289 RF/NFC abstraction layer (RFAL) User Manual

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi Brian,

Thanks for your help, i have disabled RFAL_FEATURE_NFCB and now my polling time has reduced to 270ms.

Changing discParam.totalDuration has no effect on the above polling time.

Below is the init_Rfid code

 
discParam.compMode = RFAL_COMPLIANCE_MODE_NFC;
discParam.devLimit = 1U;
discParam.nfcfBR = RFAL_BR_212;
discParam.ap2pBR = RFAL_BR_424;
discParam.maxBR = RFAL_BR_KEEP;
 
ST_MEMCPY(&discParam.nfcid3, NFCID3, sizeof(NFCID3));
ST_MEMCPY(&discParam.GB, GB, sizeof(GB));
discParam.GBLen = sizeof(GB);
 
discParam.wakeupEnabled = false;
discParam.wakeupConfigDefault = true;
discParam.totalDuration = 10U;
discParam.techs2Find = 0;
#if RFAL_FEATURE_NFCA
        discParam.techs2Find          |= RFAL_NFC_POLL_TECH_A;
#endif
/* Check for valid configuration by calling Discover once */
err = rfalNfcDiscover(&discParam);
rfalNfcDeactivate(false);
 
if (err != ERR_NONE)
{
retval = false;
}
 
state = DEMO_ST_START_DISCOVERY;
 
Is there anything else i can do to reduce the polling time further.

 

Brian TIDAL
ST Employee

Hi,

on my side, the overall technology detection + collision resolution for T2T tag has a duration of less than 45 ms. In the main NFC cycle, make sure there is no platformDelay() between each polling loop. Also make sure the main NFC cycle is called regularly (I've seen some 50ms delays in the trace so I guess some processing is done and may slow down the polling loop). Serial traces may also slow down the polling loop (use high speed such as 921600 bps + DMA). On my side the SPI is configured at 1.5 MHz, in your trace this 1MHz. You can increase the SPI to 1.5MHz but I believe this will not give a significant gain.

Fell free to share a new SPI trace with me and I will have  a look on the timings.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi Brian,

I have set SPI commn speed to 2 MHZ,

This is my wake up start func

ReturnCode rfalWakeUpModeStart( const rfalWakeUpConfig *config )
{
/* Check if RFAL is not initialized */
if (gRFAL.state == RFAL_STATE_IDLE)
{
return ERR_WRONG_STATE;
}

if( config == NULL )
{
gRFAL.wum.cfg.period = RFAL_WUM_PERIOD_300MS;
gRFAL.wum.cfg.irqTout = false;
gRFAL.wum.cfg.swTagDetect = false;

gRFAL.wum.cfg.indAmp.enabled = true;
gRFAL.wum.cfg.indPha.enabled = false;
gRFAL.wum.cfg.cap.enabled = false;
gRFAL.wum.cfg.indAmp.delta = 8U;
gRFAL.wum.cfg.indAmp.reference = RFAL_WUM_REFERENCE_AUTO;
}
else
{
gRFAL.wum.cfg = *config;
}

/* Check for valid configuration */
if( gRFAL.wum.cfg.cap.enabled || gRFAL.wum.cfg.indPha.enabled || gRFAL.wum.cfg.swTagDetect || !gRFAL.wum.cfg.indAmp.enabled )
{
return ERR_PARAM;
}

if (gRFAL.wum.cfg.indAmp.reference == RFAL_WUM_REFERENCE_AUTO)
{
gRFAL.wum.cfg.indAmp.reference = gRFAL.wum.CalTagDet;
}
if ((gRFAL.wum.cfg.indAmp.delta > gRFAL.wum.cfg.indAmp.reference) || ((((uint32_t)gRFAL.wum.cfg.indAmp.delta) + ((uint32_t)gRFAL.wum.cfg.indAmp.reference)) > 0xFCUL))
{
return ERR_PARAM;
}

/* Use a fixed period of ~300 ms */
st25r95Idle(gRFAL.wum.cfg.indAmp.reference - gRFAL.wum.cfg.indAmp.delta, gRFAL.wum.cfg.indAmp.reference + gRFAL.wum.cfg.indAmp.delta, RFAL_ST25R95_IDLE_DEFAULT_WUPERIOD);
gRFAL.state = RFAL_STATE_WUM;
gRFAL.wum.state = RFAL_WUM_STATE_ENABLED;
return ERR_NONE;
}

RFAL_ST25R95_IDLE_DEFAULT_WUPERIOD = 0x0A.

Still am not able to reduce the wake up time. Could you please suggest if any correction is needed in the above function.

Brian TIDAL
ST Employee

Hi,

As explained in one of my previous post about my findings, the wake-up mode is not used in your application (discParam.wakeupEnabled = false;) so rfalWakeUpModeStart is not used and your application does a continuous NFC polling. 

As I've seen some ~50 ms delays in your trace, I would suggest to check the scheduling of your functions. Feel free to send me a new trace.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.