STM32MP157C ODYSSEY Bluetooth: hci0: command 0x0c03 tx timeout

Hello. I’m trying to bring up Bluetooth of the AP6236 chip on the stm32mp157c-odyssey board on Debian 12 with Linux Core 6.6.48. With no luck so far…
Does anyone has any experience in this? Any guidance/advice would be really helpful :slight_smile:
This is what I have:

dmesg | grep Bluetooth

[   16.240645] Bluetooth: Core ver 2.22
[   16.248188] Bluetooth: HCI device and connection manager initialized
[   16.254550] Bluetooth: HCI socket layer initialized
[   16.259415] Bluetooth: L2CAP socket layer initialized
[   16.264432] Bluetooth: SCO socket layer initialized
[   16.640794] Bluetooth: HCI UART driver ver 2.3
[   16.658790] Bluetooth: HCI UART protocol H4 registered
[   16.686664] Bluetooth: HCI UART protocol Broadcom registered
[   17.044683] Bluetooth: hci0: BCM: chip id 94
[   17.050674] Bluetooth: hci0: BCM: features 0x2e
[   17.078064] Bluetooth: hci0: BCM43430A1
[   17.080641] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
[   17.208308] Bluetooth: hci0: BCM43430A1 'brcm/BCM43430A1.hcd' Patch
[   22.649202] Bluetooth: hci0: command 0x0c03 tx timeout
[   22.653035] Bluetooth: hci0: BCM: Reset failed (-110)


hciconfig -a

hci0:   Type: Primary  Bus: UART
        BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0
        DOWN 
        RX bytes:1159 acl:0 sco:0 events:127 errors:0
        TX bytes:30732 acl:0 sco:0 commands:128 errors:0
        Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
        Packet type: DM1 DH1 HV1 
        Link policy: 
        Link mode: PERIPHERAL ACCEPT 

stm32mp157c-odyssey.dts

&pinctrl {
	// usart1 pin configure
	usart1_pins_s: usart1-0 {
		pins1 {
			pinmux = <STM32_PINMUX('Z', 7, AF7)>, /* USART1_TX */
				<STM32_PINMUX('Z', 5, AF7)>; /* USART1_RTS */
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};
		pins2 {
			pinmux = <STM32_PINMUX('Z', 6, AF7)>, /* USART1_RX */
				<STM32_PINMUX('Z', 3, AF7)>; /* USART1_CTS_NSS */
			bias-disable;
		};
	};

	usart1_idle_pins_s: usart1-idle-0 {
		pins1 {
			pinmux = <STM32_PINMUX('Z', 7, ANALOG)>, /* USART1_TX */
				<STM32_PINMUX('Z', 3, ANALOG)>; /* USART1_CTS_NSS */
		};
		pins2 {
			pinmux = <STM32_PINMUX('Z', 5, AF7)>; /* USART1_RTS */
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};
		pins3 {
			pinmux = <STM32_PINMUX('Z', 6, AF7)>; /* USART1_RX */
			bias-disable;
		};
	};

	usart1_sleep_pins_s: usart1-sleep-0 {
		pins {
			pinmux = <STM32_PINMUX('Z', 7, ANALOG)>, /* USART1_TX */
				<STM32_PINMUX('Z', 5, ANALOG)>, /* USART1_RTS */
				<STM32_PINMUX('Z', 6, ANALOG)>, /* USART1_RX */
				<STM32_PINMUX('Z', 3, ANALOG)>; /* USART1_CTS_NSS */
		};
	};
};

/* Bluetooth */
&usart1 {
	pinctrl-names = "default", "sleep", "idle";
	pinctrl-0 = <&usart1_pins_s>;
	pinctrl-1 = <&usart1_sleep_pins_s>;
	pinctrl-2 = <&usart1_idle_pins_s>;
	uart-has-rtscts;
	status = "okay";

	bluetooth {
		host-wakeup-gpios = <&gpioh 3 GPIO_ACTIVE_HIGH>;
		device-wakeup-gpios = <&gpioh 8 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpioh 9 GPIO_ACTIVE_LOW>;
		compatible = "brcm,bcm43438-bt";
		max-speed = <3000000>;
		vbat-supply = <&v3v3>;
		vddio-supply = <&v3v3>;
	};
};

