2020-06-30 11:41 PM
Hi, I am using X-NUCLEO-NFC03A1 and NXP NTAG213 Mifare Ultralight. I chose this kind of TAG because they can be protected by password. I downloaded all files like user manual, etc... about NFC03A1 but I couldn't find any informtion about password writing and reading a tag using a password so I suspect that maybe this shield is not totally compatible with NTAG213....
Also, I used the bin file "STM32F401RE_NUCLEO_PollingTagDetectNdef" but alwasy I get this response from serial:
1. Tap a tag to read its content
ISO14443A/NFC-A card found. UID: 044153A26F5E81
NDEF NOT DETECTED (ndefPollerNdefDetect returns 5)
Operation completed
Tag can be removed from the field
but my tag should support NDEF.
p.s. I am using a NUCLEO-F401RE board
Solved! Go to Solution.
2020-07-10 07:35 AM
Hi,
this is more a question for the tag manufacturer than for the reader manufacturer. I believe the password is valid until the field is removed andpassword verification t should be done before the read/write accesses. Feel free to contact the tag manufacturer or check inside the datasheet of the tag.
your rfalT2TPollerPWD_AUTH looks in good shape.You need a local buffer large enough for command response (PACK) and pass it in the rfalTransceiveBlockingTxRx as the rxBuff. I would suggest
uint8_t res[PACK_SIZE];
and
ret = rfalTransceiveBlockingTxRx( (uint8_t*)&req, sizeof(rfalT2TAuthReq), &res, sizeof(res), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_FDT_POLL_PWD_AUTH_MAX );
Rgds
BT
2020-07-01 02:15 AM
Hi,
X-CUBE-NFC3 2.1.0 supports NFC Type 2 tag.
Password protection is not an NFC Type 2 feature but a proprietary feature. See table 22 in the datasheet of this tag: PWD_AUTH (1Bh) is neither an ISO/IEC 14443 command nor a NFC Forum command. This proprietary command is not implemented in X-CUBE-NFC3 2.1.0. Anyway if you want to use it, you just need to format the PWD_AUTH message into a buffer and send it through rfalTransceiveBlockingTxRx(). See rfal_t2t.c for some example of rfalTransceiveBlockingTxRx usage for type 2 tags.
Regarding the NDEF detection issue: this tag has a default Lock Control TLV in block 4 (see Table 5 in the tag datasheet). X-CUBE-NFC3 2.1.0 does not implement the support of DynLock_Area and therefore, returns an error during NDEF detection procedure when encountering a Lock Control TLV .
This can be solved in different ways:
Rgds
BT
2020-07-09 07:44 PM
Hi,
thanks to your answer I solved the NDEF detection issue using an Android APP.
Now I'm trying to figure out how to write some data in a password protected NTAG213. I can set the password and set AUTH0 to 0x04 using the Android APP that is able to set automaticaly AUTH0 = 4 after a password setting.
I have also created a function (under your guidelines) in "rfal_t2t.c" using function "rfalTransceiveBlockingTxRx()". Here the code:
ReturnCode rfalT2TPollerPWD_AUTH(const uint8_t* PWD )
{
platformLog("_______INIZIO POLLER PWD_AUTH______\r\n");
ReturnCode ret;
rfalT2TAuthReq req;
uint8_t res;
uint16_t rxLen;
req.code = (uint8_t)RFAL_T2T_CMD_PWD_AUTH;
ST_MEMCPY(req.data, PWD, RFAL_T2T_WRITE_DATA_LEN);
/* Transceive WRITE Command */
ret = rfalTransceiveBlockingTxRx( (uint8_t*)&req, sizeof(rfalT2TAuthReq), &res, sizeof(uint8_t), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_FDT_POLL_PWD_AUTH_MAX );
//TODO /* Check for a valid PACK */
ret = ERR_NONE; //TEMPORARY. remove it after validation PACK function
platformLog("_______FINE POLLER PWD_AUTH______\r\n");
return ret;
}
I believe I should set the rfalTransceiveBlockingTxRx() like the following
ret = rfalTransceiveBlockingTxRx( (uint8_t*)&req, sizeof(rfalT2TReadReq), rxBuf, rxBufLen, rcvLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_FDT_POLL_READ_MAX );
in order to check the PACK consequently and maybe you can help me for that....
Anyway, my bigger dubt actually is: in order to use the password protection, and PWD_AUTH command of course, to read and write the TAG, should I use NDEF formatted TAG also for the authentication message?
How should I treat the authentication message? Should I append write or read record after it? Or maybe the authentication remains valid until the TAG is removed from the reader field so that I can write and read in messages separated from the authentication one?
BR
Simone
2020-07-10 07:16 AM
maybe I should have post an answer instead of a reply...
2020-07-10 07:35 AM
Hi,
this is more a question for the tag manufacturer than for the reader manufacturer. I believe the password is valid until the field is removed andpassword verification t should be done before the read/write accesses. Feel free to contact the tag manufacturer or check inside the datasheet of the tag.
your rfalT2TPollerPWD_AUTH looks in good shape.You need a local buffer large enough for command response (PACK) and pass it in the rfalTransceiveBlockingTxRx as the rxBuff. I would suggest
uint8_t res[PACK_SIZE];
and
ret = rfalTransceiveBlockingTxRx( (uint8_t*)&req, sizeof(rfalT2TAuthReq), &res, sizeof(res), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_FDT_POLL_PWD_AUTH_MAX );
Rgds
BT