2023-11-10 10:10 AM - edited 2023-11-13 07:50 AM
Hi there,
I am working on an OSD32MP157F custom board inspired by STM32MP157F-DK and Octavo Red boards. The pinout is very similar to the stm32mp157f-dk with the main difference that the Murata LBEE5kL1BX-883 is connected to sdmmc3 instead of sdmmc2 and that there is no ethernet peripheral on the board. Some time ago I attempted to configure the LBEE5kL1BX WiFi part and I faced an NVRAM configuration conflict as explained here. After updating bootargs3 on sdio.txt the WiFi firmware was able to load and Wlan0 interface is functioning as expected since then.
Last couple of days I attempted to enable Bluetooth on the same board too. After following Bluetooth Overview I enabled all necessary linux drivers including HCI UART driver, Bluetooth HighSpeed features etc. I also enabled Bluetooth on the dts following the BRCM documentation and the DK2 dts example. Main difference is the pinout is slightly different as seen on the dts below:
aliases {
serial3 = &usart2;
};
&usart2{
pinctrl-names = "default", "sleep";
pinctrl-0 = <&usart2_pins_mx>;
pinctrl-1 = <&usart2_sleep_pins_mx>;
uart-has-rtscts;
status = "okay";
bluetooth {
shutdown-gpios = <&gpioe 10 GPIO_ACTIVE_HIGH>;
compatible = "brcm,bcm43438-bt";
max-speed = <3000000>;
vbat-supply = <&v3v3>;
vddio-supply = <&v3v3>;
};
};
usart2_pins_mx: usart2_mx-0 {
pins1 {
pinmux = <STM32_PINMUX('D', 3, AF7)>, /* USART2_CTS */
<STM32_PINMUX('D', 6, AF7)>; /* USART2_RX */
bias-disable;
};
pins2 {
pinmux = <STM32_PINMUX('D', 4, AF7)>, /* USART2_RTS */
<STM32_PINMUX('D', 5, AF7)>; /* USART2_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
};
After enabling the dts entry and kernel modules, Bluetooth: Core ver 2.22 is initialised but ttySTM1 is not registered. I verified that the STM32 USART driver is initialised too, but with ttySTM0 as the only stm32-usart alias.
0.499403] stm32-usart 40010000.serial: interrupt mode for rx (no dma)
[ 0.499439] stm32-usart 40010000.serial: interrupt mode for tx (no dma)
[ 0.499474] 40010000.serial: ttySTM0 at MMIO 0x40010000 (irq = 44, base_baud = 4000000) is a stm32-usart
[ 1.746209] printk: console [ttySTM0] enabled
On the bluetooth relate part of the bootlog I can see
[ 0.125309] NET: Registered PF_BLUETOOTH protocol family
[ 0.125324] Bluetooth: HCI device and connection manager initialized
[ 0.125349] Bluetooth: HCI socket layer initialized
[ 0.125367] Bluetooth: L2CAP socket layer initialized
[ 0.125400] Bluetooth: SCO socket layer initialized
[ 0.394257] Bluetooth: HCI UART driver ver 2.3
[ 0.394272] Bluetooth: HCI UART protocol H4 registered
[ 0.394442] Bluetooth: HCI UART protocol Broadcom registered
[ 4.337316] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 4.536820] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
done
Saving random seed: [ 4.626974] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Sep 11 2018 09:22:09 version 7.45.98.65 (r707797 CY) FWID 01-b54727f
OK
Starting system message bus: done
Starting tee-supplicant: OK
Starting bluetoothd: OK
Starting network: OK
Starting dhcpcd...
I did attempted to update the firmware for both bluetooth and wifi as explained here and I realised that BCM43430A1.hcd is never loaded in LBEE5kL1BX. At the moment my main assumption is that the issue is related with the UART part either in HW or SW.
I probed the RX and TX pins of USART2 and I noticed there is no data exchange. The lines look constantly high but my logic analyzer has soft pull-up.
Any advice or ideas on how to proceed troubleshooting are highly appreciated.
Solved! Go to Solution.
2023-11-14 09:30 AM
After following the dts I noticed that one of the differences between UART4 (STM0) and USART2 (STM1) was that UART4 had DMA disabled. I followed further my dts and I noticed that both DMA1 and DMA2 were both assigned to M4.
&dma1 {
/*sram = <&dma_pool>;*/
status = "disabled";
};
&m4_dma1 {
status = "okay";
};
&dma2 {
/*sram = <&dma_pool>;*/
status = "disabled";
};
&m4_dma2 {
status = "okay";
};
After enabling DMA1 as below USART2 was binding on the stm32-usart module as expected.
&dma1 {
sram = <&dma_pool>;
status = "okay";
};
&m4_dma1 {
status = "disabled";
};
&dma2 {
/*sram = <&dma_pool>;*/
status = "disabled";
};
&m4_dma2 {
status = "okay";
};
2023-11-14 09:30 AM
After following the dts I noticed that one of the differences between UART4 (STM0) and USART2 (STM1) was that UART4 had DMA disabled. I followed further my dts and I noticed that both DMA1 and DMA2 were both assigned to M4.
&dma1 {
/*sram = <&dma_pool>;*/
status = "disabled";
};
&m4_dma1 {
status = "okay";
};
&dma2 {
/*sram = <&dma_pool>;*/
status = "disabled";
};
&m4_dma2 {
status = "okay";
};
After enabling DMA1 as below USART2 was binding on the stm32-usart module as expected.
&dma1 {
sram = <&dma_pool>;
status = "okay";
};
&m4_dma1 {
status = "disabled";
};
&dma2 {
/*sram = <&dma_pool>;*/
status = "disabled";
};
&m4_dma2 {
status = "okay";
};