NRF Connect SDK v 1.9.1 ASSERTION FAIL hci_core LTE_BLE_gateway

I am developing for a Thingy91 and NRF9160 DK

NCS v 1.9.1

I am using the LTE_BLE_Gateway sample using the NRF9160 as the Host and talking over HCI to the NRF52840 as a BLE slave device

It was working well when i was scanning for beacons but then i introduced the ability to advertise as a peripheral and receive connections from other devices. and then i started to see

ASSERTION FAIL [buf->len >= sizeof(*hdr)] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:437

Sometimes i can run it for 10 minutes without seeing this error other times it happens within a few seconds. It always seems to occur whenever i receive a connection..

After receiving the Connected Event

I have been looking throughout the forum and it seems like this is a common issue but none of the solutions help. they are also very old posts

Here is the trailing end end of the log from my device after running for about 10 minutes 

Saved Detection type: 2 mac: E1:BF:2C:03:B8:C6 counter: 26387 rssi: -78 time: 2022-04-03 22:19:38
Saved Detection type: 2 mac: C9:A2:96:5C:D1:B3 counter: 174745 rssi: -78 time: 2022-04-03 22:19:38
Saved Detection type: 2 mac: CD:B0:C7:C1:36:5A counter: 174743 rssi: -73 time: 2022-04-03 22:19:38
Saved Detection type: 2 mac: E7:BD:A6:8B:1B:89 counter: 174738 rssi: -65 time: 2022-04-03 22:19:38
Saved Detection type: 2 mac: FD:DD:81:EC:AE:3C counter: 174880 rssi: -58 time: 2022-04-03 22:19:38
Saved Detection type: 2 mac: DD:85:D3:60:E0:2E counter: 174735 rssi: -72 time: 2022-04-03 22:19:38
Saved Detection type: 2 mac: E5:8B:A7:A9:E3:EA counter: 124343 rssi: -58 time: 2022-04-03 22:19:39
Saved Detection type: 2 mac: C9:A2:96:5C:D1:B3 counter: 174745 rssi: -68 time: 2022-04-03 22:19:39
Saved Detection type: 2 mac: CD:B0:C7:C1:36:5A counter: 174743 rssi: -66 time: 2022-04-03 22:19:39
Saved Detection type: 2 mac: E7:BD:A6:8B:1B:89 counter: 174738 rssi: -61 time: 2022-04-03 22:19:39
Received Log: Device Connected
Received Log: Received write over preliminary char
Received Log: Received data over core service count: 60 legacy: 0
Failed to Parse Advert Counter
Saved Detection type: 1 mac: D0:C5:32:E0:95:0D counter: 0 rssi: -60 time: 2022-04-03 22:19:39
Received Log: Device Disconnected
Saved Detection type: 2 mac: FD:DD:81:EC:AE:3C counter: 174880 rssi: -59 time: 2022-04-03 22:19:39
Received Log: Device Connected
Received Log: ASSERTION FAIL [buf->len >= sizeof(*hdr)] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:437

I have made a little console app that receives data over UART and saves to a local db and prints logs.

it is receiving data from Beacon "Detection type 2" and Central tags are also connecting "Detection Type 1"