Hi there,

So I found this:
Bringing up the AP6236 Bluetooth on your

STM32MP157C-ODYSSEY board

on Debian requires ensuring the correct firmware is installed, the kernel configuration and device tree overlay are correct for the specific board, and that the Bluetooth services are enabled. The AP6236 is a Broadcom chip (BCM43438) and uses the brcmfmac and bcmdhd drivers.

Here is a guide to troubleshoot and enable the Bluetooth functionality:

  1. Verify Bluetooth Hardware Detection and Status

First, check if the kernel is detecting the Bluetooth hardware and if any obvious errors are present in the system logs.

  • Check systemctl status:
sudo systemctl status bluetooth

If it’s not active, enable and start it:

sudo systemctl enable bluetooth
sudo systemctl start bluetooth

Use rfkill to check if the device is soft or hard blocked

sudo apt install rfkill
sudo rfkill list
sudo rfkill unblock all

Check the kernel log for messages related to Bluetooth or “brcm” (Broadcom):smile:

dmesg | grep -i "Bluetooth"
dmesg | grep -i "brcm"
dmesg | grep -i "hci0"

Look for messages indicating missing firmware files (e.g., firmware not found or Reset failed (-110)), which is a common issue.

  1. Ensure Correct Firmware is Installed

The AP6236 chip (often identified as BCM43430A1 or BCM43438A1 in logs) requires specific firmware files (.hcd, .bin, .txt files) in /lib/firmware/brcm/.

  • Install the necessary Debian firmware package:
sudo apt install firmware-brcm80211
  • Verify the required files are present. The AP6236 usually needs files like brcm/BCM43430A1.hcd or similar. The exact filename may be specified in your dmesg output.
  • If the files are missing after installing the package, you may need to manually obtain the correct firmware and NVRAM files from the Seeed Studio GitHub documentation or the chip manufacturer and place them in /lib/firmware/brcm/.
  1. Check Kernel and Device Tree Configuration

For embedded boards like the STM32MP157C-ODYSSEY, the Bluetooth module is connected via UART, and its power/reset sequence is defined in the device tree source (DTS) file.

  • Custom Kernel/DTB: Since you are using a specific kernel version (6.6.48), ensure your kernel was compiled with the appropriate Broadcom Bluetooth drivers (CONFIG_BT_HCIUART_BCM in the kernel config).
  • Device Tree Overlay: The board’s specific DTS file (stm32mp157c-odyssey.dts) must contain the correct configuration for the Bluetooth UART and GPIO pins for power/reset.
  • The relevant section in the device tree should look something like this (check your specific file if you compiled the kernel):
&usart1 {
    // ... (pinctrl configurations)
    status = "okay";
    bluetooth {
        compatible = "brcm,bcm43438-bt"; // Or "brcm,bcm43430-bt"
        // ... (GPIO lines definitions)
    };
};

An incorrect device tree configuration (e.g., missing GPIO definitions or wrong compatible string) can lead to the “command tx timeout” errors seen in forums.

  1. Install User-Space Bluetooth Management Tools

Ensure you have the full Bluetooth software stack installed for managing connections.

  • Install core Bluetooth packages
sudo apt install bluez blueman
  • bluez provides the core Bluetooth stack, and blueman provides a graphical manager and necessary libraries.

Following these steps should help you identify and resolve the issue, most likely related to a missing firmware file or an incorrect device tree configuration.
HTH narrow it down.

Season’s Greetings :christmas_tree:
GL :santa_claus: PJ :magic_wand:

Thank you Chat GPT :slight_smile:

1 Like