# \[Solved\] Compiling WiFi Driver

**URL:** <https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085>\
**Category:** mangOH Green\
**Created:** [January 16, 2018, 9:03pm UTC](https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085 "2018-01-16T21:03:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rauger1](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@rauger1](https://mangoh.discourse.group/u/rauger1)\
**Post date:** [January 16, 2018, 9:03pm UTC](https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085/1 "2018-01-16T21:03:15Z")

</div>

Hi,

I am working on updating some wifi-driver software. I am trying to build it for a wp85 board. I went through the setup here: [Install the Application Framework - Legato Docs](http://legato.io/legato-docs/latest/basicBuildLegato.html#buildDownload) , and installed everything. Here is running cfgLegato which sets up the development environment variables:

> mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ cfgLegato  
> Modules: wp85, wp750x  
> SDK Path: /home/mangoh/legato/packages/legato.sdk.17.6.0.wp85-wp75-native-x86\_64-201707120921  
> Framework Path: /home/mangoh/legato/packages/legato.framework.17.6.0.wp85-wp750x-201707120855 - $LEGATO\_ROOT  
> Toolchain Path: /home/mangoh/legato/packages/legato.toolchain.1.7.3.SWI9X15Y\_07121000-wp85-wp750x-native-x86\_64-201707120848 - $WP85\_TOOLCHAIN\_DIR $WP750X\_TOOLCHAIN\_DIR  
> Device Image Path: /home/mangoh/legato/packages/legato.device.image.7.12.10.00.wpX5-201707120854 - $LEGATO\_DEVICE\_IMAGE  
> Recovery tools Path: /home/mangoh/legato/packages/legato.recovery.4.0.6.1.linux-201704190909 - $LEGATO\_RECOVERY  
> No toolchain found for target ‘ar7’.  
> Unable to find compatible cross-build toolchain for target ‘ar7’.  
> No toolchain found for target ‘ar86’.  
> Unable to find compatible cross-build toolchain for target ‘ar86’.  
> Toolchain specified for target ‘wp76xx’ is invalid.  
> Unable to find compatible cross-build toolchain for target ‘wp76xx’.  
> Toolchain specified for target ‘ar758x’ is invalid.  
> Unable to find compatible cross-build toolchain for target ‘ar758x’.  
> Toolchain specified for target ‘ar759x’ is invalid.  
> Unable to find compatible cross-build toolchain for target ‘ar759x’.  
> Toolchain specified for target ‘em75xx’ is invalid.  
> Unable to find compatible cross-build toolchain for target ‘em75xx’.  
> /home/mangoh/repos/legato-af-16.10.3

I cloned the repo here: [GitHub - legatoproject/legato-WiFi: WiFi support for Legato](https://github.com/legatoproject/legato-WiFi.git) and tried to make and got an error that a source file could not be found…:

> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* VERSION \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> Legato WiFi version is 17.09.0-7-g5445645
> 
> * * *
> 
> make -C /home/mangoh/repos/legato-WiFi/service wp85  
> make[1]: Entering directory ‘/home/mangoh/repos/legato-WiFi/service’  
> mkapp -v -t wp85   
> -i /home/mangoh/repos/legato-WiFi/platformAdaptor/inc/   
> wifiService.adef  
> Env var ‘WP77XX\_TOOLCHAIN\_DIR=/opt/swi/y17-ext/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi’ became ‘SHELL=/bin/bash’.  
> Environment variables are different this time.  
> Parsing file: ‘/home/mangoh/repos/legato-WiFi/service/wifiService.adef’.  
> Modelling application: ‘wifiService’  
> defined in ‘/home/mangoh/repos/legato-WiFi/service/wifiService.adef’  
> Application ‘wifiService’ contains executable ‘wifiService’.  
> Parsing file: ‘/home/mangoh/repos/legato-WiFi/service/daemon/Component.cdef’.  
> Modelling component: ‘daemon’  
> found at: ‘/home/mangoh/repos/legato-WiFi/service/daemon’  
> \*\* ERROR:  
> /home/mangoh/repos/legato-WiFi/service/daemon/Component.cdef:15:4: error: Couldn’t find source file ‘/home/mangoh/repos/legato-WiFi/…/service/platformAdaptor/ti/pa\_wifi\_client\_ti.c’  
> Makefile:10: recipe for target ‘wp85’ failed  
> make[1]: \*\*\* [wp85] Error 1  
> make[1]: Leaving directory ‘/home/mangoh/repos/legato-WiFi/service’  
> Makefile:86: recipe for target ‘/home/mangoh/repos/legato-WiFi/service/wifiService.wp85.update’ failed  
> make: \*\*\* [/home/mangoh/repos/legato-WiFi/service/wifiService.wp85.update] Error 2

Now, I don’t think it would make it much further than this step anyways, because when I go into some C files, such as the one in legato-WiFi(from the github link)/apps/sample/wifiWebAp/wifiWebApComponent/wifiWebAp.c, there is contained:  
#include legato.h  
#include interfaces.h

From cfgLegato, we can see that the framework path is here:/home/mangoh/legato/packages/legato.framework.17.6.0.wp85-wp750x-201707120855, and if we go a bit deeper, there is a legato.h library at $THAT\_PATH/resources/legato/framework/c/inc/legato.h. But if we replace “legato.h” from the C files with this one, this .h file does not include the function declarations necessary for the wifi drivers…

My question is, did I install the legato framework correctly? If so, where could I go about getting the proper source files? Where can I find the proper .h files?

If there is any reference material that you have, please point me in the right direction!

Thank you in advacne

---

<div class="post-metadata">

**Author:** ![rauger1](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@rauger1](https://mangoh.discourse.group/u/rauger1)\
**Post date:** [January 18, 2018, 9:43pm UTC](https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085/2 "2018-01-18T21:43:20Z")

</div>

Is it not possible to build the wifi drivers?

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [January 18, 2018, 9:53pm UTC](https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085/3 "2018-01-18T21:53:22Z")

</div>

If you got legato using repo, then I think that you shouldn’t have to clone [https://github.com/legatoproject/legato-WiFi.git](https://github.com/legatoproject/legato-WiFi.git) manually because repo should have put it under _legato/modules/WiFi/_.

Are you trying to use the WiFi IoT card or are you trying to use a different WiFi adapter?

---

<div class="post-metadata">

**Author:** ![rauger1](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@rauger1](https://mangoh.discourse.group/u/rauger1)\
**Post date:** [January 18, 2018, 10:20pm UTC](https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085/4 "2018-01-18T22:20:14Z")

</div>

The WiFi IoT card. For clarification, the command line tools work, but in order to implement a callback function I need to be able to compile the native C. And if I go into legato-17.10.0 and try to compile, i get the same issue with the file not found, but the file does exist… :

./modules/WiFi/service/platformAdaptor/ti/pa\_wifi\_client\_ti.c  
./modules/WiFi/service/platformAdaptor/ti\_simu/pa\_wifi\_client\_ti.c  
mangoh@mangoh-virtualbox:~/repos/legato-17.10.0$

there seems to be something up with the makefile? How is it not finding that?

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [January 18, 2018, 11:26pm UTC](https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085/5 "2018-01-18T23:26:10Z")

</div>

Are you trying to write a client that makes use of the `le_wifiClient.api` exposed by the `wifiService` app?

---

<div class="post-metadata">

**Author:** ![rauger1](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@rauger1](https://mangoh.discourse.group/u/rauger1)\
**Post date:** [January 19, 2018, 3:04pm UTC](https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085/6 "2018-01-19T15:04:52Z")

</div>

> [@dfrey](#):
>
> Are you trying to write a client that makes use of the le\_wifiClient.api exposed by the wifiService app?

Yes, exactly! Except for le\_wifiAp rather than le\_wifiClient. What I would like to do is write a C program that uses the le\_wifiAP api so that I can start and stop the AP and trigger callback code when new devices are connected.

---

<div class="post-metadata">

**Author:** ![rauger1](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@rauger1](https://mangoh.discourse.group/u/rauger1)\
**Post date:** [January 19, 2018, 5:04pm UTC](https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085/7 "2018-01-19T17:04:45Z")

</div>

OK, I can build the apps if I move to the large legato-af github repository like you mentioned, this is great news! But there is another problem -

If I install any of the apps WITHOUT modifying them, I get an error[1] about a protocol ID, which is not very descriptive. I assume this is because the legato development environment is 17.10 , while my legato version on the board is 16.10.

As far as I can tell, there is no board version for 17.10, is this correct? The new firmware release from Jan 13 is here :[https://source.sierrawireless.com/resources/airprime/software/wpx5xx/wpx5xx-firmware-latest-release/](https://source.sierrawireless.com/resources/airprime/software/wpx5xx/wpx5xx-firmware-latest-release/) , and the version is 16.10.04

So, I downloaded the releases for both 16.10.1 and 16.10.3 and I get an error building both platforms, the same error here:

> mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ ./bin/legs  
> Using legato framework found under ‘/home/mangoh/repos/legato-af-16.10.3/.’  
> mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ export PATH=/home/mangoh/repos/legato-af-16.10.3/./bin:/home/mangoh/repos/legato-af-16.10.3/./bin:/home/mangoh/legato/packages/legato.framework.17.6.0.wp85-wp750x-201707120855/resources/legato/bin:/home/mangoh/bin:/home/mangoh/.local/bin:/home/mangoh/bin:/home/mangoh/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/mangoh/legato/packages/legato.framework.17.6.0.wp85-wp750x-201707120855/resources/legato/build/localhost/bin:/home/mangoh/repos/legato-af-16.10.3/./build/localhost/framework/bin:/home/mangoh/repos/legato-af-16.10.3/./build/localhost/framework/bin  
> mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ source /home/mangoh/repos/legato-af-16.10.3/./framework/tools/scripts/configToolchainDirEnvVars  
> No toolchain found for target ‘ar7’.  
> Unable to find compatible cross-build toolchain for target ‘ar7’.  
> No toolchain found for target ‘ar86’.  
> Unable to find compatible cross-build toolchain for target ‘ar86’.  
> mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ exec \<\> /dev/tty  
> mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ make wp85  
> make -f Makefile.hostTools  
> make[1]: Entering directory ‘/home/mangoh/repos/legato-af-16.10.3’  
> Using ninja installed at: /usr/bin/ninja  
> ln -sf …/build/tools/mk bin/mk  
> ln -sf mk bin/mkcomp  
> ln -sf mk bin/mkexe  
> ln -sf mk bin/mkapp  
> ln -sf mk bin/mksys  
> ln -sf …/framework/tools/scripts/findtoolchain …/framework/tools/scripts/instsys …/framework/tools/scripts/settime …/framework/tools/scripts/mkinfo …/framework/tools/scripts/instlegato …/framework/tools/scripts/stoplegato …/framework/tools/scripts/settz …/framework/tools/scripts/createsdk …/framework/tools/scripts/legato-qemu …/framework/tools/scripts/checkpa …/framework/tools/scripts/update-pack …/framework/tools/scripts/security-pack …/framework/tools/scripts/instapp …/framework/tools/scripts/mklegatoimg …/framework/tools/scripts/app …/framework/tools/scripts/av-pack …/framework/tools/scripts/releaselegato …/framework/tools/scripts/sbhelper …/framework/tools/scripts/systocwe …/framework/tools/scripts/configlegatoenv …/framework/tools/scripts/update …/framework/tools/scripts/configtargetssh …/framework/tools/scripts/legs …/framework/tools/scripts/gettargettype …/framework/tools/scripts/update-util …/framework/tools/scripts/configToolchainDirEnvVars …/framework/tools/scripts/simu …/framework/tools/scripts/fwupdate …/framework/tools/scripts/setname …/framework/tools/scripts/mkdoc …/framework/tools/scripts/startlegato …/framework/tools/scripts/shlib bin/  
> ln -sf …/framework/tools/ifgen/ifgen bin/  
> ninja -f /home/mangoh/repos/legato-af-16.10.3/build/tools/build.ninja  
> ninja: no work to do.  
> make[1]: Leaving directory ‘/home/mangoh/repos/legato-af-16.10.3’  
> **‘platformAdaptor’ directory is missing, which means these Legato sources have not been downloaded properly.**  
> Please refer to [GitHub - legatoproject/legato-af: Legato Application Framework](https://github.com/legatoproject/legato-af#clone-from-github)  
> Makefile:174: recipe for target ‘platformAdaptor’ failed  
> make: \*\*\* [platformAdaptor] Error 1  
> mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$

So, at this point I’m pretty lost. legato-17 will build, but when updated to the device, the app crashes. And for versions earlier than this, I can’t build. What is the next step? Thanks for your help!

Error[1]

> Jan 19 16:25:25 swi-mdm9x15 user.err Legato: =ERR= | serviceDirectory[472]/serviceDirectory\_exe T=main | serviceDirectory.c DispatchToServer() 713 | Client (uid 0 ‘root’, pid 1894) disagrees with server (uid 0 ‘root’, pid 534) on protocol ID of service 'wifiApTest.wifiApT  
> Jan 19 16:25:25 swi-mdm9x15 user.emerg Legato: _EMR_ | _UNKNOWN_[1894]/framework T=main | LE\_FILENAME ReceiveSessionOpenResponse() 684 | Unexpected server response: -6 (LE\_FAULT).  
> Jan 19 16:25:26 swi-mdm9x15 user.info Legato: INFO | supervisor[468]/supervisor T=main | proc.c proc\_SigChildHandler() 1942 | Process ‘wifiApTest’ (PID: 1894) has exited with exit code 1.  
> Jan 19 16:25:26 swi-mdm9x15 user.info Legato: INFO | supervisor[468]/supervisor T=main | proc.c GetFaultAction() 1744 | No fault action specified for process ‘wifiApTest’. Assuming ‘ignore’.  
> Jan 19 16:25:26 swi-mdm9x15 user.warn Legato: -WRN- | \_appStopClient[1895]/framework T=main | LE\_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!  
> Jan 19 16:25:26 swi-mdm9x15 user.warn Legato: -WRN- | supervisor[468]/supervisor T=main | app.c app\_SigChildHandler() 3221 | Process ‘wifiApTest’ in app ‘wifiApTest’ faulted: Ignored.  
> Jan 19 16:25:26 swi-mdm9x15 user.info Legato: INFO | supervisor[468]/supervisor T=main | apps.c DeactivateAppContainer() 340 | Application ‘wifiApTest’ has stopped.

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [January 19, 2018, 6:05pm UTC](https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085/8 "2018-01-19T18:05:46Z")

</div>

I recommend upgrading your Legato on your target to 17.11.0 (and 18.01.0 when it is released). Although this isn’t a configuration “officially” supported by the WP team, you will have a much better experience than trying to stick with 16.10.3.

---

<div class="post-metadata">

**Author:** ![rauger1](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@rauger1](https://mangoh.discourse.group/u/rauger1)\
**Post date:** [January 22, 2018, 6:53pm UTC](https://mangoh.discourse.group/t/solved-compiling-wifi-driver/1085/9 "2018-01-22T18:53:47Z")

</div>

@dfrey Thanks for your help, upgrading worked !
