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: Demo board Read is ok , but write is fail

Part Number: TRF7970A


Hi All

I run TI example FW sloc297c on TI demo board G2553+TRF7970+Tagit.

The example seem only enable Read Function by "NFC_appIso15693ReadTag(0x02 | ui8AddressedFlag)" and it indeed run ok.

Customer also need to implement write function, I see the FW include write API but it is no used, so I try call the write API "ISO15693_sendWriteSingleBlock(0x02 | ui8AddressedFlag, 0x0, 0x6, Write_Data);" to replace read function, however the write API return fail, and the data is not wrote into Tag after read the Tag content again. 

May I get advice that it is ISO15693_sendWriteSingleBlock usage issue or the Tagit do not support write function?

The platform is as below picture.

  • Hello Terry,

    Terry Deng said:
    May I get advice that it is ISO15693_sendWriteSingleBlock usage issue or the Tagit do not support write function?

    Not quite either! I will explain.

    The Tag-It tags do support ISO15693 Write's, but they require an added process that won't be triggered by your API call of:

    ISO15693_sendWriteSingleBlock(0x02 | ui8AddressedFlag, 0x0, 0x6, Write_Data);

    The added process is that it requires an End of Frame marker that the reader must send out when the "Option Flag" is selected for the ISO15693 (this is straight out of ISO15693 standards) in order to accept written data.

    This functionality is included in the firmware, but you must call the API with the correct ISO15693 flags to trigger it. The flag is bit 6 of the flag byte, so the flag should be appended with a 0x40.

    Therefore, the correct function call would be:

    ISO15693_sendWriteSingleBlock(0x42 | ui8AddressedFlag, 0x0, 0x6, Write_Data);

    Please try this, I hope my explanation may clear up any questions about why it wasn't working.

  • Hi Ralph

    Thanks your quickly advice.

    Sorry I try "ISO15693_sendWriteSingleBlock(0x42 | ui8AddressedFlag, 0x0, 0x6, Write_Data)" still fail. I check the detail inside the sendWriteSingleBlock API as below, and found the process finial show STATUS_FAIL because "No response". Do you think any other cause?

    if (g_sTrfStatus == RX_COMPLETE) // If data has been received

    {

    if (g_pui8TrfBuffer[0] == 0x00) // Confirm "no error" in response flags byte

    {

    // Response received

    ui8Status = STATUS_SUCCESS;

    }

    else // An error has been sent back in the response byte

    {

    ui8Status = STATUS_FAIL;

    }

    }

    else

    {

    // No response    

    ui8Status = STATUS_FAIL;

    }

  • Hello Terry,

    I would recommend checking the g_sTrfStatus that occurs when you land in that else statement. It may give additional information about what is going on though if it returns a no response TRF79xx status, then the tag really didn't reply and that would indicate to me that it could be a range issue.

  • Hi Ralph

    When the FW land in the "STATUS_FAIL" in ISO15693_sendWriteSingleBlock API, I check "g_sTrfStatus" content really show "NO_RESPONSE_RECEIVED". I am not sure your meaning for "range issue", do you say the distance is not enough between Tag and Reader? Why Read function can work well?
  • Hello Terry,

    Hmm okay, I was honestly more expecting an error to be reported than no response.

    In general it takes less RF energy to read from tags than to write to tags. If a tag is near the edge of the read range, it can succeed a read but not a write. If the tag is on that edge, then you may need to move it closer.

    Another cause could be the write command not working as intended. 

    A quick check to make sure the function is doing what we want, is set a breakpoint in the function for both lines which call the following:

    TRF79xxA_sendDirectCommand(TRF79XXA_TRANSMIT_NEXT_SLOT_CMD);		// Send out End of Frame marker

    If that line is hit, then I am confident the EOF is being sent correctly, but if not, then you should verify the ui8ReqFlag to make sure it is 0x62 (the 0x42 would be appended with 0x20 inside the function to make it 0x62 in order to support addressed writes which is the safest way to write tags).

  • Hi Ralph

    I have confirmed that FW will hit the 1st "TRF79xxA_sendDirectCommand(TRF79XXA_TRANSMIT_NEXT_SLOT_CMD) " in write API, so as you say the EOF should be sent correctly.

    And I have already just put the Tag on the surface of Reader, I cannot move Tag close more. Do you still think the RF energy is not enough for write function? Does any other method I can try increase the RF energy except move Tag closer? Because it is TI demo board, I do not think can find another board have better hardware performance.
  • Hello Terry,

    That is absolutely fine in terms of range and it should work at that distance.

    I noticed in your picture the tin cap on the BoosterPack was removed, were there any modifications made to the hardware beyond removing the DLP Design cap?
  • Hi Ralph

    I do not modify any hardware for the demo board. I remove the DLP Design Cap just to measure the TRF7970 pin signal by oscilloscope.
    BTW, I try to test on another set G2553 + TRF7970ABP which do not remove the DLP Design Cap, and the result is same with No Respond in Write API.

    Do you have demo board on hand and can you help try the sloc297c firmware, I cannot think what any other issues we maybe missing.
  • Hello Terry,

    I don't have a demo board and tag in hand, but I personally wrote and validated that firmware and have used it dozens of times to write tags. How many tags have you tried with? Can you try writing the tag with a smartphone to see if it can be written at all?
  • Hi Ralph

    I have try used smartphone to written the tag on my hand, it can work. So I am sure the Tag should be OK.

    And I also try test 2 set TRF7970ABP demo board, both can read Tag ok but write fail. Consider the 2 set demo board behavior are same and read well, I believe the demo board hardware are ok.

    So only remain the Firmware, I suspect there may something tips we are missing in firmware for write function. I find a another example code base on TIVA MCU to operate TRF7970 write function as below, seems there are little difference compare with sloc297c code on G2553 MCU. How do you think?

    g_pui8T5TBuffer[ui8Offset++] = g_ui8T5TRequestFlag;
    g_pui8T5TBuffer[ui8Offset++] = T5T_WRITE_SINGLE_BLOCK_CMD;

    if (g_ui8T5TRequestFlag & T5T_REQ_FLAG_ADDRESSED)
    {
    // Copy UID into Buffer
    for (ui8TempCount = 0; ui8TempCount < 8; ui8TempCount++)
    {
    g_pui8T5TBuffer[ui8Offset++] = g_ui8T5TUID[ui8TempCount];
    }
    }

    // Block # to be written
    g_pui8T5TBuffer[ui8Offset++] = (uint8_t)(g_ui16T5TBlockNumber & 0xFF);
    if (g_ui8T5TRequestFlag & T5T_REQ_FLAG_EXTENDED)
    {
    g_pui8T5TBuffer[ui8Offset++] = (uint8_t)(g_ui16T5TBlockNumber >> 8);
    }

    // Data to be written to the block
    for (ui8TempCount = 0; ui8TempCount < g_ui8T5TTxLength; ui8TempCount++)
    {
    g_pui8T5TBuffer[ui8Offset++] = g_pui8T5TTxData[ui8TempCount];
    }

    // Set Option Flag Delay bool for TRF driver
    if (g_ui8T5TRequestFlag & T5T_REQ_FLAG_OPTION)
    {
    g_bT5TOptionDelay = true;
    }
    else
    {
    g_bT5TOptionDelay = false;
    }
    g_eNfcRwT5TCommStatus = NFC_RW_T5T_CONNECTION_WAIT_WRITE_SINGLE_RSP;
  • Hello Terry,

    I missed something key about your API call now that I am reviewing it again.

    The API parameters are: Flags, Block Number, Block Size, and Block Data. The Block Size for TI Tag-It tags are 4 byte size. So you should use 0x04, not 0x06 for that parameter. What is occurring by using 0x06 is you are sending out 2 extra bytes which makes it an illegal command to the tag and it won't reply.
  • Hi Ralph

    you are correct, now I can write ok. thanks your patient support very much.