nRF9151 + XIAO BLE board — HCI UART connection error (Controller unresponsive, opcode 0x0C03 timeout)

Hi Nordic team,

I’m trying to use my nRF9151 DK as a Bluetooth Host (Zephyr) connected over UART (H:4) to an external Seeed XIAO BLE board (acting as the Controller).
My goal is to use the nRF9151 as the Bluetooth Host while the XIAO provides the HCI interface.

hci_uart with no flow-control has been successfully installed in xiao board with the output:  

SEGGER J-Link V8.72 - Real time terminal output
SEGGER J-Link V8.0, SN=-1
Process: JLink.exe
*** Booting nRF Connect SDK v3.0.2-89ba1294ac9b ***
*** Using Zephyr OS v4.0.99-f791c49f492c ***
[00:00:00.001,831] <err> hci_uart: Failed to enable USB
[00:00:00.002,044] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision:
89 9a 50 8a 95 01 9c 58 fc 39 d2 c1 10 04 ee 02 |..P....X .9......
64 ce 25 be |d.%.
[00:00:00.002,502] <inf> bt_hci_raw: Bluetooth enabled in RAW mode
Thread analyze:
HCI uart TX : STACK: unused 1352 usage 184 / 1536 (11 %); CPU: 1 %
: Total CPU cycles used: 1
thread_analyzer : STACK: unused 560 usage 464 / 1024 (45 %); CPU: 16 %
: Total CPU cycles used: 15
usbd_workq : STACK: unused 832 usage 192 / 1024 (18 %); CPU: 0 %
: Total CPU cycles used: 0
sysworkq : STACK: unused 320 usage 192 / 512 (37 %); CPU: 0 %
: Total CPU cycles used: 1
MPSL Work : STACK: unused 832 usage 192 / 1024 (18 %); CPU: 0 %
: Total CPU cycles used: 1
usbworkq : STACK: unused 832 usage 192 / 1024 (18 %); CPU: 0 %
: Total CPU cycles used: 0
logging : STACK: unused 976 usage 48 / 1024 (4 %); CPU: 0 %
: Total CPU cycles used: 0
idle : STACK: unused 272 usage 48 / 320 (15 %); CPU: 0 %
: Total CPU cycles used: 0
main : STACK: unused 1432 usage 616 / 2048 (30 %); CPU: 50 %
: Total CPU cycles used: 74
ISR0 : STACK: unused 1120 usage 928 / 2048 (45 %)

On nrf9151dk side, currently this code has been used:  

For CMakeLists.txt:  

# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(blinky)

target_sources(app PRIVATE src/main.c)
 
Proj.conf has content:  
CONFIG_BT=y
CONFIG_BT_HCI=y
CONFIG_BT_HCI_RAW=n

# Disable local BT controller (using external Xiao)
CONFIG_BT_CTLR=n
# Option 1: Try enabling BT peripheral (might enable bt_enable)
CONFIG_BT_PERIPHERAL=y

# Option 2: Enable BT libraries explicitly
CONFIG_BT_BROADCASTER=y
CONFIG_BT_OBSERVER=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_LOG=y
CONFIG_BT_HCI_CORE_LOG_LEVEL_DBG=y

# Device name
CONFIG_BT_DEVICE_NAME="nRF9151_Host"
nrf9151dk_nrf9151_ns.overlay file has:  
/ {
    chosen {
        zephyr,bt-hci = &bt_hci_uart;
    };
};

&uart2 {
    status = "okay";
    current-speed = <1000000>; // Match the Xiao board's HCI UART baudrate
    // hw-flow-control;
    pinctrl-0 = <&uart2_default>;
    pinctrl-1 = <&uart2_sleep>;
    pinctrl-names = "default", "sleep";
    bt_hci_uart: bt_hci_uart {
            compatible = "zephyr,bt-hci-uart";
            status = "okay";
        };
};

&pinctrl {
    uart2_default: uart2_default {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 6)>,
                    <NRF_PSEL(UART_RX, 0, 7)>;
                    // <NRF_PSEL(UART_RTS, 0, 2)>,
                    // <NRF_PSEL(UART_CTS, 0, 3)>;
        };
    };

    uart2_sleep: uart2_sleep {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 6)>,
                    <NRF_PSEL(UART_RX, 0, 7)>;
                    // <NRF_PSEL(UART_RTS, 0, 2)>,
                    // <NRF_PSEL(UART_CTS, 0, 3)>;
        };
    };
};
main.c:
#include <zephyr/kernel.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/sys/printk.h>
#include <zephyr/bluetooth/hci.h>

void main(void)
{
    int err = bt_enable(NULL);
    if (err) {
        printk("Bluetooth init failed (err %d)\n", err);
        return;
    }
    printk("Bluetooth initialized\n");
    // Add your application logic here (e.g., scanning, connecting, etc.)
}
Right now connection is:  
  • nRF9151 P0.06 → XIAO RX P1.12
  • nRF9151 P0.07 → XIAO TX P1.11
  • GND common
  • (no RTS/CTS for now)

After all this setup , I'm getting:  

