Hard Fault Zephyr during scan with shell BLE command

HI,

I have an error that occured during scan with shell command :

[00:02:04.392,181] <err> sdc_hci_driver: SoftDevice Controller ASSERT: 50, 5399
[00:02:04.392,211] <err> os: ***** HARD FAULT *****
[00:02:04.392,211] <err> os:   Fault escalation (see below)
[00:02:04.392,242] <err> os: ARCH_EXCEPT with reason 3

[00:02:04.392,242] <err> os: r0/a1:  0x00000003  r1/a2:  0x01884dce  r2/a3:  0x01887c35
[00:02:04.392,272] <err> os: r3/a4:  0x00000001 r12/ip:  0xffffffff r14/lr:  0x0004d94f
[00:02:04.392,272] <err> os:  xpsr:  0x61000011
[00:02:04.392,272] <err> os: Faulting instruction address (r15/pc): 0x0004a106
[00:02:04.392,303] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:02:04.392,303] <err> os: Fault during interrupt handling

[00:02:04.392,333] <err> os: Current thread: 0x20003e78 (idle)
[00:02:04.523,834] <err> fatal_error: Resetting system

The first line change sometimes it's : <err> mpsl_init: MPSL ASSERT: 112, 2846

or also :

<err> sdc_hci_driver: SoftDevice Controller ASSERT: 53, 2663

There isn't error when i connect or use gatt command but juste error with the scan.

And i have another question on another topic, it's about the name of a peripheral device, the name appear when the peripheral is in 1M PHY but he don't apprear when the device is in Coded PHY, do you know why ?

regards,

