jonathanCCC
Posts: 23
Joined: Thu Apr 21, 2016 7:56 am

Bluetooth device on UART1

Fri Jun 14, 2019 10:19 am

Hello,

I am facing a bluetooth initialization problem with UART1 on rpi 3 with raspbian lite.
I am trying to get working a Bluetooth/Wifi device from TI : the WL1835 module.

It is working on UART0 with GPIOS 14,15,16,17. I can see my device with hciconfig. But when I change my dts to use UART1 alt5 function on the same gpios, hciconfig returns with BD ADDRESS 00:00:00:00:00:00.
I saw that the performances of the miniuart are not the same as ttyAMA0, it may be the problem ? TI firmware set the baudrate at 3Mb for the bluetooth.

I tried the following configs :
in /boot/config.txt :
enable_uart=1
core_freq=250

And my dts for the wl1835 :

Code: Select all

// Enable SDIO for WL18xx interface via GPIOs 22-27. Enable uart pins for Bluetooth
/dts-v1/;
/plugin/;

/{
	compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";

	[email protected] {
		target = <&mmc>;
		sdio_mmc: __overlay__ {
			status = "okay";
			vmmc-supply = <&wlan_en_reg>;
			bus-width = <4>;
			pinctrl-names = "default";
			pinctrl-0 = <&sdio_pins>;
			brcm,overclock-50 = <0>;
			non-removable;
			cap-power-off-card;
			max-frequency=<1000000>;
			#address-cells = <1>;
			#size-cells = <0>;
			wlcore: [email protected] {
				compatible = "ti,wl1835";
				reg = <2>;
				interrupt-parent = <&gpio>;
				interrupts = <19 1>; /* 1 = rising edge, 2 = falling edge */
			};
		};
	};

	[email protected] {
		target = <&gpio>;
		__overlay__ {
			sdio_pins: sdio_pins {
				brcm,pins = <22 23 24 25 26 27 19>; /*SD1CLK SD1CMD SDID0 SDID1 SDID2 SDID3 IRQ */
				brcm,function = <7 7 7 7 7 7 0>; /* ALT3 = 7 = SD EMMC, 0 = input, 1 = output */
				brcm,pull = <2 2 2 2 2 2 1>; /* 0 = no pull, 1 = pull down, 2 = pull up */
			};
		};
	};

	[email protected] {
		target = <&soc>;
		__overlay__ {
			wlan_en_reg: fixedregulator0 {
				compatible = "regulator-fixed";
				regulator-name = "wlan-en-regulator";
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;

				// WLAN_EN GPIO Test
				gpio = <&gpio 5 2>; // pull up

				// WLAN card specific delay
				startup-delay-us = <70000>;
				enable-active-high;
			};
		};
	};

	[email protected] {
		target = <&uart1>;
		__overlay__ {
			pinctrl-names = "default";
			pinctrl-0 = <&uart1_pins>;
			status = "okay";

			bluetooth {
				compatible = "ti,wl1835-st";
				enable-gpios = <&gpio 6 2>;
			};
		};
	};

	[email protected] {
		target = <&gpio>;
		__overlay__ {
			uart1_pins: uart1_pins {
				brcm,pins = <14 15 16 17>; 
				brcm,function = <2 2 2 2>;
				brcm,pull = <2 0 0 2>; // up, nopull, nopull, up
			};
		};
	};

	[email protected] {
		target-path= "/aliases";
		__overlay__ {
			serial0 = "/soc/[email protected]";
                        serial1 = "/soc/[email protected]";
		};
	};

	__overrides__ {
		poll_once = <&sdio_mmc>,"non-removable?";
		bus_width = <&sdio_mmc>,"bus-width:0";
		sdio_overclock = <&sdio_mmc>,"brcm,overclock-50:0";
	};
};
Thank you for your help,
Best Regards,
Jonathan

Return to “Interfacing (DSI, CSI, I2C, etc.)”