Skip to main content
Visitor II
August 16, 2022
Solved

NFC Tap app transfer data using the FTM mailbox feature

  • August 16, 2022
  • 10 replies
  • 3303 views

Hey Guys,

I am trying to use the NFC Tap app to transfer data to an ST25DV device I have here, using the FTM mailbox feature.

Mailbox is enabled. I get an error message from the App saying the send had failed.

General question: When the App sends over the data to the device, do I have to read it in that moment or in fact, do I have to do anything at all or does the ST25 takes care of this for me and I just need to know when the transfer is over and read the mailbox's content?

If there is someone here who is working with this and can shade some light on this for me it would be great.

Thank you,

Nir

    This topic has been closed for replies.
    Best answer by France Berthelot

    Hello

    From these links, you can get sources and retrieve FTM examples and functions call

    https://www.st.com/en/embedded-software/stsw-st25ios001.html

    https://www.st.com/en/embedded-software/stsw-st25001.html

    Mailbox is enabled. I get an error message from the App saying the send had failed. è Have a look to the Mailbox status register (available on iOS/Android app) , it will indicate mailbox status, mailbox written by uRF or Serial interface or Msg missed by RF, …This will give you some more informations regarding failure.

    General question:  You need to manage synchronization between RF/Serial in order to write from RF, read from serial, write from RF, read from Serial and so on until end of data to be transferred.

    Our SDK, used in iOS/Android app take care of this for you and FW provided on our discovery kit did it too.

    Regards,FB

    10 replies

    ST Employee
    August 17, 2022

    Hi Nir,

    Are you using Android or iOS ST25 NFC Tap App?

    Is you ST25DV connected to an MCU and is it powered? These 2 things are mandatory to use the FTM feature.

    Then, from a software point of view, if you use the ST25SDK library, the fast transfer mode usage will be very easy because the library will take care of everything for you. You will have an explicit API where you can pass a byte array of any size. The library will take care of sending everything through FTM and will check for errors (in case of errors, retransmission will occur). The source code of Android and iOS ST25 NFC Tap apps is provided. You can have a look to the calls to this API function of ST25SDK:

    public byte[] sendCmdAndWaitForCompletion(byte cmdId, byte[] data, boolean isErrorControlNeeded, boolean isResponseExpected, TransferProgressionListener transferProgressionListener, int timeOutInMs) throws STException, InterruptedException;

    Best regards

    Olivier

    NDvas.3Author
    Visitor II
    August 17, 2022

    Hey Oliver and thank you.

    Yes, I am using the NFT Tap app on my iPhone so it is iOS. Yes, the ST25DV is powered and connected to an MCU.

    Let me clarify my question: I was asking not about the App side but about the hardware side - beside from enabling the mailbox on the ST25DV, do I need to write any other code on the ST25DV so that the App can write to the mailbox?

    Nir

    ST Employee
    August 17, 2022

    The FTM feature is a RAM of 256 bytes present in the ST25DV. It is controlled by a set of registers (you will find the description in the datasheet):

    • MB_MODE
    • MB_WDG
    • MB_CTRL_Dyn
    • MB_LEN_Dyn

    MB_CTRL_Dyn is the most important one because this is the status register that will tell to the smartphone or to the MCU that some data is available and also indicates if the data has been read.

    So basically a transmission is done through a sequence like this:

    • fill the MB will some data
    • wait that the recipient has read the data
    • fill some more data

    Regards

    Olivier

    NDvas.3Author
    Visitor II
    August 17, 2022

    Hey Olivier,

    Thank you. The problem I am facing is that for some reason, I can not get to transfer data

    from the phone to the device. When using the "FTM - Data Transfer" screen, I am typing a few letters in, pressing "Start" and attaching the phone to the IC's antenna, I get a message on the app that a few bytes were transmitted but none were acknowledged and then I get a "Upload failed...." message.

    On the IC side, I do not get the RF_PUT_MSG of the MB_CTRL_Dyn to be set.

    What am I missing here or doing wrong?

    Thank you,

    Nir.

    NDvas.3Author
    Visitor II
    August 18, 2022

    Hey Olivier,,

    Would really love to hear back from you on this. BTW, the IC I am working on is the ST25DV04K (and not the C version) hope it does not matter much.

    Nir.

    NDvas.3Author
    Visitor II
    August 19, 2022

    Sorry but it just occurred to me: I am running the NFC Tap on an iPhone SE (iOS version 15.6) - does it support the MB feature?

    ST Employee
    August 22, 2022

    Hello

    From these links, you can get sources and retrieve FTM examples and functions call

    https://www.st.com/en/embedded-software/stsw-st25ios001.html

    https://www.st.com/en/embedded-software/stsw-st25001.html

    Mailbox is enabled. I get an error message from the App saying the send had failed. è Have a look to the Mailbox status register (available on iOS/Android app) , it will indicate mailbox status, mailbox written by uRF or Serial interface or Msg missed by RF, …This will give you some more informations regarding failure.

    General question:  You need to manage synchronization between RF/Serial in order to write from RF, read from serial, write from RF, read from Serial and so on until end of data to be transferred.

    Our SDK, used in iOS/Android app take care of this for you and FW provided on our discovery kit did it too.

    Regards,FB

    ST Employee
    August 22, 2022

    Hello

    Sorry, i forget to put link for FW side : https://www.st.com/content/st_com/en/products/embedded-software/st25-nfc-rfid-software/stsw-st25dv001.html

    Apologize

    Reminder: both side, Phone and board FW need to be aligned (same protocol...) otherwise exchange will probably fail, du to the fact that one side did not read and free mailbox after a write for an other write ....

    Regards,FB

    NDvas.3Author
    Visitor II
    August 23, 2022

    Thank you France,

    One last question: Will the MB feature work on an iPhone SE? (iOS version 15.6)

    Nir

    ST Employee
    August 23, 2022

    Hello

    There is several SE generations, if NFC is available not only for Payment , the answer is yes. If you can R/W tag , MB features should work too.

    FB