HardFault in hci_driver on sample/bluetooth/periodic_sync using nRF52833DK

Describe the bug
When running the example project sample/bluetooth/periodic_sync on a nRF52833DK and sample/bluetooth/periodic_adv on a custom nRF52833 board, the central side crashes with an HardFault as soon as the peripheral starts to advertise. The crash is an ASSERT that is triggered in the SoftDevice hci_driver :

SoftDevice Controller ASSERT: 12, 136
[00:00:04.634,460] <err> os: ***** HARD FAULT *****
[00:00:04.634,460] <err> os:   Fault escalation (see below)
[00:00:04.634,490] <err> os: ARCH_EXCEPT with reason 3
[00:00:04.634,490] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000006  r2/a3:  0x00000005
[00:00:04.634,521] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x0001bf6d
[00:00:04.634,521] <err> os:  xpsr:  0x41000011
[00:00:04.634,552] <err> os: Faulting instruction address (r15/pc): 0x0001bf78
[00:00:04.634,582] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:04.634,582] <err> os: Fault during interrupt handling
[00:00:04.634,613] <err> os: Current thread: 0x20001e88 (unknown)
[00:00:05.093,048] <err> os: Halting system

  • Target platform is Nordic nRF52833. periodic_adv is programmed on a custom board with an nRF52833 and a few peripheral (all tested ok with other zephyr sample code). periodic_sync is running on the nRF52833DK.
  • I have tried to switch the role of the custom board and the DK : it's always the periodic_sync role that fails.
  • I'm using the nRF Connect SDK v2.1.0 as a VS Code extension, installed through the nRF Connect desktop application.

Below is the complete log ouput. The code has been modified to not print each scanned device information by commenting this line : https://github.com/zephyrproject-rtos/zephyr/blob/zephyr-v3.1.0/samples/bluetooth/periodic_sync/src/main.c#L82.

00> .*** Booting Zephyr OS build v3.1.99-ncs1  ***
00> Starting Periodic Advertising Synchronization Demo
00> Checking LED device...done.
00> Configuring GPIO pin...done.
00> [00:00:00.000,396] <inf> sdc_hci_driver: SoftDevice Controller build revision: 
00>                                          f2 e7 5f 6f 23 a2 f3 e8  10 2f c3 35 9e d7 1d fe |.._o#... ./.5....
00>                                          8f 80 42 f9                                      |..B.             
00> [00:00:00.002,929] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
00> [00:00:00.002,960] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
00> [00:00:00.002,960] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 242.24551 Build 4087489391
00> [00:00:00.003,936] <inf> bt_hci_core: Identity: C7:4B:0D:AB:50:FC (random)
00> [00:00:00.003,967] <inf> bt_hci_core: HCI: version 5.3 (0x0c) revision 0x11a7, manufacturer 0x0059
00> [00:00:00.003,967] <inf> bt_hci_core: LMP: version 5.3 (0x0c[0m
00> Scan callbacks register...success.
00> Periodic Advertising callbacks register...Success.
00> Start scanning...success.
00> Start blinking LED...
00> Waiting for periodic advertising...
00> PERIODIC FOUNDFound periodic advertising.
00> Creating Periodic Advertising Sync...success.
00> Waiting for periodic sync...
00> SoftDevice Controller ASSERT: 12, 136
00> [00:00:04.634,460] <err> os: ***** HARD FAULT *****
00> [00:00:04.634,460] <err> os:   Fault escalation (see below)
00> [00:00:04.634,490] <err> os: ARCH_EXCEPT with reason 3
00> 
00> [00:00:04.634,490] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000006  r2/a3:  0x00000005
00> [00:00:04.634,521] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x0001bf6d
00> [00:00:04.634,521] <err> os:  xpsr:  0x41000011
00> [00:00:04.634,552] <err> os: Faulting instruction address (r15/pc): 0x0001bf78
00> [00:00:04.634,582] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
00> [00:00:04.634,582] <err> os: Fault during interrupt handling
00> 
00> [00:00:04.634,613] <err> os: Current thread: 0x20001e88 (unknown)
00> [00:00:05.093,048] <err> os: Halting system

  • OS: (e.g. Linux, MacOS, Windows) : Windows 10
  • Toolchain (e.g Zephyr SDK, ...) : nRF Connect SDK v2.1.0
  • Commit SHA or Version used : Zephyr folder of the nRF Connect SDK has tag v3.1.99-ncs1

The prj.conf file have been modified to include RTT debugging and the config for the other peripherals:

CONFIG_BT=y
CONFIG_BT_OBSERVER=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_PER_ADV_SYNC=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_DEVICE_NAME="Test Periodic Advertising Sync"

# General purpose IO controller
CONFIG_GPIO=y

# Power Mangement
CONFIG_PM=y
CONFIG_PM_DEVICE=y

# SPI FLASH
CONFIG_SPI=y
CONFIG_FLASH=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_IDLE_IN_DPD=y

# Accelerometer and TH sensor
CONFIG_I2C=y
CONFIG_SENSOR=y

# RTT debug console
CONFIG_CONSOLE=y
CONFIG_SERIAL=n
CONFIG_RTT_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_SEGGER_RTT_MEMCPY_USE_BYTELOOP=y
CONFIG_CBPRINTF_FP_SUPPORT=y
CONFIG_LOG=y

# Disable optimizations for easier debugging
CONFIG_DEBUG=y
CONFIG_DEBUG_INFO=y

Related