Skip to main content
MDinn
Associate II
February 28, 2020
Solved

APDU for UID (MIFARE 1K CLASSIC) no response

  • February 28, 2020
  • 2 replies
  • 3354 views

Hi,

We are testing the ST25R3916 to read Mifare 1K classic UID's.

We manage to initialize the chip and to send an REQA command (We get 00 04 back from the card so communication works!).

But we need to know the UID.

To do this I found the APDU command:

Class = 0xFF

INS = 0xCA

P1 = 0x00

P2 = 0x00

Le = 0x00

So following the datasheet we do this:

  • Clear FIFO (0xDB)
  • Write Define the number of transmitted bytes in 2 registers.
    • This is not 100% clear
    • The APDU has 5 bytes so we do this?
      • Number of transmitted bytes register 1: 0x00
      • Number of transmitted bytes register 2: 0x28
  • Then we write the 5 bytes to the FIFO:
    • i2c tx: 0x80 (FIFO write) 0xFF 0xCA 0x00 0x00 0x00
  • Then send With CRC => 0xC4
  • We get interrupt that TX happened but no response from the chip while REQA works fine

What could we be doing wrong?

Thx for any help,

Marvin

    This topic has been closed for replies.
    Best answer by Ulysses HERNIOSUS

    Hi Marvin,

    If it is a Mifare Classic 1K tag then no APDUs or even ISO14443-A layer4 are supported. Mifare Classic will require proprietary cryptography to read/write data.

    To get the UID of ISO14443-3 type A tags (including Mifare Classic) you need to perform so called anticollision which starts with first command 93 20 (no CRC used!). Please refer to ISO14443-3 or NFC Forum Digital.

    I would however go the easy way and use NUCLEO-L476 + X-NUCLEO-NFC05A + X-CUBE-NFC5 which implements and show cases all the needed procedures.

    Regards, Ulysses

    2 replies

    Ulysses HERNIOSUS
    ST Technical Moderator
    February 28, 2020

    Hi Marvin,

    If it is a Mifare Classic 1K tag then no APDUs or even ISO14443-A layer4 are supported. Mifare Classic will require proprietary cryptography to read/write data.

    To get the UID of ISO14443-3 type A tags (including Mifare Classic) you need to perform so called anticollision which starts with first command 93 20 (no CRC used!). Please refer to ISO14443-3 or NFC Forum Digital.

    I would however go the easy way and use NUCLEO-L476 + X-NUCLEO-NFC05A + X-CUBE-NFC5 which implements and show cases all the needed procedures.

    Regards, Ulysses

    MDinn
    MDinnAuthor
    Associate II
    February 28, 2020

    Thank you so much 0x93 0x20 works perfect!!!