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

things allow/not allowed to call from callbacks NRF52/S132

Hi!

I was developing my custom service, and had a question around what kind of functionality is allowed or not allowed within a callback from the soft device or other peripheral drivers.

Examples:

example #1: softdevice handler for BLE events: err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);

Now I wanted to use std::make_shared within that event handler, and it seems that it will just hang the device or trigger some kind of fault (sometimes debugging isn't that clear).

example #2: TWI peripheral driver completion handler: err_code = nrf_drv_twi_init(&m_twi, &twi_drv_config, twi_handler, config);

In this case I wanted to call sd_ble_gatts_value_set, but this will also result in a hang or some kind of fault (again not that easy to debug).

Is there a clear list of what's allowed at what point?

Thanks, Peter

Parents Reply Children
No Data
Related