cancel
Showing results for 
Search instead for 
Did you mean: 

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

KShib
Associate

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Ronald B.
Associate III

​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

View solution in original post

1 REPLY 1
Ronald B.
Associate III

​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