Why does rfalST25xVPollerWritePassword() fail on ST25TV02KC?
Hi everyone,
I'm working on writing the configuration password (PWD_CFG, 0x00) to an ST25TV02KC NFC tag using the ST25R3916B reader and the RFAL middleware (X-CUBE-NFC6). I am following the standard procedure:
Open a CONFIG security session using PresentPassword (XORed Password)
Generate a new XOR-coded password using GetRandomNumber
Call WritePassword to write a new password (in this case, still 0x00..0x00 for testing)
Here's the code I use:
if (generateXorPassword(uid, pwd_cfg, xorPwd) != RFAL_ERR_NONE) goto ERROR_RED_LED;
if (rfalST25xVPollerPresentPassword( // 0x00 = PWD_CFG
RFAL_NFCV_REQ_FLAG_DEFAULT | RFAL_NFCV_REQ_FLAG_ADDRESS,
uid,
0x00, // PWD_CFG
xorPwd, sizeof(xorPwd)
) != RFAL_ERR_NONE)
{
goto ERROR_RED_LED;
}
// CONFIG Security Session is now open!
{
// Change PWD_CFG (0x00)
if (generateXorPassword(uid, pwd_cfg, xorPwd) != RFAL_ERR_NONE) goto ERROR_RED_LED;
if(rfalST25xVPollerWritePassword(
RFAL_NFCV_REQ_FLAG_DEFAULT | RFAL_NFCV_REQ_FLAG_ADDRESS,
uid,
0x00, // PWD_CFG
xorPwd,
4
) != RFAL_ERR_NONE) goto ERROR_RED_LED;
}
Despite the session being open, the WritePassword() command always fails (with return code 5, RFAL_ERR_REQUEST).
The PresentPassword() call succeeds, and I can confirm that the session is active.
What could be the reason that WritePassword() is failing?
Any help or ideas would be greatly appreciated!
Thanks in advance.
