cancel
Showing results for 
Search instead for 
Did you mean: 

NFC Tap app transfer data using the FTM mailbox feature

NDvas.3
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
France Berthelot
ST Employee

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

View solution in original post

10 REPLIES 10
Olivier L
ST Employee

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.3
Associate III

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

Olivier L
ST Employee

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.3
Associate III

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.3
Associate III

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.3
Associate III

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?

France Berthelot
ST Employee

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

France Berthelot
ST Employee

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.3
Associate III

Thank you France,

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

Nir