cancel
Showing results for 
Search instead for 
Did you mean: 

Emulate NDEF tag ESP32

Baptcallo
Associate II

Hello,

I’m working with an ST25R3916 and an ESP32-S3. I ported the RFAL library to the ESP32 (platform.c), and it works — I can successfully read a tag with this setup.
However, I’m struggling to emulate a tag in order to send an NDEF message.

Does anyone know where I could find an example implementation for this?

For more context: when I enable tag emulation, my reader correctly detects the programmed UID, but I can’t manage to retrieve the NDEF.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi,

in Card Emulation, the ST25R3916 hardware handles automatic replies to anticollision frames. Once the Card Emulation is ready for upper layer communication (i.e. once the remote reader has retrieved the Card Emulation UID), the replies to remote commands are handled by the FW. The typical first message being received is RATS where the FW has to reply in less than 5ms. Could you make sure your port to ESP32 schedule the demo_cycle as a dense loop to be able to reply to RATS in less than 5ms?

Also I suggest to enable the DEMO_CARD_EMULATION_ONLY compilation flag.

Printf-like debugging/logging can as well delay the reply to the RATS.

Rgds

BT

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Brian TIDAL
ST Employee

Hi Baptiste,

An example of Card Emulation code is available in the pairing demo of the  ST25 Embedded Library. The X-CUBE-NFC6 also includes Card emulation demo. 

See demo_polling.c and demo_ce.c files in those packages.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Baptcallo
Associate II

Hi,

Thanks for your reply,

I tested with the two files (demo_ce.c and demo_polling.c), but unfortunately it still doesn’t work. With these demos, when I present a tag, it is detected properly. However, when I present a reader (tested with a Flipper Zero and several smartphones), the best I get is the UID — I never receive the NDEF message.

I’ve been stuck on this issue for several weeks now. Could this be related to a hardware problem (custom board), or since I can already read a tag and emulate a UID, does it rather suggest a software issue?

 

 

Brian TIDAL
ST Employee

Hi,

in Card Emulation, the ST25R3916 hardware handles automatic replies to anticollision frames. Once the Card Emulation is ready for upper layer communication (i.e. once the remote reader has retrieved the Card Emulation UID), the replies to remote commands are handled by the FW. The typical first message being received is RATS where the FW has to reply in less than 5ms. Could you make sure your port to ESP32 schedule the demo_cycle as a dense loop to be able to reply to RATS in less than 5ms?

Also I suggest to enable the DEMO_CARD_EMULATION_ONLY compilation flag.

Printf-like debugging/logging can as well delay the reply to the RATS.

Rgds

BT

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I had a 10 ms delay in the demo_cycle, I changed it to 1 ms and now it works.

Thank you so much !