Hello everyone!
I try to write to the NDEF file of a NTAG 424 with ISOUpdateBinary using the NFC Tools Android app. I keep getting the error "Wrong or inconsistent APDU length.":
PCD → PICC | 00:A4:00:00:02:E1:10:00 | Select DF |
PICC → PCD | 90:00 | Success response |
PCD → PICC | 00:A4:02:00:02:E1:04:00 | Select the NDEF file |
PICC → PCD | 90:00 | Success response |
PCD → PICC | 00:D6:00:00:02:AB:CD:00 | Write "AB:CD" into the currently selected file |
PICC → PCD | 67:00 | Error "Wrong or inconsistent APDU length." |
Reading with ISOReadBinary works fine. I have write permissions and the communication mode should be plain. I have the feeling that I make a small mistake, but couldn't figure it out yet. Thanks in advance for every help!
Hi @zahnom,
The command "ISOUpdateBinary" is described by chapter 10.2 (Supported commands and APDUs) under the NTAG 424's Datasheet as follows:
CLA |
INS |
P1 |
P2 |
Lc |
Data |
Le |
Data |
00 |
D6 |
XX |
XX |
XX |
Data to write |
- |
- |
Where "-" signifies to not fill the parameter and "XX" is dependent on the command. The full description of the command is located in chapter 10.9.3 (ISOUpdateBinary).
It seems you are writing into the "Le" parameter after Data. Please help me confirm you are filling the command following the documentation. Try writing the command without the last byte.
CLA |
INS |
P1 |
P2 |
Lc |
Data |
Le |
Data |
00 |
D6 |
00 |
00 |
02 |
ABCD |
- |
- |
Unfortunately, I cannot deepen into much more details, but as the information of this product is under NDA (Non-Disclosure Agreement), the information is not public, and this is not a secure channel to share any information of this device.
Best regards,
Julián.
Julián,
I feel I should bring to your attention that in the 424 DNA Application Note, the example shown for ISOUpdateBinary (https://www.nxp.com/docs/en/application-note/AN12196.pdf?page=32) does include "Le" which is misleading. I was trying to follow the example and was getting the same error as OP. This cost me quite a bit of time.