This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

BLE Disconnect error from within timers timeout callback function

Hi,

I have a question regarding the nRF5340 Development Kit.

I use nRF5340 in the BLE Central role, I'm using a similar code like in the example central_bus.

Sometimes service discovery "bt_gatt_dm_start" takes too long.

To resolve that I start the timer before calling discovery (k_timer_start before bt_gatt_dm_start) so that way if it takes too long I want to disconnect from BLE peripheral, but I get an error when trying to disconnect from within timer_timeout__func.

The error that I get is

ASSERTION FAIL @ WEST_TOPDIR/zephyr/kernel/sem.c:121
E: r0/a1: 0x00000004 r1/a2: 0x00000079 r2/a3: 0x00000001
E: r3/a4: 0x0000372d r12/ip: 0x00001000 r14/lr: 0x000120b7
E: xpsr: 0x41000025
E: Faulting instruction address (r15/pc): 0x00015388
E: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
E: Fault during interrupt handling

E: Current thread: 0x20000fa0 (unknown)
E: Resetting system

Can someone help, how to disconnect from within timeout callback?

Parents Reply Children
No Data
Related