{"id":41835098,"url":"https://github.com/androidcrypto/esp32_adafruit_pn532_mifare_desfire_evx_starter_tutorial","last_synced_at":"2026-01-25T09:04:18.902Z","repository":{"id":323160795,"uuid":"1092248975","full_name":"AndroidCrypto/ESP32_Adafruit_PN532_Mifare_DESFire_EVx_Starter_Tutorial","owner":"AndroidCrypto","description":"The starter tutorial explains how to use a Mifare DESFire NFC card on an ESP32 with a connected PN5232 reader.","archived":false,"fork":false,"pushed_at":"2025-11-20T12:45:17.000Z","size":6489,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-20T14:30:53.869Z","etag":null,"topics":["arduino","desfire","desfire-ev1","desfire-ev2","desfire-ev3","esp32","mifare","mifare-desfire","nfc","nfc-card-reader","nfc-reader","pn532","pn532-rfid-module","tutorial","tutorial-code","tutorial-sourcecode"],"latest_commit_sha":null,"homepage":"https://medium.com/@androidcrypto/how-to-work-with-a-mifare-desfire-evx-nfc-tag-on-an-esp32-with-pn532-reader-starter-tutorial-part-c96c4d8fddb8","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndroidCrypto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-08T09:24:56.000Z","updated_at":"2025-11-20T12:45:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AndroidCrypto/ESP32_Adafruit_PN532_Mifare_DESFire_EVx_Starter_Tutorial","commit_stats":null,"previous_names":["androidcrypto/esp32_adafruit_pn532_mifare_desfire_evx_starter_tutorial"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndroidCrypto/ESP32_Adafruit_PN532_Mifare_DESFire_EVx_Starter_Tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndroidCrypto%2FESP32_Adafruit_PN532_Mifare_DESFire_EVx_Starter_Tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndroidCrypto%2FESP32_Adafruit_PN532_Mifare_DESFire_EVx_Starter_Tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndroidCrypto%2FESP32_Adafruit_PN532_Mifare_DESFire_EVx_Starter_Tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndroidCrypto%2FESP32_Adafruit_PN532_Mifare_DESFire_EVx_Starter_Tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndroidCrypto","download_url":"https://codeload.github.com/AndroidCrypto/ESP32_Adafruit_PN532_Mifare_DESFire_EVx_Starter_Tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndroidCrypto%2FESP32_Adafruit_PN532_Mifare_DESFire_EVx_Starter_Tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28750663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T09:00:19.176Z","status":"ssl_error","status_checked_at":"2026-01-25T09:00:04.131Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","desfire","desfire-ev1","desfire-ev2","desfire-ev3","esp32","mifare","mifare-desfire","nfc","nfc-card-reader","nfc-reader","pn532","pn532-rfid-module","tutorial","tutorial-code","tutorial-sourcecode"],"created_at":"2026-01-25T09:03:42.055Z","updated_at":"2026-01-25T09:04:18.891Z","avatar_url":"https://github.com/AndroidCrypto.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32 Adafruit_PN532 Mifare DESFire EVx Starter Tutorial\nThe starter tutorial explains how to use a Mifare DESFire NFC card on an ESP32 with a connected PN5232 reader.\n\nThis is the accompanying repository for my article \"**How to work with a Mifare DESFire EVx NFC tag on an ESP32 with PN532 reader**\" available here: [tutorial part 1](https://medium.com/@androidcrypto/how-to-work-with-a-mifare-desfire-evx-nfc-tag-on-an-esp32-with-pn532-reader-starter-tutorial-part-c96c4d8fddb8) and [tutorial part 2](https://medium.com/@androidcrypto/how-to-work-with-a-mifare-desfire-evx-nfc-tag-on-an-esp32-with-pn532-reader-starter-tutorial-part-7bcfbafd326f)\n\n![Image 6](./images/esp32_s3_dev_pn532_desfire_01_500h.png)\n\n## Important notes about the code\nPlease note: The sketch is just the tutorial code and does not contain any code for displaying any data on a TFT display ! \n\nThe DESFire library contains just the code (commands) needed for the tutorial but not a full implementation of the DESFire EVx commands.\n\n## Required Hardware (NFC Reader)\n\nI'm recommending two NFC readers, but please be aware that I read some negative comments on the \"Red\" PCB one - some seem to have design flaws.\n\n![Image 1](./images/pn532_blue_front_500w.png)\n![Image 2](./images/pn532_blue_back_500w.png)\n\n![Image 3](./images/pn532_red_front_500h.png)\n![Image 4](./images/pn532_red_back_500h.png)\n\n### SPI interface\n\nTo use the **SPI mode** you have to bring the switch in the right position:\n\n![Image 5](./images/pn532_red_blue_switches_400h.png)\n\n````plaintext\n// settings for ESP32 ST7789 1.9-inches TFT display\n#define PN532_SCK (33)\n#define PN532_MOSI (32)\n#define PN532_SS (25)\n#define PN532_MISO (34)\n#define PN532_IRQ (-1)   // not connected\n#define PN532_RESET (-1) // not connected\n// The VCC pin of the reader is connected to the 3.3V pin of the ESP32\n````\n\n````plaintext\n// settings for ESP32-S3 Developmentboard with TFT Display\n#define PN532_SCK (42)\n#define PN532_MOSI (2)\n#define PN532_SS (40)\n#define PN532_MISO (41)\n#define PN532_IRQ (-1)   // not connected\n#define PN532_RESET (-1) // not connected\n// The VCC pin of the reader is connected to the 3.3V pin of the ESP32\n````\n\n## Required Library\n````plaintext\nAdafruit_PN532 by Adafruit version 1.3.4 (https://github.com/adafruit/Adafruit-PN532)\n````\n\n## Documents\n\n### NTAG424DNA documents\ndata sheet Rev. 3.0 — 31 January 2019: https://www.nxp.com/docs/en/data-sheet/NT4H2421Gx.pdf (NT4H2421Gx_NTAG_424_DNA_data_sheet_rev_3_0_2019_01_31.pdf)\n\nFeatures and Hints Application note Rev. 2.0 — 4 March 2025: https://www.nxp.com/docs/en/application-note/AN12196.pdf (AN12196_NTAG424_Features_and_Hints_Rev_2_0_2025_03_04.pdf)\n\n### Mifare DESFire Light documents\n\ndata sheet Rev. 3.3 — 5 April 2019: https://www.nxp.com/docs/en/data-sheet/MF2DLHX0.pdf (MF2DLHX0_MIFARE_DESFire_Light_data_sheet_rev_3_3_2019_04_05.pdf)\n\nFeatures and Hints Application note Rev. 1.1 — 20 January 2020: https://www.nxp.com/docs/en/application-note/AN12343.pdf (AN12343_MIFARE_DESFire_Light_Features_and_Hints_Rev_1_1_2020_01_20.pdf)\n\n### Mifare DESFire EV3 Short data sheet\n\nShort data sheet Rev. 3.1 — 11 January 2024: https://www.nxp.com/docs/en/data-sheet/MF3D_H_X3_SDS.pdf (MF3D_H_X3_SDS_MIFARE_DESFire_EV3_short_data_sheet_Rev_3_1_2024_01_11.pdf)\n\n### Additional documents\n\nMifare DESFire protocol: https://raw.githubusercontent.com/revk/DESFireAES/master/DESFire.pdf (NXP_MIFARE_DESFire_EV1_Protocol.pdf)\n\n### AN12752_MIFARE_DESFire_EV3_feature_and_functionality_comparison\n\nMIFARE DESFire EV3 feature and functionality comparison to other MIFARE DESFire products Rev. 1.4 — 24 July 2023: https://www.nxp.com/docs/en/application-note/AN12752.pdf (AN12752_MIFARE_DESFire_EV3_feature_and_functionality_comparison_Rev_1_4_2023_07_24.pdf)\n\n## Development Environment\n````plaintext\nArduino IDE Version 2.3.6 (Windows)\narduino-esp32 boards Version 3.2.0 (https://github.com/espressif/arduino-esp32)\n````\n\n## Implementations\n\n![Image 7](./images/esp32_1_9_display_pn532_desfire_01_500h.png)\n\n## Log file of the complete tutorial workflow\n````plaintext\nESP32 Adafruit PN532 DESFire Starter V02\nFound chip PN532\nFirmware ver. 1.6\nESP32_DESFire library version: 2\nWaiting for an ISO14443A card\n\nTag number: 1\nFound a card!\n\n-------------------------------------------------------------------------\n T01 Basic Handling\n-------------------------------------------------------------------------\n-------------------------------------------------------------------------\n-------------------------------------------------------------------------\nGet Free Memory\nSend length 5\n 90 6E 00 00 00\nRecv length 5\n 00 14 00 91 00\nSUCCESS\nGetFreeMemory response length 3 data: 00 14 00\n-------------------------------------------------------------------------\nGet Version\nSend length 5\n 90 60 00 00 00\nRecv length 9\n 04 01 01 33 00 18 05 91 AF\nSend length 5\n 90 AF 00 00 00\nRecv length 9\n 04 01 01 03 00 18 05 91 AF\nSend length 5\n 90 AF 00 00 00\nRecv length 16\n 04 35 68 DA 05 1A 90 20 82 62 30 30 34 23 91 00\nSUCCESS\nGetVersion response length 28 data: 04 01 01 33 00 18 05 04 01 01 03 00 18 05 04 35 68 DA 05 1A 90 20 82 62 30 30 34 23\n-------------------------------------------------------------------------\nCreate an Application\nSend length 11\n 90 CA 00 00 05 56 78 9A 0F 85 00\nRecv length 2\n 91 00\nSUCCESS\n-------------------------------------------------------------------------\nCreate a Standard Data file with Free Access Rights\nSend length 13\n 90 CD 00 00 07 01 00 EE EE 20 00 00 00\nRecv length 2\n 91 9D\nPERMISSION_DENIED ERROR\n-------------------------------------------------------------------------\nSelect an Application\nSend length 9\n 90 5A 00 00 03 56 78 9A 00\nRecv length 2\n 91 00\nSUCCESS\n-------------------------------------------------------------------------\nCreate a Standard Data file with Free Access Rights\nSend length 13\n 90 CD 00 00 07 01 00 EE EE 20 00 00 00\nRecv length 2\n 91 00\nSUCCESS\n-------------------------------------------------------------------------\nGet File Settings\nSend length 7\n 90 F5 00 00 01 01 00\nRecv length 9\n 00 00 EE EE 20 00 00 91 00\nSUCCESS\n-------------------------------------------------------------------------\nFile Settings for file 01\nFile Type         : 00 (Standard Data File)\nFile Options      : 00\nFile Comm Mode    : PLAIN\nFile RW/CAR AccRg : EE\nFile R/W    AccRg : EE\nFile Size         : 32\n-------------------------------------------------------------------------\nWrite to a file with Free Access Rights\nGenerated data length 32 data: 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20\nSend length 45\n 90 8D 00 00 27 01 00 00 00 20 00 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 00\nRecv length 2\n 91 00\nSUCCESS\n-------------------------------------------------------------------------\nRead from a file with Free Access Rights\nSend length 13\n 90 BD 00 00 07 01 00 00 00 20 00 00 00\nRecv length 34\n 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 91 00\nSUCCESS\nRead Data response length 32 data: 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20\n-------------------------------------------------------------------------\n T01 Basic Handling END\n-------------------------------------------------------------------------\n\n````\n\n\n![Image 8](./images/esp32_s3_dev_pn532_desfire_02_500w.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroidcrypto%2Fesp32_adafruit_pn532_mifare_desfire_evx_starter_tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandroidcrypto%2Fesp32_adafruit_pn532_mifare_desfire_evx_starter_tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroidcrypto%2Fesp32_adafruit_pn532_mifare_desfire_evx_starter_tutorial/lists"}