# Bluetooth WL18xx driver for mangOH: how to flash the driver

**URL:** <https://mangoh.discourse.group/t/bluetooth-wl18xx-driver-for-mangoh-how-to-flash-the-driver/919>\
**Category:** mangOH Green\
**Created:** [November 21, 2017, 2:10pm UTC](https://mangoh.discourse.group/t/bluetooth-wl18xx-driver-for-mangoh-how-to-flash-the-driver/919 "2017-11-21T14:10:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luigitondo](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/luigitondo/32/498_2.png) [@luigitondo](https://mangoh.discourse.group/u/luigitondo)\
**Post date:** [November 21, 2017, 2:10pm UTC](https://mangoh.discourse.group/t/bluetooth-wl18xx-driver-for-mangoh-how-to-flash-the-driver/919/1 "2017-11-21T14:10:46Z")

</div>

hello,

I have an IoT expansion card with TI WiLink TM WL1831MOD for WiFi and BT.  
I am following the instructions to generate the driver for the BT component on Git Hub:

> **[mangOH/mangOH](https://github.com/mangOH/mangOH/wiki/Bluetooth-WL18xx-driver-for-mangOH)**
>
> Primary mangOH git repository. Contribute to mangOH/mangOH development by creating an account on GitHub.

I managed to create the .cwe file that needs to be flashed on the WP on my board (yocto\_wp84.cwe). (steps 1 to 8)  
The following step, though, is problematic:  
9. Reflash new image with Bluetooth driver module support to the target board  
FDT command: fdt yocto\_wp85.cwe

My environment does not have the “fdt” command. I don’t find any reference to it on Legato.it either.  
What can I do?

thanks  
BR  
Luigi

---

<div class="post-metadata">

**Author:** ![luigitondo](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/luigitondo/32/498_2.png) [@luigitondo](https://mangoh.discourse.group/u/luigitondo)\
**Post date:** [November 21, 2017, 3:57pm UTC](https://mangoh.discourse.group/t/bluetooth-wl18xx-driver-for-mangoh-how-to-flash-the-driver/919/2 "2017-11-21T15:57:57Z")

</div>

Hello,

I saw on another post that the same problem could be solved by using fwupdate.  
So, I ran:  
$ fwupdate download yocto\_wp85.cwe 192.168.2.2  
Connecting to service …  
Connecting to service …  
Download started …  
Download successful

I think the instructions on GitHub should update to suggest “fwupdate” instead of “fdt”.

Then I managed to execute the final step, that is:  
10. Download bluetoothUtil app from [https://github.com/mangOH/Demos/tree/master/BluetoothUtil](https://github.com/mangOH/Demos/tree/master/BluetoothUtil) as this will load the driver.

In practice, I ran “make” in the BluetoothUtil directory

BluetoothUtil$ make  
mkapp -t wp85 bluetoothUtil.adef  
[7/8] Creating info.properties  
…/read-only./read-only/bin./read-only/bin/TIInit\_11.8.32.bts./read-only/bin/bt-init.sh./read-only/bin/gatttool./read-only/bin/hciattach./read-only/bin/hciconfig./read-only/bin/hcitool./root.cfgdb39987d7d4436be5f6d7ca33f87b349 ./read-only/bin/TIInit\_11.8.32.bts  
1703f6f662eae1436ade4ed24f4493a9 ./read-only/bin/bt-init.sh  
9b76c13a615ba5cee72bbb5871733dbd ./read-only/bin/gatttool  
065e6a34547ba17a938f71f10fba2755 ./read-only/bin/hciattach  
92972241ac181037292fab9f418bac16 ./read-only/bin/hciconfig  
ba29a9adb4bbb740a83c3fde518c94c2 ./read-only/bin/hcitool  
266f36a9a635328d90b802e97ef5ba50 ./root.cfg  
[8/8] Packaging app

then I installed the executable on the target:

$ app install bluetoothUtil.wp85.update 192.168.2.2  
Applying update from file ‘bluetoothUtil.wp85.update’ to device at address ‘192.168.2.2’.  
Unpacking package: 100% ++++++++++++++++++++++++++++++++++++++++++++++++++  
Applying update: 100% ++++++++++++++++++++++++++++++++++++++++++++++++++  
SUCCESS  
Done

I can now see that this app is running on the WP and that both the LEDs on the IoT card (one for wifi and the other for Bluetooth) are ON.

Now the question is: how do I know if the Bluetooth driver is working ok? I tried to do a BT scan with my smartphone but I could not detect anytthing.  
Any suggestion?

thanks in advance  
Br  
Luigi

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [November 21, 2017, 9:46pm UTC](https://mangoh.discourse.group/t/bluetooth-wl18xx-driver-for-mangoh-how-to-flash-the-driver/919/3 "2017-11-21T21:46:38Z")

</div>

You need to run the BLE sensor interface to interact with a TI sensor stack

> **[mangOH/Demos](https://github.com/mangOH/Demos)**
>
> Code for mangOH demos. Contribute to mangOH/Demos development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![luigitondo](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/luigitondo/32/498_2.png) [@luigitondo](https://mangoh.discourse.group/u/luigitondo)\
**Post date:** [November 22, 2017, 6:55pm UTC](https://mangoh.discourse.group/t/bluetooth-wl18xx-driver-for-mangoh-how-to-flash-the-driver/919/4 "2017-11-22T18:55:58Z")

</div>

Hi,

thanks for looking into this.

I tried to compile BleSensorInterface but I got the following error:  
$ make  
mkapp -t wp85 bleSensorInterface.adef  
\*\* ERROR:  
/home/acal/test\_bluetooth/Demos-74a620c30e78d56f0e38d1d752cd829df963a112/BleSensorInterface/bleSensorInterface/Component.cdef:17:8: error: Couldn’t find file 'dataRouter.api.'  
Makefile:4: recipe for target ‘all’ failed  
make: \*\*\* [all] Error 1

It fails in the Component.cdef file here:  
requires:  
{  
api:  
{  
dataRouter.api  
le\_cfg.api  
}  
}

I located the file dataRouter.api in my mangoh directory:  
$MANGOH\_ROOT/apps/DataRouter/dataRouter.api

So, I modified the Component.cdef accordingly  
requires:  
{  
api:  
{  
$MANGOH\_ROOT/apps/DataRouter/dataRouter.api  
le\_cfg.api  
}  
}

but it still fails:  
mkapp -t wp85 bleSensorInterface.adef  
\*\* ERROR:  
/home/acal/test\_bluetooth/Demos-74a620c30e78d56f0e38d1d752cd829df963a112/BleSensorInterface/bleSensorInterface/Component.cdef:19:2: error: Couldn’t find file '…/…/…//apps/DataRouter/dataRouter.api.'  
Makefile:4: recipe for target ‘all’ failed  
make: \*\*\* [all] Error 1

I’m sure there is a better way.  
Is there any environment variable I need to set?

thanks  
BR  
Luigi

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [September 10, 2018, 8:09am UTC](https://mangoh.discourse.group/t/bluetooth-wl18xx-driver-for-mangoh-how-to-flash-the-driver/919/5 "2018-09-10T08:09:30Z")

</div>

I think you can directly copy the dataRouter.api (in folder $MANGOH\_ROOT/apps/DataRouter) to the “bleSensorInterface” folder where you compiled the application.
