cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157F How to configure USART2 / BT LBEE5HY1MW with no hardware flow control

farid
Associate II

We are using MuRata Module LBEE5HY1MW on our custom board based on OSD32MP157F. 

We are using Octavo Systems OSD32MP1 Debian SDK v3.0 based on Debian 11 and OpenSTLinux Kernel version 5.10.10.

We've integrated following 1MW firmware files from murata github to OSD32MP1 Debian SDK.

Here are the hardware pin connections between 1MW BT module and SiP:

1MW BT module OSD32MP157F SiP

  • BT_UART_RTS => USART2_RTS (PA1)
  • BT_UART_CTS => USART2_CTS (PE15)
  • BT_UART_RXD => USART2_TX (PA2)
  • BT_UART_TXD => USART2_RX (PA3)

We noticed that RTS/CTS pin connection is wrong and we can not change it on the current board version.

We want to configure the USART2/BT with “no hardware flow control�? which require RTS/CTS signals to be pulled active low.

To integrate 1MW module on USART2 port, we’ve made following changes in kernel device-tree, removed RTS/CTS from pinctrl block and applied pull-down in the bluetooth block.

&pinctrl {
 
	usart2_pins_mx: usart2_mx-0 {
		pins1 {
			pinmux = <STM32_PINMUX('A', 3, AF7)>; /* USART2_RX */
			bias-disable;
		};
		pins2 {
			pinmux = <STM32_PINMUX('A', 2, AF7)>; /* USART2_TX */
			bias-disable;
			drive-push-pull;
			slew-rate = <0>;
		};
	};
 
	usart2_sleep_pins_mx: usart2_sleep_mx-0 {
		pins {
			pinmux = <STM32_PINMUX('A', 2, ANALOG)>, /* USART2_TX */
					 <STM32_PINMUX('A', 3, ANALOG)>; /* USART2_RX */
		};
	};
};
 
/* Bluetooth */
&usart2{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&usart2_pins_mx>;
	pinctrl-1 = <&usart2_sleep_pins_mx>;
	status = "okay";
 
	bluetooth {
		shutdown-gpios = <&gpioe 10 GPIO_ACTIVE_HIGH>;
		gpios = <&gpioe 15 GPIO_PULL_DOWN>, /* PE15 USART2_CTS apply pull-down*/
			     <&gpioa 1 GPIO_PULL_DOWN>; /* PA1 USART2_RTS apply pull-down */
		compatible = "brcm,bcm4345c5";
		max-speed = <3000000>;
		vbat-supply = <&v3v3_eth>;
		vddio-supply = <&v3v3>;
	};
};

Wi-Fi is working OK, but BT is failing to initialize. We are getting following timeout error during initialization.

debian@device123:~$ dmesg | grep -i blue

[ 16.922303] Bluetooth: Core ver 2.22

[ 16.928872] Bluetooth: HCI device and connection manager initialized

[ 17.020394] Bluetooth: HCI socket layer initialized

[ 17.023853] Bluetooth: L2CAP socket layer initialized

[ 17.028934] Bluetooth: SCO socket layer initialized

[ 18.018175] Bluetooth: HCI UART driver ver 2.3

[ 18.021322] Bluetooth: HCI UART protocol H4 registered

[ 18.045556] Bluetooth: HCI UART protocol Broadcom registered

[ 20.410427] Bluetooth: hci0: command 0xfc18 tx timeout

[ 28.650237] Bluetooth: hci0: BCM: failed to write update baudrate (-110)

[ 28.655497] Bluetooth: hci0: Failed to set baudrate

[ 30.730307] Bluetooth: hci0: command 0x0c03 tx timeout

[ 38.890247] Bluetooth: hci0: BCM: Reset failed (-110)

debian@device123:~$ 

debian@device123:~$ sudo hciconfig

hci0: Type: Primary Bus: UART

BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0

DOWN 

RX bytes:0 acl:0 sco:0 events:0 errors:0

TX bytes:14 acl:0 sco:0 commands:2 errors:0

debian@device123:~$ 

Any help resolving this issue is much appreciated.

Thanks for the support.

/Farid

1 ACCEPTED SOLUTION

Accepted Solutions
farid
Associate II

Setting the pull-down for RTS/CTS pins in the pinmux section fixed the problem. Bluetooth is working now.

View solution in original post

3 REPLIES 3
farid
Associate II

Setting the pull-down for RTS/CTS pins in the pinmux section fixed the problem. Bluetooth is working now.

Hello @farid​ ,

Thank you for your feedback and your solution on the topic. Do not hesitate to set your solution as "best answer" as it can help other members of the community.

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi @Erwan SZYMANSKI ,

Can you please help me out on this, stm32mp157a-uart-with-lbee5hy1mw-bluetooth-reset-failed-issue-issue 

Thanks,

Balaji G.