This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TRF7970A: Card Emulation vs P2P mode for large data transfer

Part Number: TRF7970A

Hello,

I have below questions.

  • Using card Emulation mode, What is the max data size that can be transmitted in one packet? Intention is to transmit 20kB of data. How this can be done ? Any sw examples to refer ? Or Would peer-to-peer mode work better for 20kB data transfer? 
  • Card Emulation mode support Android and iOS both ? or again there is a need to consider peer-to-peer mode?

Any pointers would help.

Thanks, Jasraj

  • Hello Jasraj,

    I have to check that with a colleague and will come back to you the next days.

    Best Regards,

    Helfied

  • Hello Jasraj,

    Packet size is limited to 254 bytes if I remember right - that would be based on NDEF specifications.

    Or Would peer-to-peer mode work better for 20kB data transfer? 

    From our testing, P2P has been at least 2x faster than Card Emulation due to reduced overhead. However both modes are viable.

    How this can be done ? Any sw examples to refer ?

    Our software for Card Emulation is a good starting point and the app note includes metrics (albeit very dated) for a 20kB file transfer using this software: https://www.ti.com/lit/pdf/sloa208

    Card Emulation mode support Android and iOS both ?

    Yes, though I am not familiar with what iOS apps support this kind of functionality of a large data file transfer. Back in 2014-2015 there was very limited support for Android on this and while that expanded I am not sure what iOS has for testing with such large file transfers. Though it probably is easier to find that for Card Emulation than Peer-to-Peer.

  • Hello Ralph Jacobi,

         Thank for the response.

    1.    @Ralph : Packet size is limited to 254 bytes if I remember right - that would be based on NDEF specifications.

           As per TRF7970A, data sheet, the controller has 127 bytes of FIFO, so at a time only 127 bytes of Packet can be Tx or RX.
          So how we can achieve 254 bytes of Packet Size.


    2.   Also when i try, the Card Emulation mode with android application i.e. "NFC Tool", getting error while writing Data bytes more than 100.

    3.   Can it be possible to share a sample code, where it have handle the data bytes up to 20kBytes. (i.e. Multiple packets)

    4.   Along with the actual data, there are few more bytes are been written from Android application, can you please provide the significant of it.

          

          

  • Hello Jinesh,

     As per TRF7970A, data sheet, the controller has 127 bytes of FIFO, so at a time only 127 bytes of Packet can be Tx or RX.
          So how we can achieve 254 bytes of Packet Size.

    The FIFO is used as a buffer to store data for MCU communication, and can be re-loaded with new data during transmission. From a device standpoint, there is no limit to the size of an RF packet for the TRF7970A, but NFC standards have limitations on packet sizes.

    The TRF7970A FIFO has watermarks to indicate both when data needs to be read out of or written into the FIFO and the SPI interface used is far quicker than the over-the-air transmission.

    Also when i try, the Card Emulation mode with android application i.e. "NFC Tool", getting error while writing Data bytes more than 100.

    The GUI has limitations due to the USB interface used between PC and LaunchPad for this demonstration. It is meant to show basic functionality of the stack but further development is to be handled by customers. All the hooks are in place to support more.

    Can it be possible to share a sample code, where it have handle the data bytes up to 20kBytes. (i.e. Multiple packets)

    Unfortunately I don't have that example anymore.

    Along with the actual data, there are few more bytes are been written from Android application, can you please provide the significant of it.

    These are part of the NDEF format defined by the NFC forum. You can read the details in Section 2.2 and all of Section 3. It is well documented in the app note.

  • Hello Jinesh,

    Regarding the 20kByte transfer, the example project should include a 3597-byte MIME image as one of the transferable messages. This sort of large message is a good example and provides the fundamentals for large data transfer which can be extended further. For the example code, we simply used a static image from Flash but you can really use any data source for this. I would recommend starting from that demonstration to handle larger transfers. 

  • Dear Ralph,

    We tried using the NFC stack mentioned by you in the previous chat.
    And configured NFC to work in CARD Emulation mode, but we face the memory overflow issue while merging the code with our Project.

    So can you provide us the optimized stack only with CARD emulation functionality?

    Please let us know which Android Mobile application are you using for communicating with the NFC chip.
  • Hi Jinesh,

    So can you provide us the optimized stack only with CARD emulation functionality?

    You can do this easily with the Stack as provided. Go to the nfc_config.h file in the nfclink/source/headers folder and change the #define statements to be the following:

    #define NFC_P2P_ACTIVE_INIT_ENABLED			0x00
    #define NFC_P2P_ACTIVE_TARG_ENABLED			0x00
    #define NFC_P2P_PASSIVE_INIT_ENABLED		0x00
    #define NFC_P2P_PASSIVE_TARG_ENABLED		0x00
    
    #define	NFC_CE_T4TA_ENABLED					0x01
    #define	NFC_CE_T4TB_ENABLED					0x01
    
    #define	NFC_RW_T2T_ENABLED					0x00
    #define	NFC_RW_T3T_ENABLED					0x00
    #define	NFC_RW_T4TA_ENABLED					0x00
    #define	NFC_RW_T4TB_ENABLED					0x00
    #define	NFC_RW_T5T_ENABLED					0x00
    

    Please let us know which Android Mobile application are you using for communicating with the NFC chip.

    I don't have any current apps to recommend but anything highly rated in the Android store nowadays should be solid candidates.

  • Dear Ralph Jacobi,

    When we transfer the data from Mobile application, the API ISO_7816_4_processReceivedRequest(), is been called twice.
    Both time the INS_INDEX value is 0xD6.

    I think at first time, when API is called the buffer don't content data. but 2nd time it has actual data.
    So how we can differentiate this 2 calls in code, as we are going to transfer multiple packets.

    Also, can it be possible to have a Demo on NFC working.

    As we requested the same to Jasraj, from long time.

    Thank you.

    Regards,

    Jinesh Punatar.

  • Hello Jinesh,

    I'm quite a few years removed from working on this at that level so I don't remember what INS_INDEX of 0xD6 relates to but my gut feeling is that the first call is to read the data size and the second call is to read the rest of the data. That is a standard NFC process where there is a 'Capability Container' at the header of an NDEF message that contains information needed to read the remaining NDEF contents. So you read the Capability Container (CC) first, and then you read the actual message contents. I would check if the application is doing a Read of the CC first.