This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NFC Write Not Working SDK 17 after working consistently for weeks

I am currently trying to test the writable ndef message example on my nrf52 development board. I have gotten it to work so many times in the past weeks but now it seems when I use NFC tools to write a message to the nfc tags I get the error on nfc tools, "write error". I am really confused as to what the issue can be hand have tried almost everything suggested in the forums to no avail. I will provide a screen shot of the appearance of this error message. 

The code is literally the exact writable ndef message example which is why I left it out. Just wondering if any one has some possible solutions or approaches to try. Thank you.

Parents
  • Hi 

    Does it start working again if you reset the nRF52DK?

    What if you erase the chip and reprogram it, does that make a difference?

    Do you have another phone or NFC reader device at hand that you could try, to see if it is somehow related to the reader or just to the nRF52DK?

    Best regards
    Torbjørn

  • I tried pushing the reset button on development board and then writing to the nfc tag, no luck, I tried erasing the chip and running the code again, still no luck. 

    I tried with another phone, an iphone, and the error, nfc tag not supported came up. But that is so strange because I have had this working consistently for a long time, I am using the tag given with the nRF52 development board.

  • Hi

    I guess what you refer to as the tag is just the external antenna that is provided with the DK. 

    All the NFC configuration and data is controlled by the nRF52832 chip, and whatever software you put into it, so it is very odd that you can not get it to behave like before if you erase the nRF52832 flash content and reprogram it with the original example. 

    Have you double checked that the NFC antenna is securely mounted to the connector, and that it didn't get loose?

    Best regards
    Torbjørn

  • Yes I am referring to the external antenna. And as far as I have checked the antenna is in there properly. When I go to read the tag it identifies and reads it so I am not sure why I can't write to it.  I have checked with multiple similar antennas. One another person's board the the firmware still works all together. However, another person who has the development board and the same firmware I wrote has their stuff still working. They did not go through the process of erasing the chip. I did. That's when issues began to arise because I never had these issues before erasing the chip.

    Does the erasing process corrupt the data in some register that is important for nfc wite to work? A third person I tested with had their dev board and erased the chip before uploading code. Then when they tested, they got the same error as I did. It seems to be linked to the erasing of the chip. The error is typically in the form of "this tag type is not supported" when I test with nfc tools, however, when I tested with the other person who faced similar issues their board came up as a ISO 7816 while mine came up as something else, something in the class of mifare tag. I believe ISO 7816 is supported by NFC tools and mifare is not. Yet errors persist. 

  • I am seeing that there is a way to reset the cpu of the device completely on the development board. I think it is called NVIC System Reset. How do I do this exactly for the nrf52 implementing sdk 17, or is it a sdk independent process? Do you suggest such a reset for trying to debug this issue? Is there any risk involved?

  • Hi 

    Can you let me know how exactly you erase the chip?
    Doing a chip erase is a standard part of the development process, and should not affect the functionality of the device in any way (assuming you flash the application back afterwards, as well as any UICR configuration that was lost by the chip erase). 

    The only thing that might cause long term issues is if the FICR area is somehow corrupted, but an eraseall should not affect FICR. 

    Maybe you could perform a FICR readout of your device and send me the result?

    nrfjprog --readficr file.hex

    peterg0313 said:
    I am seeing that there is a way to reset the cpu of the device completely on the development board. I think it is called NVIC System Reset. How do I do this exactly for the nrf52 implementing sdk 17, or is it a sdk independent process? Do you suggest such a reset for trying to debug this issue? Is there any risk involved?

    A system reset will only reset the CPU program counter, reset peripheral registers to their default values and restore GPIO configuration to default. It should not have any permanent effects, such as affecting flash memory content. 

    To perform a so called soft reset (software initiated reset) you can simply call this function in your application:
    NVIC_SystemReset();

    You can read about the various reset types here. Scroll to the bottom for an overview of what the different reset types actually reset.  

    Doing a reset is a risk free process and is quite normal to do if some critical program error occurs during runtime, in the hope that restarting the entire application will allow you to recover from the error (this is essentially what the watchdog peripheral is for). 

    Best regards
    Torbjørn

  • When I erase the chip I do it after connecting JLink, so I connect the JLink in target, then I hit erase all under target, then I hit download (project name) under target. I started doing it this way once trying to program the custom board through J link using the development board JLink pins. I don't know if this reveals anything as far as errors in the system but I reuploaded the writable ndef message example code code to the board and used putty to debug through com port and I get this. When I approach the tag it'll read tx start a bunch of times and then once I get the error that NFC write failed on my phone I move my phone slightly away from the tag and it reads reinitialize. Then the process repeats again when I try to rewrite the nfc tag message. So from my perspective it is clearly trying to start the NFC write but nothing is happening and then it tries to reinitialize to attempt to rewrite again. 

    Also, my custom code, which incorporates nfc writable ndef message, also serializes the boards advertised name with the data in the device address registers of the FICR. It merely reads these registers and uses a format specifier to put the numbers in these addresses into the advertised name of the device when the device advertises its name. These addresses havent changed numerically at all so I don't have a reason to believe the FICR has changed at all. 

    Also, these issues started to arise when I started running the code on a BL652-SC based custom board, which is supposed to contain the same nrf52 processor as the development board, the nrf52832, on this custom board there is an NFC antenna header which is configured in the same exact way hardware wise as the antenna header on the development board and uses Laird antennas which look almost identical to the nordic semi antennas. Do these Laird boards require alterations in software that make them different to the development boards as it relates to NFC because the other functions of the code still execute perfectly on the hardware?

    I had the code working on my development board and then once I interchanged antennas to diagnose why it was not working on the custom board and then switched the antennas back I found it was no longer working on development board. My code still works on another colleagues development board who has not experimented with these other boards. 

