zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.07k stars 6.19k forks source link

Bluetooth: Controller: bap_broadcast_source crashes on nRF5340 with encryption enabled #75435

Closed larsgk closed 12 hours ago

larsgk commented 4 days ago

In the bap_broadcast_source sample, enable encryption by providing a broadcast code, e.g.

CONFIG_BROADCAST_CODE="1234"

Seen on nRF5340 Audio DK

Build the hci_ipc sample for the net core:

west build -b nrf5340_audio_dk_nrf5340_cpunet -d build/nrf5340audiodk/hci_ipc samples/bluetooth/hci_ipc --pristine -- -DCONF_FILE=nrf5340_cpunet_iso-bt_ll_sw_split.conf

Build the bap_broadcast_source sample (with added broadcast code):

west build -b nrf5340_audio_dk_nrf5340_cpuapp -d build/nrf5340audiodk/bap_broadcast_source samples/bluetooth/bap_broadcast_source --pristine

Flash both net and app core.

With broadcast code provided (=> encryption enabled), the application crashes after a few seconds:

Initializing lc3 encoder for stream 0
Initializing lc3 encoder for stream 1
Creating broadcast source
Creating broadcast source with 1 subgroups with 2 streams
Starting broadcast source
[00:00:00.946,533] <wrn> usb_device: Endpoint 0x88 already disabled
[00:00:00.948,486] <wrn> usb_device: Endpoint 0x08 already disabled
ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:410
    Controller unresponsive, command opcode 0x2068 timeout with err -11
[00:00:10.485,565] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000000  r2/a3:  0x00000002
[00:00:10.485,565] <err> os: r3/a4:  0x00000003 r12/ip:  0x00000010 r14/lr:  0x00005d37
[00:00:10.485,595] <err> os:  xpsr:  0x09100000
[00:00:10.485,595] <err> os: s[ 0]:  0x0002b137  s[ 1]:  0x2000ab24  s[ 2]:  0x2000aa90  s[ 3]:  0x2000aa90
[00:00:10.485,595] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x00000001  s[ 6]:  0x2000aaa0  s[ 7]:  0x2000aaa0
[00:00:10.485,626] <err> os: s[ 8]:  0x20003808  s[ 9]:  0x2000ab45  s[10]:  0x20003700  s[11]:  0x2000370c
[00:00:10.485,626] <err> os: s[12]:  0x20002c58  s[13]:  0x200038a0  s[14]:  0x2000d690  s[15]:  0x200036fc
[00:00:10.485,626] <err> os: fpscr:  0x20003808
[00:00:10.485,656] <err> os: Faulting instruction address (r15/pc): 0x00005d46
[00:00:10.485,687] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:10.485,717] <err> os: Current thread: 0x20003178 (unknown)
[00:00:10.590,301] <err> os: Halting system

Zephyr SHA used: 0d0c5afe7a26fbf6918a72a55d843e9ceff5a20f

Thalley commented 4 days ago

Offending change is https://github.com/zephyrproject-rtos/zephyr/pull/71660