5.10.2. MIFARE DESFire EV2 : Prepare MFDFEV2

Warning

To run this example, you would need the nxpnfcrdlib component for which a Non-Disclosure Agreement(NDA) needs to be signed. Please contact your FAE for additional details.

5.10.2.1. Prerequisites

5.10.2.2. About the Example

This is an example project for preparing the MIFARE DESFire EV2 card for running other SE05x MIFARE DESFire EV2 examples.This example formats the card creates app, keys and file for running the other examples.

This does not make use of any SE05X APIs. It make use of nxpNfcrdLib apis for:

  • formatting the card

  • Creating an AFC application

  • Selecting the application

  • Creating a value file

5.10.2.3. Creation of application

creation of application with application ID happens in API phEx_Personalize_AFCApp():

The application ID is

uint8_t bAfcApp[3] = {0x11, 0x22, 0x33};

5.10.2.4. AES Keys provisioned in card

We create One key in the card, This key is set when we are creating the transaction mac file. The key value is

uint8_t bTMKey[16] = {  0x00, 0x00, 0x00, 0x00,
                        0x00, 0x00, 0x00, 0x00,
                        0x00, 0x00, 0x00, 0x00,
                        0x00, 0x00, 0x00, 0x00 };

5.10.2.5. Running the Demo

  1. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo

If everything is setup correctly the output would be as follows:

App   :INFO :PlugAndTrust_v03.03.01_20210923
sss   :INFO :atr (Len=35)
                01 A0 00 00     03 96 04 03     E8 00 FE 02     0B 03 E8 00
                01 00 00 00     00 64 13 88     0A 00 65 53     45 30 35 31
                00 00 00
sss   :WARN :Communication channel is Plain.
sss   :WARN :!!!Not recommended for production use.!!!
App   :INFO :Sleeping for 10 seconds for debugger stabilization
App   :INFO :UID after L3 Activation (Len=10)
                08 63 DC 14     00 00 00 00     00 00
App   :INFO :ATS after L4 Activation (Len=6)
                06 75 77 81     02 80
App   :INFO :Performing Pre Personalization ......

App   :INFO :Formating the card Successful

App   :INFO :bCardUid[0] = 0x4

App   :INFO :bCardUid[1] = 0x41

App   :INFO :bCardUid[2] = 0x65

App   :INFO :bCardUid[3] = 0x7a

App   :INFO :bCardUid[4] = 0x6e

App   :INFO :bCardUid[5] = 0x4d

App   :INFO :bCardUid[6] = 0x80

App   :INFO :bCardUid[7] = 0x0

App   :INFO :bCardUid[8] = 0x0

App   :INFO :bCardUid[9] = 0x0

App   :INFO :Create AFC Application Successful

App   :INFO :Select the AFC Application Successful

App   :INFO :phEx_Create_ValueFile...

App   :INFO : create Transaction MAC File  Successful

App   :INFO : create Value File  Successful

App   :INFO :***** Creating standard data file SUCCESS!!*******

App   :INFO :ex_sss Finished