Skip to main content
Visitor II
February 23, 2023
Solved

How fast can we detect NFC card with ST25r3914 Reader IC .using RFAL stack

  • February 23, 2023
  • 13 replies
  • 2963 views

Hello we have integrated ST NFC RFAL stack with RL78 IC and currently we are able to detect NFC card within 1-2seconds. Is there a way to reduce this time less than 1 second to detect NFC card ?

    This topic has been closed for replies.
    Best answer by Ulysses HERNIOSUS

    Hi,

    if those two didn't heavily improve, then: analyze the timing behavior, in a first step use a logic analyzer on SPI + IRQ and find where time is lost, could be SPI speed, CS setup and hold times, incorrect timers in platform, ......

    If unsure after a first analysis to ensure correct SPI decoding and looking at timings you can also post a trace here.

    BTW: How are you measuring this time to read a card? What are your start and stop signals for this measurement?

    Regards, Ulysses

    13 replies

    Technical Moderator
    February 23, 2023

    Hi,

    can you share some details about your application:

    • is your application built on top of ST25 embedded NFC library or X-CUBE-NFC5 or STSW-ST25RFAL001?
    • Is your main loop based on demoCycle() provided in ST25 embedded NFC library or X-CUBE-NFC5?
      • if yes,
        • what is the value of discParam.totalDuration? Feel free to reduce the discParam.totalDuration to fit with your application needs
        • what is the value of discParam.wakeupEnabled?
    • which technologies (NFC-A, NFC-B, NFC-F, NFC-V, ST25TB) are needed in your application?

    Rgds

    BT

    cGosa.1Author
    Visitor II
    February 24, 2023

    Hello,

    We are using ST NFC reader IC ST25r3914. we have integrated ST RFAL stack with Renesas microcontroller RL78 over SPI.

    We need Type -A and Type-V technology in application.

    Technical Moderator
    February 24, 2023

    Hi,

    the RFAL provides several layers. The answer to your question is depending on top of which layer your application is build and which feature you are using (e.g. wake up).

    Feel free to send me more precise answers to my question related to your main loop to help me to understand how you use the RFAL so that I can support you more efficiently. Meanwhile, I assume your application is built on top of the RFAL High Layer:

    • reduce the value of discParam.totalDuration parameter (it is probably 1000 ms if you have build your main loop based on demoCycle() provided in ST25 embedded NFC library or X-CUBE-NFC5). You can for example set this parameter to 200ms
    • in platform.h, disable unused features
      • set RFAL_FEATURE_NFCB to false
      • set RFAL_FEATURE_NFCF to false
      • set RFAL_FEATURE_ST25TB to false
      • if not using the wake up mode, set RFAL_FEATURE_WAKEUP_MODE to false

    Also, see UM2890 - RF/NFC abstraction layer (RFAL) - User manual for comprehensive information about the RFAL.

    Rgds

    BT

    cGosa.1Author
    Visitor II
    February 27, 2023

    In my application inside platform.h file RFAL_FEATURE_WAKEUP_MODE is already set to false.

    I have called st25r3911Isr() inside interrupt ISR of our microcontroller.

    I have called democycle() inside a scheduler function repeating every 100ms.

    Also I am not able to find these discParam.totalDuration parameter inside stack files.

    Technical Moderator
    February 27, 2023

    Hi,

    as explained, my previous answer is based on the assumption you use the RFAL High Layer. It is difficult to provide accurate answer without having more information about which layer of the RFAL is being used in your application. Feel free to send me your democycle code in private so that I can better support you.

    Rgds

    BT

    cGosa.1Author
    Visitor II
    March 2, 2023

    Hi,

    So we are using RFAL library for the STMicroelectronics X-NUCLEO-NFC05A1.

    We have called democycle() in a routine function repeating every 100ms,

    if(u1_NfcInitFd == FALSE)

    {

       u1_NfcInitFd = demoIni(); 

     }

     else

    {

       demoCycle();    

     }

    Technical Moderator
    March 2, 2023

    ok but what is inside demoCycle?

    cGosa.1Author
    Visitor II
    March 14, 2023

    0693W00000aIt19QAC.png0693W00000aIsoLQAS.pngThis is inside democycle() function ,

    Here in RFAL_NFCA_T4T switch case we detect our tag.

    Technical Moderator
    March 14, 2023

    Hi,

    as written by Brian before: Look into totalDuration which is a paramater to rfalNfcDiscover() and calling rfalNfcWorker() every 100ms will make NFC communication very slow. For NFC-A I expect multiple calls being needed before a tag is anti-collided. Go down to 1ms or even below.

    Regards, Ulysses

    cGosa.1Author
    Visitor II
    March 15, 2023

    Hello,

    So I have tried to reduce totalDuration to 100 , 200ms but there is no change in card detection delay Also same for calling rfalNfcWorker() every 100ms I tried to reduce it to 10ms and 1ms but there is no change.

    But After setting the features in platform.h to false,

    #define RFAL_FEATURE_T1T            false /*!< Enable/Disable RFAL support for T1T (Topaz)                */

    #define RFAL_FEATURE_T2T            false /*!< Enable/Disable RFAL support for T2T      

    I have reduced the delay from 1 seconds to 620ms now So Is there anything else I can do to reduce it more to 300ms.

    This is my current RFAL configuration in platform.h

    #define RFAL_FEATURE_LISTEN_MODE        false   /*!< Enable/Disable RFAL support for Listen Mode                */

    #define RFAL_FEATURE_WAKEUP_MODE        false//true    /*!< Enable/Disable RFAL support for the Wake-Up mode             */

    #define RFAL_FEATURE_NFCA           true    /*!< Enable/Disable RFAL support for NFC-A (ISO14443A)             */

    #define RFAL_FEATURE_NFCB           true    /*!< Enable/Disable RFAL support for NFC-B (ISO14443B)             */

    #define RFAL_FEATURE_NFCF           true   /*!< Enable/Disable RFAL support for NFC-F (FeliCa)              */

    #define RFAL_FEATURE_NFCV           true    /*!< Enable/Disable RFAL support for NFC-V (ISO15693)             */

    #define RFAL_FEATURE_T1T            false//true    /*!< Enable/Disable RFAL support for T1T (Topaz)                */

    #define RFAL_FEATURE_T2T            false //true    /*!< Enable/Disable RFAL support for T2T                    */

    #define RFAL_FEATURE_T4T            true    /*!< Enable/Disable RFAL support for T4T                    */

    #define RFAL_FEATURE_ST25TB          true    /*!< Enable/Disable RFAL support for ST25TB                  */

    #define RFAL_FEATURE_ST25xV          true    /*!< Enable/Disable RFAL support for ST25TV/ST25DV               */

    #define RFAL_FEATURE_DYNAMIC_ANALOG_CONFIG   false   /*!< Enable/Disable Analog Configs to be dynamically updated (RAM)       */

    #define RFAL_FEATURE_DYNAMIC_POWER       false   /*!< Enable/Disable RFAL dynamic power support                 */

    #define RFAL_FEATURE_ISO_DEP          true    /*!< Enable/Disable RFAL support for ISO-DEP (ISO14443-4)           */

    #define RFAL_FEATURE_ISO_DEP_POLL       true    /*!< Enable/Disable RFAL support for Poller mode (PCD) ISO-DEP (ISO14443-4)  */

    #define RFAL_FEATURE_ISO_DEP_LISTEN      false   /*!< Enable/Disable RFAL support for Listen mode (PICC) ISO-DEP (ISO14443-4)  */

    #define RFAL_FEATURE_NFC_DEP          true    /*!< Enable/Disable RFAL support for NFC-DEP (NFCIP1/P2P)           */

    #define RFAL_FEATURE_ISO_DEP_IBLOCK_MAX_LEN  256U    /*!< ISO-DEP I-Block max length. Please use values as defined by rfalIsoDepFSx */

    #define RFAL_FEATURE_ISO_DEP_APDU_MAX_LEN   1024U  

    Technical Moderator
    March 15, 2023

    Hi,

    if those two didn't heavily improve, then: analyze the timing behavior, in a first step use a logic analyzer on SPI + IRQ and find where time is lost, could be SPI speed, CS setup and hold times, incorrect timers in platform, ......

    If unsure after a first analysis to ensure correct SPI decoding and looking at timings you can also post a trace here.

    BTW: How are you measuring this time to read a card? What are your start and stop signals for this measurement?

    Regards, Ulysses