NRF5340: net core crashes in sdc_hci_cmd_le_set_adv_enable() if CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP=0

The NRF5340 net core crashes in sdc_hci_cmd_le_set_adv_enable() if I have CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP set to 0.

To reproduce the issue, do the following:

1) Use the attached peripheral_gatt_dm project. In that project, I enabled MCUBOOT which caused a linking issue that I temporarily resolved by setting CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP to 0. See devzone.nordicsemi.com/.../bug-in-ncs-v1-7-1-with-32khz-rc-oscillator-and-mcuboot-enabled as to the reason why I had to set CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP=0.

2) Add the following lines into the C:\ncs\v1.8.0\zephyr\boards\arm\nrf5340dk_nrf5340\nrf5340dk_nrf5340_cpunet_defconfig file:

CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP=0

3) Use the following command to build and flash the image:

west build -p -b nrf5340dk_nrf5340_cpuapp
west flash --erase

4) In the app core side, you'll see the following console logs:

*** Booting Zephyr OS build v2.7.0-ncs1 (Jan 21 2022 13:27:32) ***
Starting GATT Discovery Manager example
[00:00:00.082,641] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.082,672] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.082,672] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 223.20160 Build 1719410646
[00:00:00.089,691] <inf> bt_hci_core: Identity: ED:B3:AF:58:A1:9C (random)
[00:00:00.089,691] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x22b0, manufacturer 0x0059
[00:00:00.089,691] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0x22b0
ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:306
k_sem_take failed with err -11
[00:00:10.113,281] <err> os: r0/a1: 0x00000003 r1/a2: 0x00022004 r2/a3: 0x00000001
[00:00:10.113,311] <err> os: r3/a4: 0x00018061 r12/ip: 0x00001000 r14/lr: 0x00010cf9
[00:00:10.113,311] <err> os: xpsr: 0x49000000
[00:00:10.113,311] <err> os: Faulting instruction address (r15/pc): 0x00010d04
[00:00:10.113,311] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:10.113,311] <err> os: Current thread: 0x20000f88 (unknown)

The k_sem_take failure is caused by the net core crashing.


I would like to know if there's a way to not have to set CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP=0 to fix the linking issue or is there a work-around to prevent this crash?

The crash only occurs with the Nordic Bluetoooth Controller. It does not crash with the Zephyr Bluetooth Controller.peripheral_gatt_dm.zip

Setting the CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=n or CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y instead of CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP=0 is not an option that I could use.

Parents Reply Children
No Data
Related