This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Implementing Mifare Ultralight C Read function after authentication.

Other Parts Discussed in Thread: TRF7970A

I want to read blocks of Mifare Ultralight C tags. 

After the successful authentication of the card, I have to read the blocks. But I don't get any response for the read command. Please suggest steps to be followed for read operation after authenticating the card.

Thank you,

Aparna

  • Hello Aparma,

    The Read Block command for T2T tags is :

    0x30 (Read Command) 0x00 (block number) CRC-A 

    Therefore the packet you send to the TRF7970A is:

    0x8F // Reset FIFO
    0x91 // Transmission with CRC
    0x3D // Continuous Write starting with TX Length 1
    0x00 // TX Length 1
    0x20 // TX Length 2
    0x30 // Read Command
    0xhh // Block Number

    Block 0-3 the serial number, Block 3 is OTP, and Blocks 4-39 are the user memory.

    Hope this helps!

    Best regards,

    Erick

  • After authentication, I am not able to read/write at all. 





  • what is status of pages/blocks 0x2A (AUTH0 config) and 0x2B (AUTH1 config) and which pages/blocks are you attempting to read now?

    note that if you have not changed AUTH0 config byte then i don't think you can read blocks 03-30 in AUTH state, but you should be able to read them in the clear.

    see note on page 9 (section 7.2.6) and then section 7.5.8 (page 18) ==>   

  • I have given AUTH0 as 0x23 and AUTH1 as 0x30. 

    So from 23h to 30h blocks I can neither write nor read. 

    The problem is I tried the following sequence for authentication and read. Authentication happens successfully, but read gives back no response.

     authCmd1[20] = {0x30, 0x31, 0x30, 0x41, 0x30, 0x30, 0x30, 0x33, 0x30, 0x34, 0x31, 0x38, 0x31, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30,0x30};
    authCmd2[51] = {0x30, 0x31, 0x31, 0x39, 0x30, 0x30, 0x30, 0x33, 0x30, 0x34, 0x31, 0x38, 0x41, 0x46, 0x30, 0x30, 0x30, 0x30, 0x30,0x30};    // auth is appended with ek(RndA + RndB') later dynamically

    UARTSend_NFC(authCmd1,20);  //  1A command
    UARTSend_NFC(authCmd2,51); // AF command

     UARTSend_NFC(set_iso14443a,24);
    UARTSend_NFC(reqA,18);
    UARTSend_NFC(readBlock ,20);       //30 read command

  • While debugging I found that after authentication once read command is sent, i_reg value in HostRequestCommand() is 0x00 hence timeout is happening.

    Can you please suggest something to overcome this issue?
    I am sending read immediately after sending Auth AF command.

    Thank you,
    Vishal