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

nRF52 edit nfc tag

Hello,

I have a question about the NFC tag. In the example nrf_url_record_pca10040 there is a part where the url will be written in the tag

err_code = nfc_uri_msg_encode( NFC_URI_HTTP_WWW, (uint8_t *) url, sizeof(url), ndef_msg_buf, &len);

However when I try to write something from outside the code, with for example my phone I get the error that the tag is write protected. (The tag is delivered with the DK)

My question is: Is it possible to remove the lock, or to rewrite the url from outside? If so, please tell me how I can do this.

Thanks in advance

Parents
  • Thansk for the response,

    I already solved this issue. I changed the lock bytes and write protect bytes. By setting these location to 0x00 and 0x0000.

    #define LOCK (*(uint16_t volatile *)(0x2000220A))
    #define WRITEPROTECT (*(uint8_t volatile *)(0x2000220F))
    

    And by checking if its a write request

    if (m_nfc_rx_buffer[0] == 0xA2)
    

    Then by using the function:

    const char ack = 0x0A;
    hal_nfc_send(&ack,1);
    

    To send a response.

    Kind regards,

    Tim Smits

Reply
  • Thansk for the response,

    I already solved this issue. I changed the lock bytes and write protect bytes. By setting these location to 0x00 and 0x0000.

    #define LOCK (*(uint16_t volatile *)(0x2000220A))
    #define WRITEPROTECT (*(uint8_t volatile *)(0x2000220F))
    

    And by checking if its a write request

    if (m_nfc_rx_buffer[0] == 0xA2)
    

    Then by using the function:

    const char ack = 0x0A;
    hal_nfc_send(&ack,1);
    

    To send a response.

    Kind regards,

    Tim Smits

Children
Related