Py

  • Hi there,

    Which NCS version are you using, master branch? 

    The assert indicates that something is not correct with your configs, can you share your project config file?

    And i have another question on another topic, it's about the name of a peripheral device, the name appear when the peripheral is in 1M PHY but he don't apprear when the device is in Coded PHY, do you know why ?

    Can you make a new ticket for this problem?

    regards

    Jared 

  • Hi,

    I use NCS version 2.0.0.

    Here there is my Config.

    CONFIG_CONSOLE_HANDLER=y
    CONFIG_SHELL=y
    CONFIG_FLASH_SHELL=y
    
    CONFIG_DYNAMIC_INTERRUPTS=y
    
    CONFIG_NRFX_TIMER0=y
    
    # Enable the BT NUS shell
    CONFIG_SHELL_BT_NUS=y
    
    CONFIG_SHELL_BACKEND_SERIAL=y
    #CONFIG_HAS_HW_NRF_RADIO_IEEE802154=y
    
    CONFIG_BT_MAX_CONN=5
    CONFIG_MPSL=y
    #CONFIG_TEST=y
    #CONFIG_TEST_LOGGING_DEFAULTS=n
    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_CENTRAL=y
    #CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_PRIVACY=y 
    CONFIG_BT_SMP=y
    CONFIG_BT_SIGNING=y
    #CONFIG_BT_FIXED_PASSKEY=y
    #CONFIG_BT_ATT_PREPARE_COUNT=32
    
    CONFIG_BT_GATT_DM=y
    CONFIG_BT_GATT_CLIENT=y
    
    CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
    
    #CONFIG_BT_TINYCRYPT_ECC=y
    
    CONFIG_BT_SHELL=y
    CONFIG_BT_DEVICE_NAME="test shell"
    CONFIG_BT_DEVICE_NAME_DYNAMIC=y
    CONFIG_BT_L2CAP_TX_BUF_COUNT=10
    CONFIG_BT_CTLR_EXT_SCAN_FP=y
    
    CONFIG_BT_EATT=y
    CONFIG_BT_L2CAP_ECRED=y
    
    CONFIG_BT_GATT_DYNAMIC_DB=y
    #CONFIG_BT_HRS=y
    CONFIG_BT_FILTER_ACCEPT_LIST=y
    CONFIG_BT_REMOTE_INFO=y
    CONFIG_BT_REMOTE_VERSION=y
    CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y
    
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    CONFIG_BT_CTLR_PHY_CODED=y
    CONFIG_BT_CTLR_SYNC_PERIODIC=y
    
    CONFIG_BT_SCAN=y
    CONFIG_BT_SCAN_FILTER_ENABLE=y
    CONFIG_BT_SCAN_UUID_CNT=1
    
    
    
    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_EXT_ADV_LEGACY_SUPPORT=y
    CONFIG_BT_PER_ADV=y
    CONFIG_BT_PER_ADV_SYNC=y
    
    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    CONFIG_BT_AUTO_DATA_LEN_UPDATE=y
    
    CONFIG_BT_USER_PHY_UPDATE=y
    #CONFIG_BT_AUTO_PHY_UPDATE=y
    
    #CONFIG_BT_ISO_BROADCASTER=y
    #CONFIG_BT_ISO_SYNC_RECEIVER=y
    #CONFIG_BT_ISO_UNICAST=y
    
    
    #CONFIG_MAIN_STACK_SIZE=4096
    
    
    CONFIG_BT_CTLR_ADV_EXT=y
    CONFIG_BT_LL_SW_SPLIT=y
    CONFIG_BT_BROADCASTER=y
    CONFIG_BT_OBSERVER=y
    #CONFIG_DESKTOP_BLE_QOS_ENABLE=y
    CONFIG_BT_LL_SOFTDEVICE=y
    #CONFIG_QOS=y
    #CONFIG_ZERO_LATENCY_IRQS=y
    CONFIG_BT_CTLR_SDC_LLPM=y
    CONFIG_BT_CTLR_SDC_SCAN_BUFFER_COUNT= 20
    

    The only things that don't work is the scan.

    I tried to increase the stacks but it don't change anything.

    Reagrds

    py

  • Hi,

    I discussed this with our developers and here is the feedback:

    1. Did you enable LLPM intentionally? Do you use it in your application? Not sure if this will work with shell. 
    2. Which board are you using? nRF52840 DK, Dongle or custom board?
    3. Exactly which sample are you using? Are you using the shell sample from ncs/zephyr/tests/bluetooth/shell?
    4. We tried to reproduce your issue by using shell sample and your kconfig and it didn't assert. Can you specify what shell commands that you have used, so to that we can use the same when we try to reproduce your issue? (see below for example)
      ncs-int: nrf] west update
      === updating zephyr (zephyr):
      M   tests/bluetooth/shell/prj.conf
      HEAD is now at 0a904d0c17 [nrf fromlist] tfm: Add option for implementation custom reset handler with TF-M
      === updating mcuboot (bootloader/mcuboot):
      HEAD is now at 129b6312 [nrf noup] bootutil: loader: Add check for netcore addr if NSIB enabled
      === updating mbedtls-nrf (mbedtls):
      HEAD is now at b36261c55 [nrf noup]: Fix unset key bits for nrf_cc3xx v0.9.14
      === updating nrfxlib (nrfxlib):
      HEAD is now at 1296d445 doc: version update for NCS 2.0.0
      $ west build -b nrf52840dk_nrf52840
      $ west flash
      $ sudo minicom -D /dev/ttyACM9
      uart:~$ bt init 
      Bluetooth initialized
      Settings Loaded
      [00:00:11.907,928] <inf> fs_nvs: 8 Sectors of 4096 bytes
      [00:00:11.907,958] <inf> fs_nvs: alloc wra: 0, fa0
      [00:00:11.907,989] <inf> fs_nvs: data wra: 0, 64
      [00:00:11.908,630] <inf> sdc_hci_driver: SoftDevice Controller build revision: 
                                               33 78 2a 18 20 f5 61 61  a6 8b 77 60 62 83 39 2a |3x*. .aa ..w`b.9*
                                               7c f1 14 e4                                      ||...             
      [00:00:11.913,635] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
      [00:00:11.913,665] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
      [00:00:11.913,665] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 51.10872 Build 1643454488
      [00:00:11.914,367] <inf> bt_hci_core: No ID address. App must call settings_load()
      [00:00:11.944,610] <inf> bt_hci_core: Identity: D3:E8:54:AA:01:B0 (random)
      [00:00:11.944,641] <inf> bt_hci_core: HCI: version 5.3 (0x0c) revision 0x1136, manufacturer 0x0059
      [00:00:11.944,641] <inf> bt_hci_core: LMP: version 5.3 (0x0c) subver 0x1136
      uart:~$ bt scan on
      Bluetooth active scan enabled
      [DEVICE]: 5D:9F:44:D9:1B:B2 (random), AD evt type 0, RSSI -51  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
      [DEVICE]: 5D:9F:44:D9:1B:B2 (random), AD evt type 4, RSSI -49  C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
      [DEVICE]: C1:1B:F3:1F:67:3D (random), AD evt type 0, RSSI -75  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
      [DEVICE]: C1:1B:F3:1F:67:3D (random), AD evt type 4, RSSI -74  C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
      [DEVICE]: 38:E9:18:57:FA:9F (random), AD evt type 3, RSSI -57  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
      [DEVICE]: C1:1B:F3:1F:67:3D (random), AD evt type 0, RSSI -71  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 0xff
      ...
      ...
    5. There was a fix for a similar bug that has been added to the Master branch. Can you try to reproduce your issue using the Master branch?

    regards

    Jared 

  • Hi,

    1. Yes i try options, but disable it change anything to the issue, i disable it and will see in the furture

    2. I use a custom board, but it's the same as nRF52840 DK, i use uart to communicate with serial port and not usb, in the futur i will need to use USB for the communication instead of UART. I saw that it's possible but it's not the issue here.

    3. Yes i use the shell sample from ncs/zephyr/tests/bluetooth/shell and i mix it with radio_test sample from nordic.

    4. I just use bt scan on, the same command as you..., but the issue occurs not directly, it occured 5-10 second after command and later if i do a coded scan ( there is less device in coded), I thought the fact that the assert came later in coded is related to the number of device detected in the scan.

    But now ii tried just ncs/zephyr/tests/bluetooth/shell and it's working, i don't understand why the part of radio test creat this assert.... ?

    I have exactly the same init as you (exept the identity but it's normal)

    5. What do you call master branch, update of zephyr ?

    regards,

    py

  • Hi,

    I find the issue it was this :

    static int radio_cmd_init(const struct device *dev)
    {
    	ARG_UNUSED(dev);
    
    	return radio_test_init(&test_config);
    }
    
    SYS_INIT(radio_cmd_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);

    But can you explain why tyhis create an assert ? the systeme work without it....

Related