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

NFC problem on nRF52840 when using mesh DFU bootloader.

I have developped an application using bluetooth mesh with NFC to read a text record. I am currently using the nRF52840 DK Rev 2.0.1 2020.11.

Regarding my software setup I am using the nrf mesh sdk v4.2.0 and nrf sdk v.17.0.0.

My application use the s140_nrf52_7.0.1_softdevice along with the mesh_bootloader_gccarmemb_nrf52840_xxAA to perform OTA DFU. Along with the BL, SD and APP i am flashing a corresponding device page (with a public key) that seems to work without a problem to accept DFU packets.

My issue is with NFC tag reader. If I only flash the application with the softdevice, I can read the NFC tag with my phone. However when flashing the APP + SD + BL + devicepage, I cannot read the NFC tag. That is very strange and nothing happened when i try to read the  NFC. 

Here is my NFC function that init the module.

void nfc_init(nfc_t2t_callback_t callback)
{
    ret_code_t err_code;

    /* Set up NFC */
    err_code = nfc_t2t_setup(callback, NULL);
    APP_ERROR_CHECK(err_code);

    /* Encode NFC message */
    err_code = nfc_msg_encode(m_ndef_msg_buf, &m_ndef_msg_len);
    APP_ERROR_CHECK(err_code);

    /* Set created message as the NFC payload */
    err_code = nfc_t2t_payload_set(m_ndef_msg_buf, m_ndef_msg_len);
    APP_ERROR_CHECK(err_code);

    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "NFC init\n");

    /* Start sensing NFC field */
    err_code = nfc_t2t_emulation_start();
    APP_ERROR_CHECK(err_code);
}

and this is the NFC config

#define NFC_NDEF_MSG_TAG_TYPE 2
#define NRFX_NFCT_ENABLED 1
#define NRF_CLOCK_ENABLED 1
#define TIMER_ENABLED 1
#define TIMER4_ENABLED 1
#define NFC_NDEF_MSG_ENABLED 1
#define NFC_NDEF_RECORD_ENABLED 1
#define NFC_NDEF_TEXT_RECORD_ENABLED 1
#define NFC_PLATFORM_ENABLED 1

The mesh OTA DFU works without a problem... I just got issues when trying to scan the NFC tag... nothing happened!
Any comment on this issue is appreciated!

  • Here is my different versions I use:

    nrf mesh sdk v4.2.0
    nrf sdk v.17.0.0
    softdevice s140_nrf52_7.0.1_softdevice
    mesh_bootloader_gccarmemb_nrf52840_xxAA

    When using NFC library with a mesh application and default mesh bootloader everything seems to work fine ...main is reached nfc init function is reached without problem , no crashes no errors BUT I cant scan the NFC tag with my phone ... nothing is detected!

  • Hi Tony

    Edvin is currently on leave, and I have been tasked to look after this case while he's away. I'm sorry about the late reply, but we just now got to his backlog. 

    Please note that if you're using SDK v17.0.0 it is strongly recommended to switch to SD v17.0.2, as this is a bug fix release replacing v17.0.0.

    Regarding Edvin's questions in his last reply, when running the NFC with the default bootloader, are you able to use a logic analyzer or similar to see if there is any "action" at all on the NFC pins (P0.09 and P0.10)? While debugging, are you able to see any differences in the nfc_init() function at all between using the default bootloader and the one excluding the init_clock() function?

    Best regards,

    Simon

Related