However you can see in the log that i have received a lot of beacon reads fine and one of the Central tags are fine but then another connects and we get that error.

  • Here is raw output from Putty where this error occured within a second of running


    *** Booting Zephyr OS build v2.7.99-ncs1-1 ***
    Flash regions Domain Permissions
    00 01 0x00000 0x10000 Secure rwxl
    02 31 0x10000 0x100000 Non-Secure rwxl

    Non-secure callable region 0 placed in flash region 1 with size 32.

    SRAM region Domain Permissions
    00 03 0x00000 0x08000 Secure rwxl
    04 31 0x08000 0x40000 Non-Secure rwxl

    Peripheral Domain Status
    00 NRF_P0 Non-Secure OK
    01 NRF_CLOCK Non-Secure OK
    02 NRF_RTC0 Non-Secure OK
    03 NRF_RTC1 Non-Secure OK
    04 NRF_NVMC Non-Secure OK
    05 NRF_UARTE1 Non-Secure OK
    06 NRF_UARTE2 Non-Secure OK
    07 NRF_TWIM2 Non-Secure OK
    08 NRF_SPIM3 Non-Secure OK
    09 NRF_TIMER0 Non-Secure OK
    10 NRF_TIMER1 Non-Secure OK
    11 NRF_TIMER2 Non-Secure OK
    12 NRF_SAADC Non-Secure OK
    13 NRF_PWM0 Non-Secure OK
    14 NRF_PWM1 Non-Secure OK
    15 NRF_PWM2 Non-Secure OK
    16 NRF_PWM3 Non-Secure OK
    17 NRF_WDT Non-Secure OK
    18 NRF_IPC Non-Secure OK
    19 NRF_VMC Non-Secure OK
    20 NRF_FPU Non-Secure OK
    21 NRF_EGU0 Non-Secure OK
    22 NRF_EGU1 Non-Secure OK
    23 NRF_EGU2 Non-Secure OK
    24 NRF_EGU3 Non-Secure OK
    25 NRF_EGU4 Non-Secure OK
    26 NRF_EGU5 Non-Secure OK
    27 NRF_DPPIC Non-Secure OK
    28 NRF_REGULATORS Non-Secure OK
    29 NRF_PDM Non-Secure OK
    30 NRF_I2S Non-Secure OK
    31 NRF_GPIOTE1 Non-Secure OK

    SPM: NS image at 0x10000
    SPM: NS MSP at 0x200257c8
    SPM: NS reset vector at 0x17c6d
    SPM: prepare to jump to Non-Secure image.
    *** Booting Zephyr OS build v2.7.99-ncs1-1 ***
    Started DMR 12 24
    Initializeing Logging transportInitialized peripheral Controller
    Beacon Controller Initialized
    Successfully started beacon controller
    Device Connected
    Received write over preliminary char
    Received data over core service count: 60 legacy: 0
    DATA>>57000B0205C40702D4A8D7ED5E9A020101090386060000000000003D0B3B010201330211000202040203CB02040603050900190603012C010302320003042C0103052C0103082C0103092C010207640508F29404000309B100
    Device Disconnected
    DATA>>3A000B0205C50702D74557C5EE150201020903E306000000000000200B071605FE8131AB0204160F185F05166E2AFC0803FF66050709504C54303033
    DATA>>3A000B0205B90702EDE7DD0A224E02010209032307000000000000200B071605FE0192A50204160F185F05166E2A8C0A03FF66050709504C54303033
    DATA>>3A000B0205B60702EAB60166513202010209033007000000000000200B071605FE81A0AA0204160F186305166E2AC40903FF66050709504C54303033
    Device Connected
    Received write over preliminary char
    Received data over core service count: 60 legacy: 0
    DATA>>57000B0205C40702D62CC510E23002010109036D070000000000003D0B3B010201330211000202040203CB02040603052102190603012C010302320003042C0103052C0103082C0103092C010207640508D99404000309B100
    Device Disconnected
    DATA>>3A000B0205BB0702D0C1748A1EE902010209039107000000000000200B071605FE81ADAA0204160F186405166E2AFC0803FF66050709504C54303033
    Device Connected
    ASSERTION FAIL [buf->len >= sizeof(*hdr)] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:437

  • Hello, 

    It was working well when i was scanning for beacons but then i introduced the ability to advertise as a peripheral

    What exactly did you introduce before you saw this issue?

    From the output you have this line:

    Failed to Parse Advert Counter

    Are you able to share your project? Have you edited nrf\samples\nrf9160\lte_ble_gateway alone, or did you also edit nrf\samples\bluetooth\hci_lpuart? 

    Kind regards,
    Øyvind

Related