meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sw:zephyr:hciuart [2025/04/25 20:51] niziaksw:zephyr:hciuart [2025/05/03 20:56] (current) niziak
Line 1: Line 1:
 ====== hciuart ====== ====== hciuart ======
 +
 +=====  ASSERTION FAIL lll_peripheral.c:342 =====
 +
 +<code>
 +rtt:~$ ASSERTION FAIL [0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c:342
 +rtt:~$   prepare_cb: Actual EVENT_OVERHEAD_START_US = 3784
 +rtt:~$ [00:03:07.452,392] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000002  r2/a3:  0x00000001
 +rtt:~$ [00:03:07.452,392] <err> os: r3/a4:  0x00000003 r12/ip:  0x0000ffda r14/lr:  0x0000f29d
 +rtt:~$ [00:03:07.452,423] <err> os:  xpsr:  0x01000028
 +rtt:~$ [00:03:07.452,423] <err> os: Faulting instruction address (r15/pc): 0x0000f2ac
 +rtt:~$ [00:03:07.452,453] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
 +rtt:~$ [00:03:07.452,453] <err> os: Fault during interrupt handling
 +
 +rtt:~$ [00:03:07.452,484] <err> os: Current thread: 0x20003b68 (idle)
 +rtt:~$ [00:03:07.921,173] <err> os: Halting system
 +rtt:~$ 
 +rtt:~$ *** Booting Zephyr OS build v4.1.0 ***
 +rtt:~$ [00:00:00.002,166] <inf> bt_hci_raw: Bluetooth enabled in RAW mode
 +</code>
 +
 +<file c zephyr/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral.c>
 +#define EVENT_OVERHEAD_PREEMPT_US        /* if <= min, then dynamic preempt */
 +#define EVENT_OVERHEAD_PREEMPT_MIN_US 0
 +
 +#if defined(CONFIG_BT_CTLR_XTAL_ADVANCED) && (EVENT_OVERHEAD_PREEMPT_US <= EVENT_OVERHEAD_PREEMPT_MIN_US)
 + uint32_t overhead;
 +
 + overhead = lll_preempt_calc(ull, (TICKER_ID_CONN_BASE + lll->handle), ticks_at_event);
 + /* check if preempt to start has changed */
 + if (overhead) {
 + LL_ASSERT_OVERHEAD(overhead);
 +
 + radio_isr_set(lll_isr_abort, lll);
 + radio_disable();
 +
 + return -ECANCELED;
 + }
 +#endif /* CONFIG_BT_CTLR_XTAL_ADVANCED */
 +
 +</file>
 +
 +<file c zephyr/subsys/bluetooth/controller/hal/debug.h>
 +#if defined(CONFIG_BT_CTLR_ASSERT_OVERHEAD_START)
 +#define LL_ASSERT_OVERHEAD(overhead) \
 + LL_ASSERT_MSG(false, "%s: Actual EVENT_OVERHEAD_START_US = %u", \
 +       __func__, HAL_TICKER_TICKS_TO_US(overhead));
 +#else /* !CONFIG_BT_CTLR_ASSERT_OVERHEAD_START */
 +#define LL_ASSERT_OVERHEAD(overhead) ARG_UNUSED(overhead)
 +#endif /* !CONFIG_BT_CTLR_ASSERT_OVERHEAD_START */
 +</file>
 +
 +<file kconfig zephyr/subsys/bluetooth/controller/Kconfig.ll_sw_split>
 +config BT_CTLR_ASSERT_OVERHEAD_START
 + bool "Assert on Prepare Latency"
 + default y
 + help
 +   Assert on increased Radio Event Prepare callback latencies due to
 +   CPU usage overheads in the Controller implementation.
 +
 +   Disabling this option permits the Controller to gracefully skip radio
 +   events that are delayed due to CPU usage latencies; as long as the
 +   radio event skips are not for every consecutive radio event interval,
 +   otherwise leading to remote supervision timeout and possible missing
 +   local disconnect events.
 +</file>
 +
 +Similar reports:
 +  * [[https://github.com/zephyrproject-rtos/zephyr/issues/67868]]
 +  * [[https://github.com/zephyrproject-rtos/zephyr/pull/67725]]
 +  * [[https://github.com/zephyrproject-rtos/zephyr/issues/52887]]
 +  * [[https://devzone.nordicsemi.com/f/nordic-q-a/108989/nrf52-on-custom-board-can-receive-ble-packets-but-not-send]]
 +
 +Workaround / fixes:
 +  * reduce CPU usage:
 +    * disable packet hexdump to RTT
 +    * disable BT debug logs
 +  * lower all NRF peripherial IRQ prio to 5 (override.dtsi)
 +  * set radio IRQ priority to 0 (dts)
 +
  
 ===== Out-of-order packet arrived ===== ===== Out-of-order packet arrived =====