# Installing mangOH on Device fails

**URL:** <https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644>\
**Category:** mangOH Green\
**Created:** [July 27, 2017, 3:31pm UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644 "2017-07-27T15:31:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![syslogic](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@syslogic](https://mangoh.discourse.group/u/syslogic)\
**Post date:** [July 27, 2017, 3:31pm UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/1 "2017-07-27T15:31:53Z")

</div>

Hello everyone

I try to install mangOH on the device as described in the official Tutorial. The Chip used of Sierra Wireless is the WP7502. When trying to execute the command to make the mangOH Green system file as described in the ReadMe on the page [https://github.com/mangOH/mangOH](https://github.com/mangOH/mangOH)  
i get the error that the file system.sdef is malformed.  
I need to make the command mux work on the device for using the CAN. Any help would be appreciated.  
Thank you 😀

---

<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:** [July 27, 2017, 4:04pm UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/2 "2017-07-27T16:04:00Z")

</div>

I modified the `README.md` yesterday and made a mistake in the instructions. So depending on when you viewed the `README.md` you may have seen the old version that tells you to use the `Makefile` (which was broken) or the new version in which every `$` was mistakenly `$$`. Please take another look at `README.md` and tell me if you’re still having problems.

---

<div class="post-metadata">

**Author:** ![syslogic](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@syslogic](https://mangoh.discourse.group/u/syslogic)\
**Post date:** [July 28, 2017, 6:44am UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/3 "2017-07-28T06:44:34Z")

</div>

When I execute the command now for the Green mangOH Board, it get the following error:

\*\*\*\* ERROR:\*\*  
\*\*/home/netipc/workspace/legato/system.sdef:7:0: error: Unexpected character ‘#’ \*\*  
**Makefile:382: recipe for target ‘system\_wp85’ failed**  
**make: \*\*\* [system\_wp85] Error 1**

Thank you for your help.

---

<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:** [July 28, 2017, 3:59pm UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/4 "2017-07-28T15:59:59Z")

</div>

Are you using Legato 17.06? Also, please give me the output of `git rev-parse HEAD` in your mangOH folder.

---

<div class="post-metadata">

**Author:** ![syslogic](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@syslogic](https://mangoh.discourse.group/u/syslogic)\
**Post date:** [August 1, 2017, 10:04am UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/5 "2017-08-01T10:04:27Z")

</div>

I’m using Legato 16.10.3 because the newer release i wasn’t able to compile. The ubuntu version is 16.04. the output of the command is:

~/mangOH$ git rev-parse HEAD  
3c8a5c0298364ec3881ebaad2b74c96dbc5b61ec

Thank you for the help.

---

<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:** [August 2, 2017, 3:13pm UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/6 "2017-08-02T15:13:55Z")

</div>

The version of the mangOH repository that you have checked out won’t compile against Legato 16.10.3. Can you tell me the problems you are having with compiling Legato? If we can fix that, then compiling mangOH should work as well.

---

<div class="post-metadata">

**Author:** ![syslogic](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@syslogic](https://mangoh.discourse.group/u/syslogic)\
**Post date:** [August 2, 2017, 4:03pm UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/7 "2017-08-02T16:03:00Z")

</div>

I was now able to compile the Legato 17.06.0 successfully. When trying to compile now the mangOH repository, i get following errors:

FAILED: make -C /home/netipc/workspace/legato/build/wp750x/system/modules/9-mangoh\_green\_dv4  
make[1]: Entering directory '/home/netipc/workspace/legato/build/wp750x/system/modules/9-mangoh\_green\_dv4’  
make -C /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel M=/home/netipc/workspace/legato/build/wp750x/system/modules/9-mangoh\_green\_dv4 modules  
make[2]: Entering directory '/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel’  
CC [M] /home/netipc/workspace/legato/build/wp750x/system/modules/9-mangoh\_green\_dv4/mangoh\_module.o  
/bin/sh: /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/scripts/recordmcount: No such file or directory  
scripts/Makefile.build:308: recipe for target ‘/home/netipc/workspace/legato/build/wp750x/system/modules/9-mangoh\_green\_dv4/mangoh\_module.o’ failed  
make[3]: \*\*\* [/home/netipc/workspace/legato/build/wp750x/system/modules/9-mangoh\_green\_dv4/mangoh\_module.o] Error 1  
Makefile:1276: recipe for target ‘_module_/home/netipc/workspace/legato/build/wp750x/system/modules/9-mangoh\_green\_dv4’ failed  
make[2]: \*\*\* [_module_/home/netipc/workspace/legato/build/wp750x/system/modules/9-mangoh\_green\_dv4] Error 2  
make[2]: Leaving directory '/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel’  
Makefile:16: recipe for target ‘all’ failed  
make[1]: \*\*\* [all] Error 2  
make[1]: Leaving directory ‘/home/netipc/workspace/legato/build/wp750x/system/modules/9-mangoh\_green\_dv4’  
[30/959] Build kernel driver module  
FAILED: make -C /home/netipc/workspace/legato/build/wp750x/system/modules/1-lsm6ds3-i2c  
make[1]: Entering directory '/home/netipc/workspace/legato/build/wp750x/system/modules/1-lsm6ds3-i2c’  
make -C /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel M=/home/netipc/workspace/legato/build/wp750x/system/modules/1-lsm6ds3-i2c modules  
make[2]: Entering directory '/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel’  
CC [M] /home/netipc/workspace/legato/build/wp750x/system/modules/1-lsm6ds3-i2c/lsm6ds3\_i2c.o  
/bin/sh: /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/scripts/recordmcount: No such file or directory  
scripts/Makefile.build:308: recipe for target ‘/home/netipc/workspace/legato/build/wp750x/system/modules/1-lsm6ds3-i2c/lsm6ds3\_i2c.o’ failed  
make[3]: \*\*\* [/home/netipc/workspace/legato/build/wp750x/system/modules/1-lsm6ds3-i2c/lsm6ds3\_i2c.o] Error 1  
Makefile:1276: recipe for target ‘_module_/home/netipc/workspace/legato/build/wp750x/system/modules/1-lsm6ds3-i2c’ failed  
make[2]: \*\*\* [_module_/home/netipc/workspace/legato/build/wp750x/system/modules/1-lsm6ds3-i2c] Error 2  
make[2]: Leaving directory '/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel’  
Makefile:12: recipe for target ‘all’ failed  
make[1]: \*\*\* [all] Error 2  
make[1]: Leaving directory ‘/home/netipc/workspace/legato/build/wp750x/system/modules/1-lsm6ds3-i2c’  
[30/959] Build kernel driver module  
FAILED: make -C /home/netipc/workspace/legato/build/wp750x/system/modules/0-lsm6ds3  
make[1]: Entering directory '/home/netipc/workspace/legato/build/wp750x/system/modules/0-lsm6ds3’  
make -C /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel M=/home/netipc/workspace/legato/build/wp750x/system/modules/0-lsm6ds3 modules  
make[2]: Entering directory '/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel’  
CC [M] /home/netipc/workspace/legato/build/wp750x/system/modules/0-lsm6ds3/lsm6ds3\_core.o  
/bin/sh: /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/scripts/recordmcount: No such file or directory  
scripts/Makefile.build:308: recipe for target ‘/home/netipc/workspace/legato/build/wp750x/system/modules/0-lsm6ds3/lsm6ds3\_core.o’ failed  
make[3]: \*\*\* [/home/netipc/workspace/legato/build/wp750x/system/modules/0-lsm6ds3/lsm6ds3\_core.o] Error 1  
Makefile:1276: recipe for target ‘_module_/home/netipc/workspace/legato/build/wp750x/system/modules/0-lsm6ds3’ failed  
make[2]: \*\*\* [_module_/home/netipc/workspace/legato/build/wp750x/system/modules/0-lsm6ds3] Error 2  
make[2]: Leaving directory '/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel’  
Makefile:12: recipe for target ‘all’ failed  
make[1]: \*\*\* [all] Error 2  
make[1]: Leaving directory '/home/netipc/workspace/legato/build/wp750x/system/modules/0-lsm6ds3’  
ninja: build stopped: subcommand failed.  
Makefile:428: recipe for target ‘system\_wp750x’ failed  
make: \*\*\* [system\_wp750x] Error 1

Thanks.

---

<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:** [August 2, 2017, 4:47pm UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/8 "2017-08-02T16:47:10Z")

</div>

The toolchain as it is distributed today is unable to build kernel modules. It is necessary to run make scripts in the kernel headers directory. I’m not sure why this issue hasn’t been fixed yet since it was discovered a long time ago. The workaround to fix the toolchain is described in the [legato documentation for out of tree kernel modules](http://legato.io/legato-docs/latest/yoctoOutofTreeKernelModule.html). I will save you some reading and reproduce the instructions here:

```
# Put the arm toolchain in your PATH environment variable
export PATH=$PATH:/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi
# Change directory into the kernel headers directory distributed with the toolchain
cd /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel
# Change the ownership of everything in the folder so that we can update the contents
sudo chown -R $USER .
# Run make scripts with appropriate cross compilation flags
ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- make scripts
# Change the ownership of the kernel headers back to root
sudo chown -R root .
```

---

<div class="post-metadata">

**Author:** ![syslogic](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@syslogic](https://mangoh.discourse.group/u/syslogic)\
**Post date:** [August 4, 2017, 12:09pm UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/9 "2017-08-04T12:09:29Z")

</div>

Thank you for your support, the compilation finally worked and i was able to install mangOH on my device 😀

---

<div class="post-metadata">

**Author:** ![lyao](https://avatars.discourse-cdn.com/v4/letter/l/e8c25b/32.png) [@lyao](https://mangoh.discourse.group/u/lyao)\
**Post date:** [September 5, 2017, 8:30am UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/10 "2017-09-05T08:30:53Z")

</div>

Hi @dfrey, does this mean the current mangOH repository can only be used on framework of version 17.06 or even newer ones?

---

<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:** [September 5, 2017, 2:25pm UTC](https://mangoh.discourse.group/t/installing-mangoh-on-device-fails/644/11 "2017-09-05T14:25:16Z")

</div>

I believe the mangOH Red and Green SDEFs will currently build against 17.05 or newer, but the `redSensorToCloud` app that’s part of mangOH Red’s SDEF won’t work properly unless you’re on 17.06 or newer.
