cancel
Showing results for 
Search instead for 
Did you mean: 

NFC - ST25R3916B - create tag applicatiion

aviel
Associate II

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.

9 REPLIES 9
Brian TIDAL
ST Employee

Hi,

Do you mean:

  • Your system is based on a dynamic tag communicating with a microcontroller (MCU) over I²C.
  • Your system is woken up when entering the phone's NFC field, that is, your system is powered by the harvested energy.
  • Reading the tag by the phone triggers an action on the phone.

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

 

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.

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.

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

 

 

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.

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.


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

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.

hi, i have own custom borad, i have RFAL 3.0.0 library

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?

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?

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