Bluetooth on Technexion PICO-PI-IMX7

@jorisoffouga Thanks for this board integration!

Has anyone managed to get Bluetooth working?

It’s a pleasure.

No sorry. It does not seem like. I searched for a moment and I did not find a solution

If it can help anyone, I (finally) found how to enable Bluetooth.

You need to enable/reset the bluetooth controller using GPIO:

echo 114 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio114/direction
cd /sys/class/gpio/gpio114
echo 1 > value && sleep 1 && echo 0 > value && echo 1 > value

There is probably a better way to do this, through rfkill, but I didn’t know anything about kernels and yocto a few weeks ago - so still learning.

Then,

btattach -B /dev/ttymxc6 -P bcm &

Make sure you have the proper firmware in /lib/firmware/brcm. I googled for one.

Finally,

root@imx7d-pico:~# bluetoothctl
Agent registered
[bluetooth]# list
Controller 43:39:00:00:1F:AC imx7d-pico [default]
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller 43:39:00:00:1F:AC Discovering: yes
[NEW] Device 2A:7D:FA:A8:54:90 2A-7D-FA-A8-54-90
[NEW] Device 07:D4:40:21:35:35 07-D4-40-21-35-35

Also, if it is of interest to others:

  • You can enable the second processor on mainline kernel by changing the u-boot config like below. I do not know what is the implication of running in hypervisor mode though.
-CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
+CONFIG_ARMV7_NONSEC=y

[ 0.005302] CPU: Testing write buffer coherency: ok
[ 0.006409] CPU0: update cpu_capacity 1024
[ 0.006443] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.008759] Setting up static identity map for 0x80100000 - 0x80100078
[ 0.009313] rcu: Hierarchical SRCU implementation.
[ 0.011685] smp: Bringing up secondary CPUs …
[ 0.014196] CPU1: update cpu_capacity 1024
[ 0.014210] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.015044] smp: Brought up 1 node, 2 CPUs
[ 0.015098] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[ 0.015125] CPU: All CPU(s) started in HYP mode.
[ 0.015150] CPU: Virtualization extensions available.

I also changed the .DTSI file to have both CS for SPI, and also SPIDEV listed in /dev/.
And I believe I now have all the functionnality I had with Android Things, with more flexibility.

2 Likes

Thanks for sharing, can you provide the firmware to put in / lib / firmware / brcm?

I believe I used this one:
https://github.com/rockchip-linux/rkwifibt/blob/master/firmware/broadcom/all/BT_FIRMWARE/bcm4339a0.hcd
And renamed it to BCM4335C0.hcd

Also - I think this file would solve the workaround with the GPIOs:


Lines 55-58 are doing pretty much the same thing.