Bluetooth WL18xx driver for mangOH issue

I am trying to follow https://github.com/mangOH/mangOH/wiki/Bluetooth-WL18xx-driver-for-mangOH and on step 6.ii *bitbake linux-yocto -c kernel_configme -f* I got error “nothing provides linux-yocto…” if this command executed from folder build_bin (step 6.i) BUT this command works well if executed from yocto/build folder.

Is it error in wiki page?

Which module are you using? On WP76 and WP77, the name of the Linux kernel recipe is “linux-quic” and not “linux-yocto” as it is on the WP85 and WP75. If you’re using wp76, I know for certain that it has bluez built into release 12. The TI firmware file isn’t loaded, but you should be able to do that manually.

we use WP77 module and sources from Legato-Dist-Source-mdm9x06-SWI9X06Y_02.18.05.00.tar.bz2

Does the bluetoothctl program exist on your target? I’m not sure if bluez is built into the wp77 images or not.

I guess not:

root@swi-mdm9x28-wp:~# bluetoothctl
-sh: bluetoothctl: not found

and kernel modules are missing. when I launch bluetoothUtil:

Jan 6 00:06:56 | bt-init.sh[2468] | | PWD is: /legato/systems/current/appsWriteable/bluetoothUtil
Jan 6 00:06:56 | bt-init.sh[2468] | | modprobe: module hci_uart not found in modules.dep
Jan 6 00:06:57 | bt-init.sh[2468] | | modprobe: module bluetooth not found in modules.dep
Jan 6 00:06:58 | bt-init.sh[2468] | | modprobe: module rfcomm not found in modules.dep
Jan 6 00:06:59 | bt-init.sh[2468] | | modprobe: module hidp not found in modules.dep
Jan 6 00:07:00 | bt-init.sh[2468] | | modprobe: module bnep not found in modules.dep

does it mean that we should use ‘linux-quic’ instead of ‘linux-yocto’ in this manual https://github.com/mangOH/mangOH/wiki/Bluetooth-WL18xx-driver-for-mangOH ?

on step 6.ii.a it fails when we run it from yocto/build_bin folder:
bitbake linux-quic -c kernel_configme -f

ERROR: Task do_kernel_configme does not exist for target linux-quic (/home/admin/work2/yocto/meta-swi/meta-swi-mdm9x28/recipes-kernel/linux/linux-quic_git.bb:do_kernel_configme). Close matches:

do_menuconfig

ERROR: Command execution failed: 1

what would be exact steps for WP7702 module?

thank you,
Regards,
Sergey

omitting this command bitbake linux-quic -c kernel_configme -f and modificating other I was able to build ‘yocto_wp77xx.4k.cwe’ and ‘appsboot_wp77xx.cwe’

should it be enough to copy ‘yocto_wp77xx.4k.cwe’ to board and run ‘fwupdate download yocto_wp77xx.4k.cwe’ ?

well… I did fwupdate, and now board in boot loop:

rootfs: dev ‘/dev/ubiblock0_0’ ‘squashfs’

mount /dev/mapper/rt

[ 3.453032] device-mapper: verity: 253:0: metadata block 1 is corrupted

[ 3.458679] SQUASHFS error: squashfs_read_data failed to read block 0x0

[ 3.478229] squashfs: SQUASHFS error: unable to read squashfs_super_block

mount: mounting /dev/mapper/rt on /mnt/rootfs failed: Input/output error

rootfs: mount failed

It is not dual system logic

System error!

[ 3.511271] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100

[ 3.511271]

[ 3.519413] CPU: 0 PID: 1 Comm: init Not tainted 3.18.44 #6

[ 3.524955] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)

[ 3.532658] [] (show_stack) from [] (panic+0x90/0x1f4)

[ 3.539515] [] (panic) from [] (do_exit+0x40c/0x8ac)

[ 3.546201] [] (do_exit) from [] (SyS_exit_group+0x0/0x10)

[ 3.553401] [] (SyS_exit_group) from [<00000004>] (0x4)

[ 4.565433] cpr_panic_callback: apc_corner: [corner:7, fuse_corner:3] = 1287500 uV

[ 4.572084] Rebooting in 5 seconds…

I have recovered board with pushing Switch 7 -> ON, use Developer Studio recover wizard to flash official firmware, and then pushing Switch 7 OFF.

btw, same process on other board (dead) does not helps.
in console I got same output of flashing process until last moment

what could be so bad with board?

Unfortunately, the WP77 official release is quite old. I made these commits to the meta-swi repository which added bluez support for wp76 (and I think wp77 too), but these occur after release 9.1.

common: copy ell 0.8 from yocto master branch
bluez5: Backport v5.50 from poky master
bluez5: Add bbappend to enable NFC and mesh
mdm9x28: Include bluez5 in image

These changes do appear as part of WP77 release 11, but that was never posted publicly. I’m not sure of the exact reason why. The manifest for that release can be viewed here: https://gerrit.legato.io/gitweb?p=manifest.git;a=blob;f=products/wp77xx/releases/Release11.xml;h=26154ecdcd12b7d810fe09c66cc065fa5448b316;hb=HEAD

I don’t use Developer Studio, so I’m not really familiar with the recovery wizard. When I get into trouble, I generally just swiflash -m wp77xx -r followed by swiflash -m wp77xx -i WP77xx_ReleaseN.spk.

thank you, but all these links seems are not public. When WP77 release 11 is planned ?
we under high pressure, could we get access to it somehow earlier?

