Skip to main content
KShib
Visitor II
February 13, 2019
Solved

How to set LOCK_CFG register from 1 to 0 at ST25DV-DISCOVERY?

  • February 13, 2019
  • 1 reply
  • 806 views

I am evaluating the ST25DV series using the ST25DV-DISCOVERY and the ST25 Android NFC tap application.

I accidentally set the LOCK_CFG register of the ST25DV to 1 (locked) via RF by the Register Management of the NFC tap app, and then the system configuration was locked.  Now I need to change the system configuration.  According to the ST25DVxxK datasheet, it is impossible to set the LOCK_CFG register from 1 to 0 (unlocked) via RF, and this register is required to be written via I2C.  However, it appears that the ST25DV-DISCOVERY does not have UIs to unlock (set the LOCK_CFG register from 1 to 0) via I2C or to factory-reset the register.

Please let me know:

- at the ST25DV-DISCOVERY alone how to unlock via I2C or to factory-reset the register.

- PC applications if the PC applications connecting to the ST25DV-DISCOVERY with USB cable can unlock or factory-reset the register.

- other methods if the above two are impossible.

Thank you in advance.

    This topic has been closed for replies.
    Best answer by Ronald B.

    ​Hi kshib,

    You're correct this functionality has not been integrated to the demo.

    But with the provided ST25DV-I2C drivers included to the demo source code (STSW-ST25DV001), it's really simple to unlock the configuration of the ST25DV-I2C.

    Please add the following code to the main.c for instance and compile the full demo firmware:

    #include "st25_discovery_nfctag.h"

    int UnlockCfg(void)

    {

     NFCTAG_StatusTypeDef status;

     ST25DV_I2CSSO_STATUS session_status;

     // initialize the I2C

     status = BSP_NFCTAG_Init();

     if(status != NFCTAG_OK)

      return 0;

     

     // open I2C session

     session_status = PresentPasswd( true );

     if(session_status != ST25DV_SESSION_OPEN)

      return 0;

     // unlock the configuration

     status = BSP_NFCTAG_GetExtended_Drv( )->WriteLockCFG(ST25DV_UNLOCKED);

     if(status != NFCTAG_OK)

      return 0;

     // this is a success

     return 1;

    }

    And call this function from the main, after the HAL_Init(); for instance.

    This should solve your issue.

    Please let me know in case you experience any further issue.

    Regards,

    Ronald

    1 reply

    Ronald B.
    Ronald B.Best answer
    Visitor II
    February 15, 2019

    ​Hi kshib,

    You're correct this functionality has not been integrated to the demo.

    But with the provided ST25DV-I2C drivers included to the demo source code (STSW-ST25DV001), it's really simple to unlock the configuration of the ST25DV-I2C.

    Please add the following code to the main.c for instance and compile the full demo firmware:

    #include "st25_discovery_nfctag.h"

    int UnlockCfg(void)

    {

     NFCTAG_StatusTypeDef status;

     ST25DV_I2CSSO_STATUS session_status;

     // initialize the I2C

     status = BSP_NFCTAG_Init();

     if(status != NFCTAG_OK)

      return 0;

     

     // open I2C session

     session_status = PresentPasswd( true );

     if(session_status != ST25DV_SESSION_OPEN)

      return 0;

     // unlock the configuration

     status = BSP_NFCTAG_GetExtended_Drv( )->WriteLockCFG(ST25DV_UNLOCKED);

     if(status != NFCTAG_OK)

      return 0;

     // this is a success

     return 1;

    }

    And call this function from the main, after the HAL_Init(); for instance.

    This should solve your issue.

    Please let me know in case you experience any further issue.

    Regards,

    Ronald