Reply
  • When I erase the chip I do it after connecting JLink, so I connect the JLink in target, then I hit erase all under target, then I hit download (project name) under target. I started doing it this way once trying to program the custom board through J link using the development board JLink pins. I don't know if this reveals anything as far as errors in the system but I reuploaded the writable ndef message example code code to the board and used putty to debug through com port and I get this. When I approach the tag it'll read tx start a bunch of times and then once I get the error that NFC write failed on my phone I move my phone slightly away from the tag and it reads reinitialize. Then the process repeats again when I try to rewrite the nfc tag message. So from my perspective it is clearly trying to start the NFC write but nothing is happening and then it tries to reinitialize to attempt to rewrite again. 

    Also, my custom code, which incorporates nfc writable ndef message, also serializes the boards advertised name with the data in the device address registers of the FICR. It merely reads these registers and uses a format specifier to put the numbers in these addresses into the advertised name of the device when the device advertises its name. These addresses havent changed numerically at all so I don't have a reason to believe the FICR has changed at all. 

    Also, these issues started to arise when I started running the code on a BL652-SC based custom board, which is supposed to contain the same nrf52 processor as the development board, the nrf52832, on this custom board there is an NFC antenna header which is configured in the same exact way hardware wise as the antenna header on the development board and uses Laird antennas which look almost identical to the nordic semi antennas. Do these Laird boards require alterations in software that make them different to the development boards as it relates to NFC because the other functions of the code still execute perfectly on the hardware?

    I had the code working on my development board and then once I interchanged antennas to diagnose why it was not working on the custom board and then switched the antennas back I found it was no longer working on development board. My code still works on another colleagues development board who has not experimented with these other boards. 

Children
  • Hi

    peterg0313 said:
    These addresses havent changed numerically at all so I don't have a reason to believe the FICR has changed at all. 

    That makes sense, I expect the issue to be something else. 

    peterg0313 said:
    Do these Laird boards require alterations in software that make them different to the development boards as it relates to NFC because the other functions of the code still execute perfectly on the hardware?

    They shouldn't. The higher level API doesn't really care what antenna you have connected, but if it's not tuned properly you could get into issues. 

    peterg0313 said:
    I had the code working on my development board and then once I interchanged antennas to diagnose why it was not working on the custom board and then switched the antennas back I found it was no longer working on development board.

    So essentially just the act of removing the antenna and putting it back on the kit made it not work? 

    Or did you also try the Laird antenna on the nRF52DK?

    Best regards
    Torbjørn 

Related