From 5645a0a36b9d4096f70b4439927747415a05c77a Mon Sep 17 00:00:00 2001 From: chenjintao Date: Tue, 22 Sep 2026 16:15:09 +0800 Subject: [PATCH] fix(nfc): align Type 2 ATQA with UID --- ql-application/threadx/interface/custom_app/nfc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ql-application/threadx/interface/custom_app/nfc.c b/ql-application/threadx/interface/custom_app/nfc.c index 1d3e2fa..ad76d95 100644 --- a/ql-application/threadx/interface/custom_app/nfc.c +++ b/ql-application/threadx/interface/custom_app/nfc.c @@ -214,7 +214,7 @@ static void nfc_type2_read_pages(u8 start_page, u8 *response) static void nfc_card_emulation_configure_type2(void) { static const u8 card_config[] = { - 0x44, 0x00, /* SENS_RES / ATQA */ + 0x04, 0x00, /* ATQA: single-size (4-byte) UID */ 0xAA, 0xBB, 0xCC, /* NFCID1; first byte 08 is added by PN512 */ 0x00, /* SEL_RES / SAK: Type 2, no ISO-DEP */ 0x01, 0xFE, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, @@ -241,7 +241,7 @@ static void nfc_card_emulation_start(void) nfc_type2_build_ndef(); nfc_card_emulation_configure_type2(); nfc_card_emulation_log_status("started"); - printf("NFC Type 2 tag: ATQA=44 00, UID=08 AA BB CC, SAK=00\r\n"); + printf("NFC Type 2 tag: ATQA=04 00, UID=08 AA BB CC, SAK=00\r\n"); } static void nfc_card_emulation_task(void) @@ -274,6 +274,8 @@ static void nfc_card_emulation_task(void) break; } printf("NFC Type 2 READ page %u TX complete\r\n", frame[1]); + nfc_card_emulation_log_frame("Type 2 READ TX", response, + sizeof(response)); DP1312EA_WriteRawRC(ComIrqReg, NFC_IRQ_TX); for (poll_count = 0;