2023-06-30 09:35 AM
During the first tests, using the suggested combo x-nucleo-nfc05a1 + NucleoL476RG, we noticed something strange: swiping an example NFC tag (see attachment) resulted in a failure, when it seemed to be a classic NTAG213.
Digging into the code (X-CUBE-NFC5 library) we found that in the file ndef_t2t.c, line 360-364, if the TLV type field has Lock Control TLV or Memory Control TLV, any NDEF operation for the badge fails. Returning ERR_REQUEST(5).
As you can see in the source code, it is explicitly stated that “ /* No support of Lock control or Memory control in this version */ ”. Then, if we comment out that portion of the code, we can read and write the TAG without problems.
Is this a known problem? It looks strange to us that the driver can’t handle this case, while other systems (e.g., ST25 mobile app) have no issues with the same NFC tag.
Maybe the X-CUBE-NFC5 library is not updated?
Thank you for your support.
Best regards,
Solved! Go to Solution.
2023-07-03 12:35 AM - edited 2023-07-03 04:23 AM
this known limitation of X-CUBE-NFC5 is fixed in STSW-ST25R-LIB ST25 embedded NFC library (STSW-ST25R015): Lock Control TLV and Memory ControlTLV are now managed inside the NDEF Lib of STSW-ST25R015.
"Then, if we comment out that portion of the code, we can read and write the TAG without problems." This will work as long as the NDEF does not collide with Reserved Areas or Dynamic Lock Area. As NTAG213 has no Reserved Area and has a Dyn Lock Area located at the end of the 144 bytes T2T_Area, it should not cause any issue to ignore the Lock Control TLV.
Rgds
BT
2023-07-03 12:35 AM - edited 2023-07-03 04:23 AM
this known limitation of X-CUBE-NFC5 is fixed in STSW-ST25R-LIB ST25 embedded NFC library (STSW-ST25R015): Lock Control TLV and Memory ControlTLV are now managed inside the NDEF Lib of STSW-ST25R015.
"Then, if we comment out that portion of the code, we can read and write the TAG without problems." This will work as long as the NDEF does not collide with Reserved Areas or Dynamic Lock Area. As NTAG213 has no Reserved Area and has a Dyn Lock Area located at the end of the 144 bytes T2T_Area, it should not cause any issue to ignore the Lock Control TLV.
Rgds
BT