cancel
Showing results for 
Search instead for 
Did you mean: 

Wake-up from stop 2 mode using ST25R3916 interrupt pin (NFC06-A1)

ERRAOUI Abdelhakim
Associate II

Hi,

I am using the NFC06-A1 with Nucleo-L476RG and I want to configure wakeup mode for NFC IC (with inductive tag detect mode) and also put the MCU into STOP2 mode.

Once the MCU enters STOP 2 mode using this fucntion HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI) I can't receive any interrupt and no tag is detected.

So in the code I did this :

in rfalWakeUpModeStart() function :

if( config == NULL )
    {
        gRFAL.wum.cfg.period      = RFAL_WUM_PERIOD_800MS;
        gRFAL.wum.cfg.irqTout     = false;
        gRFAL.wum.cfg.swTagDetect = true;
      
        gRFAL.wum.cfg.indAmp.enabled   = true;
        gRFAL.wum.cfg.indPha.enabled   = false;
        gRFAL.wum.cfg.cap.enabled      = false;
        gRFAL.wum.cfg.indAmp.delta     = 2U;
        gRFAL.wum.cfg.indAmp.reference = RFAL_WUM_REFERENCE_AUTO;
        gRFAL.wum.cfg.indAmp.autoAvg   = true;		
    }

in demoIni() function

bool demoIni( void )
{
    ReturnCode err;
    
#if defined(STM32L476xx)
    if( (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) != 0)
    {
        verbose = true;
    }
#endif
    ndefShowDemoUsage();
    
    err = rfalNfcInitialize();
    if( err == ERR_NONE )
    {
        discParam.compMode      = RFAL_COMPLIANCE_MODE_NFC;
        discParam.devLimit      = 1U;
        discParam.nfcfBR        = RFAL_BR_212;
        discParam.ap2pBR        = RFAL_BR_424;
 
        ST_MEMCPY( &discParam.nfcid3, NFCID3, sizeof(NFCID3) );
        ST_MEMCPY( &discParam.GB, GB, sizeof(GB) );
        discParam.GBLen         = sizeof(GB);
 
        discParam.notifyCb             = NULL;
        discParam.totalDuration        = 1000U;
        discParam.wakeupEnabled        = true;
        discParam.wakeupConfigDefault  = true;
        discParam.techs2Find           = ( RFAL_NFC_POLL_TECH_A | RFAL_NFC_POLL_TECH_B | RFAL_NFC_POLL_TECH_F | RFAL_NFC_POLL_TECH_V | RFAL_NFC_POLL_TECH_ST25TB );
#if defined(ST25R3911) || defined(ST25R3916)
        discParam.techs2Find   |= RFAL_NFC_POLL_TECH_AP2P;
#endif /* ST25R3911 || ST25R3916 */
        
        
#if defined(ST25R3916)
      
      /* Set configuration for NFC-A CE */
      ST_MEMCPY( discParam.lmConfigPA.SENS_RES, ceNFCA_SENS_RES, RFAL_LM_SENS_RES_LEN );                        /* Set SENS_RES / ATQA */
      ST_MEMCPY( discParam.lmConfigPA.nfcid, ceNFCA_NFCID, RFAL_NFCID2_LEN );                                   /* Set NFCID / UID */
      discParam.lmConfigPA.nfcidLen = RFAL_LM_NFCID_LEN_07;                                                     /* Set NFCID length to 7 bytes */
      discParam.lmConfigPA.SEL_RES  = ceNFCA_SEL_RES;                                                           /* Set SEL_RES / SAK */
 
      /* Set configuration for NFC-F CE */
      ST_MEMCPY( discParam.lmConfigPF.SC, ceNFCF_SC, RFAL_LM_SENSF_SC_LEN );                                    /* Set System Code */
      ST_MEMCPY( &ceNFCF_SENSF_RES[RFAL_NFCF_LENGTH_LEN], ceNFCF_nfcid2, RFAL_LM_SENSF_RES_LEN );               /* Load NFCID2 on SENSF_RES */
      ST_MEMCPY( discParam.lmConfigPF.SENSF_RES, ceNFCF_SENSF_RES, RFAL_LM_SENSF_RES_LEN );                     /* Set SENSF_RES / Poll Response */
      
      discParam.techs2Find |= ( RFAL_NFC_LISTEN_TECH_A | RFAL_NFC_LISTEN_TECH_F );
      
#endif /* ST25R3916 */
 
        state = DEMO_ST_START_DISCOVERY;
        return true;
    }
    return false;
}

