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.

trouble using tivaware example code with the TRF7970A boosterpack and EK-TM4C1294XL Rev. D launchpad.

Other Parts Discussed in Thread: TRF7970A, CC3100

I'm having trouble figuring out how to use the nfc_p2p_demo example code with the TRF7970A  + TM4C1294XL. This example project exists within TivaWare C Complete (http://www.ti.com/tool/sw-tm4c one that came with the TRF7970A boosterpack) it always says tag unrecognized. It makes it to the SendData function and within the initial for loop to determine the tag type the var "g_sNDEFMessage" is always empty, resulting in the loop never executing and the switch statement below it going directly to the default case. Which prints "Error on Sending Tag. Tag Format Not Recognized.\n"

note: the SendTI function works and I get the TI URL on my phone when I press the SW1 button on the launchpad.

Any help is very much appreciated. 

  • Hello Tanner,

    Which Android device are you using and are there any particular apps you are using to send/receive data?
  • Samsung Note 5 (N920T) using the NFC Tools Pro app. For testing the part of the demo that sends the TI URL I keep the app in the read view, then press the button on the launchpad to fire the URL. The app will show the URL in one of the fields from the read.

    Here is a screenshot of the app when I press the SW1 button on the launchpad (and hold my phone over the launchpad):

  • Hello Tanner,

    The app you downloaded is only designed to write to NFC tags which is a different method of NFC communication than Peer to Peer.

    It seems the app I've been using for years isn't on the Play Store anymore, but I would check out apps which say they can support "P2P" data sends. It looks like Legic has such an app, and also there is an "NDEF Tools for Android" which supposedly can beam P2P data. I would check those out.

  • Ralph,

    Thank you for the reply! I'm not too worried about the actual P2P part of the example code. I used just my phone and the app to verify that the TI URL part of the example code worked and the NFC booster/launchpad was functional (I will be checking out that app though, so thank you for the information).
    What I am interested in is the part of the P2P example that reads a NFC chip (to then echo it back to the phone) and simply grabbing the ID of the chip. Am I doing the P2P example correctly by placing a NFC chip over the NFC booster and then pressing SW2? I am assuming it wants to read a chip in first before interacting with something with P2P capability. Or is the data the example wants to echo coming from the P2P device?
  • Hello Tanner,

    It looks like the comments in the Tiva-C example were a bit confusing. The comment "Button SW2 will echo the last tag sent to the board back to the phone / tablet." is not referring to an NFC tag, so using a Tag Write application will not work.

    That comment should have been more precisely said as "Button SW2 will echo the last NDEF Message sent to the board back to the phone/tablet".

    Peer to Peer and NFC Reader/Writer both use NDEF format to send and receive information, but the commands used to transmit these NDEF packets are different. If you try to 'Write' an NDEF message with Reader/Writer commands to a P2P device, you will not succeed because the commands will not match.

    This is why I am suggesting to use the other apps, because the NFC Write Tag app you have will never allow the echo back function of the P2P example to work.

    Does this explanation make sense?

    Furthermore, to clarify how the example for the SW2 button would work - presenting the phone will not prompt it to send a message. You need to find a P2P app which can transmit data, or use the Android's default NFC functionality ("touch to beam") to send a message manually while the phone is presented to the NFC booster. Once you have sent that data, then you can click the SW2 button in order to get the echo'd message.

    A basic summary of steps would be:

    1) Open NFC P2P app, or bring up webpage etc. you want to transmit with NFC
    2) Hold phone over NFC Booster to establish communication
    3) Wait for prompt to tell you to send data. For native "Touch to beam" P2P transfer, the screen will zoom out and the words "Touch to beam" or something similar will appear. For an app, it can vary, but typically it will be either an audio or visual prompt.
    4) After sending, you should get a short double ding to indicate success. You should also see the message on your PC terminal.
    5) Once confirming you received the message, use the SW2 button to echo back that message to the phone
  • Ralph,

    Thank you very much! This completely clarifies the example project and how to use it. Which means (correct me if I am wrong) this example project won't show me how to read from a NFC tag using TM4C1294XL and the TRF7970A.
    So I guess my next question is, are there any example projects using the TM4C1294XL and the TRF7970A that are for reading and writing to different tags?

    The "TivaWare_C_Series-2.1.3.156" folder installed with the TivaWare C complete installer has an nfclib folder that seems to hold classes for different tag types (ISO14443A, ISO15693, ...) and I'm assuming I would use those to talk to the appropriate NFC chip?
    I've tried using the example code from the "iso14443a.c" file's documentation, but holding a few different tags over the boosterpack doesn't create any results.
    Documentation's code:
    // Pseudo C: <pre>
    // while(1) {
    // ISO14443APowerOn();
    // if(ISO14443ASelectFirst(ISO14443A_REQA, ...)) {
    //
    // <i>Do something with the card</i>
    //
    // ISO14443AHalt();
    // }
    //
    // <i>Do NOT power off the field</i>
    // }
    // </pre>

    From here I am at a loss for how to proceed. Is there a step I am missing or something?
  • Hello Tanner,

    TivaWare doesn't include a working example with the NFC Reader/Writer functions as far as I am aware.

    You could use the firmware that is included in a TI design which uses both of those boards as well as the CC3100 for WiFi connectivity too: www.ti.com/.../TIDM-TM4C129XNFC

    That will support the NFC Reader/Writer functionality you want.

    If you don't want the CC3100/WiFi functionality, it seems that you can disable it without too much trouble. Someone else commented as much a few days ago on this thread: e2e.ti.com/.../2001295
  • Ralph,

    Thank you for the suggestion and all your help! I will definitely investigate that example.