fix(nfc): align Type 2 ATQA with UID

This commit is contained in:
chenjintao
2026-09-22 16:15:09 +08:00
parent 3185d8f5e3
commit 5645a0a36b
@@ -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;