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

Combine ECB and pstorage

I read somewhere that to get the callback working on pstorage write, read etc, you need to call pstorage_sys_event_handler() in a function set by softdevice_sys_evt_handler_set() which in turn probably requires SOFTDEVICE_HANDLER_INIT() ?

The problem is when doing this, it just hangs when initializing ECB:

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

static void softdevice_stack_init(void)
{
	// Initialize SoftDevice.
	SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
	uint32_t err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
	APP_ERROR_CHECK(err_code);
}

...

int main(void)
{
	softdevice_stack_init();
 // ...
 (void)nrf_esb_init(NRF_ESB_MODE_PTX); // HANG
 }

The softdevice is loaded, and I use app_timer_ble_gzll.c and esb_sd_resources_arm.a (using GCC) Note: I don't really use the callback, but I guess it's a sign that nothing actually happens in the actual write, read etc.

I read in the documentation:

developer.nordicsemi.com/.../a00104.html

"The radio and timer interrupt handlers run at priority level 0 (highest level), and the ESB callback functions run at priority level 1. Other interrupts used by the application must use priority level 2 or higher to ensure correct operation."

I guess I should do something with this?

Thanks!

Parents Reply Children
Related