2025-07-30 1:10 AM
hi,
I want to implement nfc tag that detect iphone and send message that shoing on iphone screen
have someone that implement this logic?
i start to implement some code and i detect the phone but not received data of APDU command from the phone.have have someone to help me? have code example of this?
Thanks in advance.
2025-07-30 2:13 AM - edited 2025-07-30 2:25 AM
Hi,
Do you mean:
As the title of your post refers to ST25R3916B, do you mean your system is based on a reader in Card Emulation mode?
Feel free to provide more information, such as which tag or which MCU is used or whether Card Emulation is use.
Usually, iPhone reacts when the tag memory contains an NDEF URI message. Using the NFC Tap iOS app, NDEF messages can be written to and read from the tag memory. Once an NDEF message (e.g., containing a URI) is written to the tag memory, you can tap the tag and observe how the iPhone handles it.
If an ST25R3916B is being used in Card Emulation mode rather than a physical tag, the X-CUBE-NFC6 provides a demo that includes Card Emulation. Just enable the DEMO_CARD_EMULATION_ONLY compilation flag. A default URI (st.com) is provided in the emulated memory.
Regards,
BT
2025-07-30 11:08 PM
Hi Brian,
My system is based on a dynamic tag communicating with a microcontroller (MCU) over SPI
the micro is STM32wb55ceu6.
the hardware configuration its ok,
I starter with NFC tag so I not understand clearly what is Card emulation borad.
for our purposes, i know exactly when the error in code:
in rfalNfcWorker process' i received to RFAL_NFC_STATE_LISTEN_ACTIVATION
but there i received RFAL_ERR_LINK_LOSS error after rfalNfcListenActivation().
i see that means that i have problem with ATS parameters but i see that ats in configure automaticly in RfalWoker.
I hope that you understand me...
Thank you very much for your help.
2025-07-31 12:16 AM - edited 2025-07-31 12:33 AM
Hi,
rfalNfcWorker/RFAL_NFC_xxx/rfalWorker/... are related to RF Abstraction Layer for ST25R reader device. This is not related to dynamic tag.
Do you mean a ST25R3916B is connected to a STM32wb55ceu6 and that this ST25R3916B is supposed to act as a tag?
What is your hardware environment: X-NUCLEO-NFC08A1 connected to a P-NUCLEO-WB55 or do you have your own custom board?
Which firmware package have you used for the RFAL: X-CUBE-NFC6 ? ST25R Embedded Lib? Standalone RFAL module?
Rgds
BT
2025-07-31 5:04 AM
Okay, I've made some progress
Right now I'm able to perform the detect iphone but I'm getting to the following point:
rfalIsoDepListenGetActivationStatus always recevid - RFAL_ERR_BUSY or RFAL_ERR_LINK_LOSS
case RFAL_LM_STATE_CARDEMU_4A: /* T4T ISO-DEP activation */
ret = rfalIsoDepListenGetActivationStatus();
if( ret == RFAL_ERR_NONE )
{
gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCA;
gNfcDev.devList->rfInterface = RFAL_NFC_INTERFACE_ISODEP;
gNfcDev.devList->nfcid = NULL;
gNfcDev.devList->nfcidLen = 0;
}
return ( (ret == RFAL_ERR_LINK_LOSS) ? RFAL_ERR_PROTO : ret);
i add the init and descover params:
err = rfalNfcInitialize();
if (err != RFAL_ERR_NONE) {
printf("NFC Initialize failed: %d\r\n", err);
return;
}
// Configure NFC discovery parameters
memset(&discoverParam, 0, sizeof(discoverParam));
// Set discovery parameters
discoverParam.compMode = RFAL_COMPLIANCE_MODE_NFC;
discoverParam.techs2Find |= RFAL_NFC_LISTEN_TECH_A; // Listen for NFC-A readers
discoverParam.totalDuration = 1000; // Discovery duration (ms)
discoverParam.devLimit = 1; // Max devices
discoverParam.wakeupEnabled = false; // No wakeup mode
discoverParam.wakeupConfigDefault = true;
discoverParam.nfcfBR = RFAL_BR_106; // NFC-F bit rate (not used for NFC-A)
discoverParam.ap2pBR = RFAL_BR_106; // P2P bit rate (not used)
// Configure NFC-A listen parameters
discoverParam.lmConfigPA.nfcidLen = TAG_UID_SIZE; // 4-byte UID
memcpy(discoverParam.lmConfigPA.nfcid, tagUID, TAG_UID_SIZE);
discoverParam.lmConfigPA.SENS_RES[0] = 0x02; // Your working values
discoverParam.lmConfigPA.SENS_RES[1] = 0x00;
discoverParam.lmConfigPA.SEL_RES = 0x20; // ISO14443-4 compliant
// Start NFC discovery in listen mode
err = rfalNfcDiscover(&discoverParam);
i ask Ai and searh my mistake but no successfuly.
2025-07-31 5:58 AM - edited 2025-07-31 6:00 AM
Hi,
I assume your application uses the ST25R3916B reader operating in card emulation mode, which emulates a tag.
The X-CUBE-NFC6 package includes a ready-to-use demonstration supporting card emulation mode. Refer to the demo_polling.c
and demo_ce.c
files. I recommend using this demonstration for your application. Enable the DEMO_CARD_EMULATION_ONLY
compilation flag to activate this mode. A default URI (st.com
) is provided in the emulated memory. Using an existing proven demo is better than asking AI.
Regards
BT
2025-07-31 5:59 AM
hi, i have own custom borad, i have RFAL 3.0.0 library
2025-08-10 12:37 AM
Hi Brian,
i see the X-CUBE-NFC6 package
i take the main logic and configuration.
at now i success to activated and i also receveid SELECT command from iphone.
but when i send 0x90 0x00 to return success status i recived error RFAL_ERR_LINK_LOSS
Do you have any idea why sending back to iPhone is not successful?
2025-08-12 11:57 PM
Hi Brian,
I add prints for debug and i see that Auxiliary display register value indicates that my device in rx mode and not in tranceive mode.
rx_on bit is 1
and tx_on is 0.
i need to do somthing to change state between i wait for received command from iphon to send response?
2025-08-20 7:40 AM
Hi,
receiving a LINK_LOSS typically means the other side has run into a time-out and given up. Please look into the timing - also remove any prints from your software running the card emulation. Better to debug using a logic analyzer which does not influence the timings and provides information on the timing. A possibility to buy more time might be to increase FWI in ATS.
If this still does not help then please feel free to provide a logic analyzer trace of your application here (SPI signals + IRQ).
BR, Ulysses