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

what exactly do I need softdevice_sys_evt_handler for?

Hi

I am using SDK12 with NRF51822,

So far I haven’t initialized the sys_evt_handler (softdevice_sys_evt_handler_set(sys_evt_dispatch)) And my program works fine,

Ive seen a thread mentioning that it is used for NVMC,

but I have used sd_flash_write successfully to write to flash, what will I gain from using this handler when writing to flash or in general?

I would like to get some more understanding about this issue, what exactly are the events this meant to handle, what is its importance? Preferably with some examples.

Thanks!

Parents Reply
  • Hi,

    1. RTT should not be directly impacted by flash operations. Are you able to debug the application to see if NRF_LOG_PROCESS gets called after you've enabled the sys_event_handler?

    2. No, if you only use sd_flash_* API's you don't. You can just check the event ID in the dispatcher to see if it was NRF_EVT_FLASH_OPERATION_SUCCESS or NRF_EVT_FLASH_OPERATION_ERROR.

    if (sys_evt == NRF_EVT_FLASH_OPERATION_SUCCESS )

    { ..}

    else if (sys_evt == NRF_EVT_FLASH_OPERATION_SUCCESS)

    {..} // flash operation failed. Retry later?

Children
Related