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

nrf52 NFC with softdevice running

Hi all, Here is my first question on this forum after many hours working with the NRF but for the first time I didn't found the answer :)

My problem is : I would like to run the NFC in ISO/ICE 14443 Type A mode with t4t for reading and writing. For now, it works alone (with some strange behaviours). I'am able to exchange in both ways (read/write) few bytes and that's exactly what I want. The strange behaviour I mentionned above is that after few read/write sequences, it stops working and the callbak given in "nfc_t4t_setup" is no more called (only for NFC_T4T_EVENT_FIELD_OFF event). That is the first point, how could I get status of the nfc lib to monitor and, if needed, restart it?

The next step on which I'm struggling is that I want to use NFC with softdevice enabled and last but not least, in a low power application. Current ble example using NFC are not relevant because it's only for paring. So I initialized NFC as usual but since I go to sleep with "sd_app_evt_wait" it doesn't wake up when I try to use NFC but the power consumption rise up to 5mA instead of 3µA before approaching the smartphone. Is someone could help to, first find a way to use NFC properly with softdevice, and second how to wakeup properly on an event like NFC field or something ?

Last question : NFC callback seems to be timming sensitive (if I print debug in it) It doesn't work properly. Any advice ?

Thanks in advance for your help.

Here the code (all functions begining with Sys are calling our custom code):

int main(void) {

uint32_t err_code;
IS_DBG_Init();

// Set up NFC 
err_code = nfc_t4t_setup(nfc_callback, NULL);

// Start sensing NFC field 
err_code = nfc_t4t_emulation_start();

Sys_Init();

app_timer_init();
ble_stack_init(app_ble_callback);
gap_params_init(DEVICE_NAME,BLE_APPEARANCE_UNKNOWN,TX_POWER_LEVEL,STATIC_PASSKEY);
//gatt_init();
//services_init(&_app);
advertising_init(APP_ADV_INTERVAL, APP_ADV_TIMEOUT_IN_SECONDS);
//conn_params_init(); //need app_timer_init 
peer_manager_init();
advertising_start(true);

//start_scan();

while (1)
{
    if (Sys_Process())
    {
        Sys_Sleep();

        sd_app_evt_wait();

        Sys_Wakeup();
    }
}

}

Parents Reply Children
No Data
Related