PS : the initialization is good and also without the stop mode the wake-up feature is working fine.

Could you please help to see what am I missing ?

Another question : What is the maximum supply current of the ST25R3916 ? looking into the datasheet I see many values , but in the maximum absolute ratings two values are mentionned IVDD_EXT = 500mA, IVDD_LDO = 350mA ?

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
Grégoire Poulain
ST Employee

Hi Erraqui,

I will try to answer the different topics below:

HW Wake-up vs SW Tag Detection

Both ST25R3911 and ST25R3916 provide a feature where the AFE is placed in Wake-up mode. Once in this mode the device will automatically monitor the antenna characteristics (based on the provided configuration) and signal the host with an interrupt if the wake-up conditions are met.

This is all handled automatically by the IC/AFE.

Besides the HW Wake-up, on ST25R3916, the RFAL allows another option to perform a SW Tag detection.

This is no longer handled by the IC/AFE. Simply the host/MCU will periodically perform the measurement(s) desired and monitor the antenna characteristic on its own.

This off course will require the host/MCU to remain running (at least periodically).

Further details can be found on ST25R3916 Wake-up mode AN.

RFAL Wake-up mode

Depending on your application it is possible to configure the Wake-up as desired via parameters.

On the code snippet you shared, you have tweaked the RFAL library to achieve a particular usage by default ( config == NULL).

One should not need to manipulate the driver code, and simply make use of the rfalWakeUpConfig to parameterize the Wakeup as below:

rfalWakeUpConfig wuConfig;
 
wuConfig.period  = RFAL_WUM_PERIOD_800MS;
wuConfig.swTagDetect  = false;
...
...
                
rfalWakeUpModeStart( &wuConfig );

Supply current

Exactly, there are two values on the datasheet which refer two different configurations.

As detailed on Datasheet, one is when using internal voltage regulator, the other when supplied from an external source (internal voltage regulator bypassed).

Best regards

GP

View solution in original post

2 REPLIES 2
Grégoire Poulain
ST Employee

Hi Erraqui,

I will try to answer the different topics below:

HW Wake-up vs SW Tag Detection

Both ST25R3911 and ST25R3916 provide a feature where the AFE is placed in Wake-up mode. Once in this mode the device will automatically monitor the antenna characteristics (based on the provided configuration) and signal the host with an interrupt if the wake-up conditions are met.

This is all handled automatically by the IC/AFE.

Besides the HW Wake-up, on ST25R3916, the RFAL allows another option to perform a SW Tag detection.

This is no longer handled by the IC/AFE. Simply the host/MCU will periodically perform the measurement(s) desired and monitor the antenna characteristic on its own.

This off course will require the host/MCU to remain running (at least periodically).

Further details can be found on ST25R3916 Wake-up mode AN.

RFAL Wake-up mode

Depending on your application it is possible to configure the Wake-up as desired via parameters.

On the code snippet you shared, you have tweaked the RFAL library to achieve a particular usage by default ( config == NULL).

One should not need to manipulate the driver code, and simply make use of the rfalWakeUpConfig to parameterize the Wakeup as below:

rfalWakeUpConfig wuConfig;
 
wuConfig.period  = RFAL_WUM_PERIOD_800MS;
wuConfig.swTagDetect  = false;
...
...
                
rfalWakeUpModeStart( &wuConfig );

Supply current

Exactly, there are two values on the datasheet which refer two different configurations.

As detailed on Datasheet, one is when using internal voltage regulator, the other when supplied from an external source (internal voltage regulator bypassed).

Best regards

GP

ERRAOUI Abdelhakim
Associate II

Hi Poulain,

Thanks. the appnote helps a lot.

To acheive the lowest power consumption I used a button to Enable the NFC feature whenever I want to scan a tag then disable it when the operation is done or after a while (timeout).

Best regards,