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

ble_app_template not working

I have been trying to understand and get the “ble_app_template” running this weekend, but I keep running into errors. For example in

static void sys_evt_dispatch(uint32_t sys_evt) { pstorage_sys_event_handler(sys_evt); }

From the main.c, the complier says that “NRF_EVT_FLASH_OPERATION_SUCCESS” inside pstorage_sys_event_handler does not exist.

I then check out the nrf51 SDK website(devzone.nordicsemi.com/.../a01346.html and it indicated that NRF_EVT_FLASH_OPERATION_SUCCESS is part of "enum NRF_SOC_EVTS” inside nrf_soc.h.

I then check nrf_soc.h and find NRF_SOC_EVTS, which only has three properties:

/@brief SoC Events. */ enum NRF_SOC_EVENTS { NRF_EVENT_HFCLKSTARTED, /< Event indicating that the HFCLK has started. */ NRF_EVENT_POWER_FAILURE_WARNING, /**< Event indicating that a power failure warning has occurred. */ NRF_EVENT_NUMBER_OF_EVENTS };

Which does not have NRF_EVT_FLASH_OPERATION_SUCCESS, and I cannot ctrl-F it anywhere in the project. This is the same problem with “NRF_EVT_FLASH_OPERATION_ERROR”.

I also have conceptual questions about the template code/SoftDevice:

What is the difference between “softdevice_ble_evt_handler_set” and “softdevice_sys_evt_handler_set”. Is the latter for any system event that is not BLE related? Is the concept of a system event like a SW interrupt? What is the role of the app scheduler? Does it just allocate the pending events, that the main loop constant polls to execute? If so, interrupts are not handled directly and instead by polling “app_sched_execute” ? Can I have an application without using scheduler? Thanks

Related