Forum / MIFARE SDK / NTAG213 Tranceive error and TAG lost exception seen
Tagged: ntag213
-
Hi Support,
I want to make user memory access read/write password protected,
MY FIRST SET OF STEPS DONE,
STEP 1 :
`((INTag213215216) tag).readSignature();
((INTag213215216) tag).enableCounter(true);
((INTag213215216) tag).counterRead());
((INTag213215216) tag).read(tag.getFirstUserpage());
((INTag213215216) tag).setMemProtectionAndPwdVerificationForReadWriteAccess((byte)tag.getFirstUserpage(),true);
byte[] pass = { (byte)0x20, (byte)0x34, (byte)0x65, (byte)0x87 };
byte[] pack = { (byte)0xA9, (byte)0xCB };
Log.i(TAG,"authenticatePwd called : ");
((INTag213215216) tag).authenticatePwd(pass, pack);
RESULT -> THIS GAVE ME TAG LOST EXCEPTION !!
STEP 2:
`((INTag213215216) tag).setMemProtectionAndPwdVerificationForReadWriteAccess((byte) 0xFF, true);
I AM TRYING TO DISABLE THE AUTH,
RESULT -> com.nxp.nfclib.exceptions.NxpNfcLibException: Transceive failed
2020-10-01 11:16:02.956 26989-26989/com.example.desfiresdklogic W/System.err: com.nxp.nfclib.exceptions.NxpNfcLibException: Transceive failed
2020-10-01 11:16:02.956 26989-26989/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.NfcAReader.transceive(:71)
2020-10-01 11:16:02.957 26989-26989/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.AndroidApduHandler.apduExchange(:42)
2020-10-01 11:16:02.957 26989-26989/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.ntag.AbstractNTag.Ž(:197)
2020-10-01 11:16:02.957 26989-26989/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.ntag.AbstractNTag.?(:403)
2020-10-01 11:16:02.957 26989-26989/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.ntag.NTag213215216.setMemProtectionAndPwdVerificationForReadWriteAccess(:554)
STEP3 :
`((INTag213215216) tag).programPWDPack(pass,pack);
// As per the spec we need to set AUTH0 to 2bh
((INTag213215216) tag).setMemProtectionAndPwdVerificationForReadWriteAccess((byte) 0x2b, true);
RESULT -> com.nxp.nfclib.exceptions.NxpNfcLibException: Transceive failed
com.nxp.nfclib.exceptions.NxpNfcLibException: Transceive failed
2020-10-01 14:25:44.646 5351-5351/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.NfcAReader.transceive(:71)
2020-10-01 14:25:44.646 5351-5351/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.AndroidApduHandler.apduExchange(:42)
2020-10-01 14:25:44.647 5351-5351/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.ntag.AbstractNTag.Ž(:197)
2020-10-01 14:25:44.647 5351-5351/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.ntag.NTag210.`(:413)
2020-10-01 14:25:44.647 5351-5351/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.ntag.AbstractNTag.?(:621)
2020-10-01 14:25:44.647 5351-5351/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.ntag.NTag210.programPWDPack(:207)
Regards,
Anitha
+ 0 | - 0
Hi Anitha,
The NTAG213 is a tag using ISO14443-3 protocol. If something went wrong even a unsuccessful authentication, the tag goes into an error state and terminate any communication with the reader. This is detected on reader side as “TAG LOST”. In your reader software you must handle the case TAG LOST as error symptom.
The TapLinx team
+ 0 | - 0
Thanks for the reply.
I shall check on TAG LOST exception, hoping I have not programmed the password and I had called the authentication API, assuming this can be the reason.
Can you please look into the major error I am facing that is Transceive failed exception ,
When trying to programPWDPack or disabling the password protection I get this exception.(MORE DETAILS ABOVE )
All APIs used are just straight forward, unable to understand why this error is thrown, not much documentation found, also underlying code not available to debug further?
Any sample code etc will be of great help to debug further.
Thanks in advance.
Regards,
Anitha
+ 0 | - 0
Hi Anitha,
The TapLinx layer for the NTAG devices is quite thin. It reflects the registers which are listed in the datasheet:
https://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf
It is a good idea to take the datasheet as first reference to verify your configuration. The password verification is explained in section 8.8 on page 30 of the datasheet.
The TapLinx team
+ 0 | - 0
Thank you, I tried in the new card and certain sequence of steps of above apis worked as referred from datasheet,
However just one Api call failed.
I tried calling,
public interface INTag213215216
enableCounter(boolean isEnable) -> Enables the NFC counter.
called as enableCounter(true);
But I am getting this error,
W/System.err: com.nxp.nfclib.exceptions.NxpNfcLibException: Transceive failed
2020-10-15 13:30:58.908 30551-30551/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.NfcAReader.transceive(:71)
2020-10-15 13:30:58.908 30551-30551/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.AndroidApduHandler.apduExchange(:42)
2020-10-15 13:30:58.908 30551-30551/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.ntag.AbstractNTag.Ž(:197)
2020-10-15 13:30:58.908 30551-30551/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.ntag.AbstractNTag.?(:403)
2020-10-15 13:30:58.908 30551-30551/com.example.desfiresdklogic W/System.err: at com.nxp.nfclib.ntag.NTag213215216.enableCounter(:374)
Referred to datasheet 8.5.7,
NFC_CNT_EN -> If the NFC counter is enabled, the NFC counter will be automatically increased at the first READ or FAST_READ command after a power on reset
But unable to understand why this error is thrown for this API.
Can you please help me getting some insights what could be wrong with this?
Regards,
Anitha
+ 0 | - 0
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.