*** Booting nRF Connect SDK v3.0.2-89ba1294ac9b ***
*** Using Zephyr OS v4.0.99-f791c49f492c ***
[00:00:00.298,583] <dbg> bt_hci_core: bt_hci_cmd_create: opcode 0x0c03 param_len 0
[00:00:00.298,614] <dbg> bt_hci_core: bt_hci_cmd_create: buf 0x20011070
[00:00:00.298,614] <dbg> bt_hci_core: bt_hci_cmd_send_sync: buf 0x20011070 opcode 0x0c03 len 3
[00:00:00.298,645] <dbg> bt_hci_core: bt_tx_irq_raise: kick TX
[00:00:00.298,675] <dbg> bt_hci_core: tx_processor: TX process start
[00:00:00.298,675] <dbg> bt_hci_core: hci_core_send_cmd: fetch cmd
[00:00:00.298,706] <dbg> bt_hci_core: hci_core_send_cmd: Sending command 0x0c03 (buf 0x20011070) to driver
[00:00:00.298,706] <dbg> bt_hci_core: bt_send: buf 0x20011070 len 3 type 1
[00:00:00.298,767] <dbg> bt_hci_core: bt_tx_irq_raise: kick TX
[00:00:00.298,797] <dbg> bt_hci_core: tx_processor: TX process start
ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:438
Controller unresponsive, command opcode 0x0c03 timeout with err -11
[00:00:10.299,011] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x00000002
[00:00:10.299,041] <err> os: r3/a4: 0x00000003 r12/ip: 0x00000010 r14/lr: 0x0000bf13
[00:00:10.299,041] <err> os: xpsr: 0x01000000
[00:00:10.299,041] <err> os: Faulting instruction address (r15/pc): 0x0000bf22
[00:00:10.299,102] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:10.299,133] <err> os: Current thread: 0x2000d468 (unknown)
[00:00:10.358,337] <err> os: Halting system

Parents
  • Hi,

    hci_uart with no flow-control has been successfully installed in xiao board with the output
    <err> hci_uart: Failed to enable USB

    Have you used this hci_uart sample on your XIAO board?
    Did you try to enable USB? Can you elaborate on this?
    Have you modified hci_uart sample in any way? Can you provide more information?
    Did you use RTT logging on XIAO board?

    Best regards,
    Dejan

Reply
  • Hi,

    hci_uart with no flow-control has been successfully installed in xiao board with the output
    <err> hci_uart: Failed to enable USB

    Have you used this hci_uart sample on your XIAO board?
    Did you try to enable USB? Can you elaborate on this?
    Have you modified hci_uart sample in any way? Can you provide more information?
    Did you use RTT logging on XIAO board?

    Best regards,
    Dejan

Children
  • Hi Dejan,

    Yes, I’m using the hci_uart sample(from nrf connect samples) on the XIAO BLE board, which is based on the nRF52840 SoC. No I did'nt enable USB and has no idea what is has to do with this? yes, i've modified the hci_uart sample for the xiao board as build configurations is'nt compatible with xiao board, so i've modify its overlay content as: 

    /* SPDX-License-Identifier: Apache-2.0 */
    
    / {
        chosen {
            zephyr,bt-c2h-uart = &uart1;
        };
    };
    
    &uart1 {
        status = "okay";
        current-speed = <1000000>;  /* 1Mbps - HCI typical */
        
        pinctrl-0 = <&uart1_default>;
        pinctrl-1 = <&uart1_sleep>;
        pinctrl-names = "default", "sleep";
        // hw-flow-control;
    };
    
    &pinctrl {
        uart1_default: uart1_default {
            group1 {
                psels = <NRF_PSEL(UART_TX, 1, 11)>,
                        <NRF_PSEL(UART_RX, 1, 12)>;
                        // <NRF_PSEL(UART_RTS, 0, 28)>,
                        // <NRF_PSEL(UART_CTS, 0, 29)>;
                        // <NRF_PSEL(UART_RTS, 0, 26)>,
                        // <NRF_PSEL(UART_CTS, 0, 27)>; /* Adjust if available */
            };
        };
    
        uart1_sleep: uart1_sleep {
            group1 {
                psels = <NRF_PSEL(UART_TX, 1, 11)>,
                        <NRF_PSEL(UART_RX, 1, 12)>;
                        // <NRF_PSEL(UART_RTS, 0, 28)>,
                        // <NRF_PSEL(UART_CTS, 0, 29)>;
            };
        };
    };
    
    /* Disable conflicting peripherals */
    &i2c0 {
        status = "disabled";
    };
    
    &spi0 {
        status = "disabled";
    };
    
    &uart0 {
        status = "disabled";
    };
    
    I’ve disabled hardware flow control in the overlay.
    proj.conf has content:  
    CONFIG_CONSOLE=n
    CONFIG_STDOUT_CONSOLE=n
    CONFIG_UART_CONSOLE=n
    CONFIG_GPIO=y
    CONFIG_SERIAL=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_BT=y
    CONFIG_BT_HCI_RAW=y
    CONFIG_BT_HCI_RAW_H4=y
    CONFIG_BT_HCI_RAW_H4_ENABLE=y
    CONFIG_BT_BUF_ACL_RX_SIZE=255
    CONFIG_BT_BUF_CMD_TX_SIZE=255
    CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255
    CONFIG_BT_CTLR_ASSERT_HANDLER=y
    CONFIG_BT_MAX_CONN=16
    CONFIG_BT_WAIT_NOP=y
    CONFIG_BT_CTLR_DTM_HCI=y
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
    
    # Workaround: Unable to allocate command buffer when using K_NO_WAIT since
    # Host number of completed commands does not follow normal flow control.
    CONFIG_BT_BUF_CMD_TX_COUNT=10
    CONFIG_LOG=y
    I’ve only made minimal modifications:
    • Changed UART pins in the overlay to match the XIAO BLE board’s TX/RX pins.
    • Disabled flow control in both prj.conf and overlay.

    I've also tried the same configurations with nrf52dk(with changed overlay) but still getting same results.

  • Hi,

    In case of disabled flow control, could it be that UART flow control is left enabled on the controller side?
    Is there any difference if you enable flow control on both sides? 

    You could try to examine chip's reset and UART lines for better insight into what might be happening.

    Best regards,
    Dejan

Related