UART configuration for nRF5340DK (controller) and nRF5340 Audio DK (host)

Hi All,

I flashed an nRF5340 DK board with a samples/bluetooth/hci_uart image and one more nRF5340 Audio DK with a samples/bluetooth/peripheral image.

I have not made any DTS changes for the nRF5340 DK board (using it as a controller). Below are the changes made in the nRF5340 Audio DK DTS file,

chosen {
		zephyr,bt-uart = &uart3;
};

&uart3 {
	status = "okay";
	current-speed = <115200>;
	pinctrl-0 = <&uart3_default>;
	pinctrl-1 = <&uart3_sleep>;
	pinctrl-names = "default", "sleep";
};

uart3_default: uart3_default {
	group1 {
		psels = <NRF_PSEL(UART_TX, 1, 12)>,
		<NRF_PSEL(UART_RTS, 1, 11)>;
	};
	group2 {
		psels = <NRF_PSEL(UART_RX, 1, 13)>,
		<NRF_PSEL(UART_CTS, 1, 1)>;
		bias-pull-up;
	};
}; 

uart3_sleep: uart3_sleep {
	group1 {
		psels = <NRF_PSEL(UART_TX, 1, 12)>,
			<NRF_PSEL(UART_RX, 1, 13)>,
			<NRF_PSEL(UART_RTS, 1, 11)>,
			<NRF_PSEL(UART_CTS, 1, 1)>;
			low-power-enable;
	};
};

I connected jumper wires between these two boards and the jumper configs are as follows:

Pin nRF5340 DK nRF5340 Audio DK
Tx P1.12 P1.0
Rx P1.13 P1.1
RTS P1.11 P0.11
CTS P1.1 P0.10

With the above configs, I am getting HCI timeout in the nRF5340 Audio DK board (flashed with samples/bluetooth/peripheral)

ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:331
        command opcode 0x0c03 timeout with err -11

Please help me resolve this error and let me know if I am doing anything wrong. I appreciate any help you can provide.

  • Hi Edvin, I have gone through a few devzone tickets and now understand what you mean by "Have you made sure no other enabled peripherals are using the same GPIOs?"

    Yes, I changed the nrf5340_audio_dk.overlay file.

    ```

    / {
        chosen {
            zephyr,bt-uart = &uart2;
        };
    };

    &pinctrl {
        uart2_default: uart2_default {
            group1 {
                psels = <NRF_PSEL(UART_TX, 1, 1)>,
                    <NRF_PSEL(UART_RTS, 0, 31)>;
            };
            group2 {
                psels = <NRF_PSEL(UART_RX, 1, 0)>,
                    <NRF_PSEL(UART_CTS, 1, 14)>;
                bias-pull-up;
            };
        };
    };

    &uart2 {
        status = "okay";
        pinctrl-0 = <&uart2_default>;
        pinctrl-names = "default";
        current-speed = <115200>;
    };

    &led1_blue {
        status = "disabled";
    };

    &led2_green {
        status = "disabled";
    };

    &led3_green {
        status = "disabled";
    };

    &rgb1_red {
        status = "disabled";
    };

    &rgb1_green {
        status = "disabled";
    };

    &rgb1_blue {
        status = "disabled";
    };

    &button3 {
        status = "disabled";
    };
    ```
    I am not using P1.11 as it is routed to the net core using gpio_fwd. I have replaced P1.11 with P0.31.


    I came across readme.rst (hci_uart). Here it is mentioned to run hci_uart in the net core with uart1 for bt-c2h-uart as uart0 can be used for console and shell.
    I am wondering how to enable uart1 for the net core. I couldn't find a way to enable uart1 instance for nRF5340 network core. Please let me know how to enable this instance, thanks in advance!
  • Hello,

    I don't follow. You have forwarded P1.11 to the net core? So you replaced P1.11 with P0.31 in the nRF5340 DK now? Does that work? Do you see any data coming out throug the UART from the DK then? (check with a logic analyzer).

    BR,

    Edvin

Related