when I rebuilt kernel there were 2 .cwe files generated for wp76 and wp77, can we try to flash firmware of WP76 to WP77 ? will it work? what is difference between them?

Hi @dfrey, once R11 is installed, do you have the steps to get BT to work on mangOH Red+WL18 IoT card? Thanks.

when I run bluetoothUtil I got:

Jan 6 00:07:29 | bt-init.sh[2059] | | modprobe: module hidp not found in modules.dep
*Jan 6 00:07:32 | bt-init.sh[2059] | | /legato/systems/current/apps/bluetoothUtil/read-only/bin/bt-init.sh: *
*Jan 6 00:07:32 | bt-init.sh[2059] | | line 27: *
Jan 6 00:07:32 | bt-init.sh[2059] | | mux: not found
*Jan 6 00:07:32 | bt-init.sh[2059] | | *
*Jan 6 00:07:32 | bt-init.sh[2059] | | /legato/systems/current/apps/bluetoothUtil/read-only/bin/bt-init.sh: *
*Jan 6 00:07:32 | bt-init.sh[2059] | | line 28: *
Jan 6 00:07:32 | bt-init.sh[2059] | | mux: not found

and ‘bluetoothctl’ fails on any command:
root@swi-mdm9x28-wp:~# bluetoothctl
process 2027: arguments to dbus_connection_get_object_path_data() were incorrect, assertion “connection != NULL” failed in file …/…/dbus-1.10.10/dbus/dbus-connection.c line 5904.
This is normally a bug in some application using the D-Bus library.

I installed “9999999_9907618_SWI9X06Y_02.22.12.00_00_GENERIC_001.051_000-full.spk”. I copied “TIInit_11.8.32.bts” from the mangOH git repo into “/lib/firmware/ti-connectivity/”.

  1. Ensure that UART1 is set for embedded application use.
    AT!MAPUART=17,1
    AT!RESET
    at!mapuart?
    !MAPUART: 17,16
    I got a little bit further with the below script.

modprobe hci_uart
sleep 1
modprobe bluetooth
sleep 1
modprobe rfcomm
sleep 1
modprobe hidp
sleep 1
modprobe bnep
sleep 1

#Set IoT card GPIO3 to high
if [ ! -d “/sys/class/gpio/gpio7” ]; then
echo 7 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio7/direction
echo 1 > /sys/class/gpio/gpio7/value
sleep 1

#Take the IoT card out of reset
if [ ! -d “/sys/class/gpio/gpio2” ]; then
echo 2 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio2/direction
echo 1 > /sys/class/gpio/gpio2/value
sleep 1

hciattach /dev/ttyHS0 texas 115200 flow
sleep 1

root@swi-mdm9x28-wp:~# sh red-bt-init.sh
modprobe: module hidp not found in modules.dep
Found a Texas Instruments’ chip!
Firmware file : /lib/firmware/ti-connectivity/TIInit_11.8.32.bts
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1
Device setup complete
root@swi-mdm9x28-wp:~# hciconfig
hci0: Type: Primary Bus: UART
BD Address: 5C:31:3E:DF:D7:57 ACL MTU: 1021:6 SCO MTU: 180:4
UP RUNNING
RX bytes:891 acl:0 sco:0 events:33 errors:0
TX bytes:415 acl:0 sco:0 commands:33 errors:0

root@swi-mdm9x28-wp:~# hciconfig hci0 up

But then I run into the bluetoothctl issue that you are facing :frowning:

You have to start the daemon before running bluetoothctl:

root@swi-mdm9x28-wp:~# ./bt-gpio.sh
root@swi-mdm9x28-wp:~# hciattach /dev/ttyHS0 texas 115200 flow
Found a Texas Instruments’ chip!
Firmware file : /lib/firmware/ti-connectivity/TIInit_11.8.32.bts
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1
Device setup complete
root@swi-mdm9x28-wp:~# /usr/libexec/bluetooth/bluetoothd &
root@swi-mdm9x28-wp:~# bluetoothctl
[NEW] Controller 10:CE:A9:FF:FE:A7 BlueZ 5.41 [default]
[bluetooth]#

The daemon is having issues with D-Bus. I need to spend some time to understand why. I am able to scan and find devices though :slight_smile:

root@swi-mdm9x28-wp:~# hcitool -i hci0 scan
Scanning …
E0:33:8E:2F:63:9D iPhoneXS
root@swi-mdm9x28-wp:~# /usr/libexec/bluetooth/bluetoothd &
root@swi-mdm9x28-wp:~# D-Bus setup failed: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

[1]+ Done(1) /usr/libexec/bluetooth/bluetoothd
root@swi-mdm9x28-wp:~#

thank you!.
may I ask where you got this .spk?
using leaf command I have found 9999999_9907618_SWI9X06Y_02.22.12.00_00_GENERIC_001.051_000.spk
(without ‘-full’ at the end)
is it same as yours? you have copied it to /tmp folder of device and do ‘fwupdate download …’ ?
‘red-bt-init.sh’ comes with this spk?

bt-gpio.sh is the same as these GPIO enables a few posts back, it also includes an enable on GPIO 13 but maybe that’s not needed.

#Set IoT card GPIO3 to high
if [ ! -d “/sys/class/gpio/gpio7” ]; then
echo 7 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio7/direction
echo 1 > /sys/class/gpio/gpio7/value
sleep 1
#Take the IoT card out of reset
if [ ! -d “/sys/class/gpio/gpio2” ]; then
echo 2 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio2/direction
echo 1 > /sys/class/gpio/gpio2/value