# Build WP77XX steps

**URL:** <https://forum.legato.io/t/build-wp77xx-steps/6168>\
**Category:** Uncategorized\
**Created:** [April 4, 2022, 9:28am UTC](https://forum.legato.io/t/build-wp77xx-steps/6168 "2022-04-04T09:28:07Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 4, 2022, 9:28am UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/1 "2022-04-04T09:28:07Z")

</div>

Hello,  
I’m tring to building legato and linux for a custom device with WP7702.

I’ve downloaded the legato source and swi-linux source with leaf. I can build legato with (make wp77xx) but I’m not able to customize the swi-linux-src (make menuconfig ???) to add support in kernel for BMI160 (On my board I have no i2c mux .. removed couse not used).

Can someone help me with swi-linux build? I have this error right now:

(lsh:wp77) gianmaria@leg:~/myWorkspace/swi-linux-src$ make  
“meta-swi/build.sh” -p poky/ -o meta-openembedded/ -l meta-swi -x “kernel” -j 9 -t 9 -g -a “LEGATO\_WORKDIR=/home/gianmaria/myWorkspace/swi-linux-src/legato/” -a “IMA\_SUPPORT\_TOOLS\_REPO=git:///home/gianmaria/myWorkspace/swi-linux-src/legato/3rdParty/ima-support-tools/.git;protocol=file;usehead=1” -a “IMA\_SUPPORT\_TOOLS\_REV=${AUTOREV}” -a LK\_REPO\_DIR=“/home/gianmaria/myWorkspace/swi-linux-src” -a LK\_REPO\_NAME=“lk” -a LK\_REPO=“file://lk” -m swi-mdm9x06 -P wp -b build\_bin -q  
Poky dir: /home/gianmaria/myWorkspace/swi-linux-src/poky  
OE meta: /home/gianmaria/myWorkspace/swi-linux-src/meta-openembedded  
SWI meta dir: /home/gianmaria/myWorkspace/swi-linux-src/meta-swi  
Linux repo dir: /home/gianmaria/myWorkspace/swi-linux-src/kernel  
Number of make threads 9  
Number of bitbake tasks 9  
With Legato  
Extra options added - LEGATO\_WORKDIR=/home/gianmaria/myWorkspace/swi-linux-src/legato/  
Extra options added - IMA\_SUPPORT\_TOOLS\_REPO=git:///home/gianmaria/myWorkspace/swi-linux-src/legato/3rdParty/ima-support-tools/.git;protocol=file;usehead=1  
Extra options added - IMA\_SUPPORT\_TOOLS\_REV=${AUTOREV}  
Extra options added - LK\_REPO\_DIR=/home/gianmaria/myWorkspace/swi-linux-src  
Extra options added - LK\_REPO\_NAME=lk  
Extra options added - LK\_REPO=file://lk  
SWI machine: swi-mdm9x06  
SWI product: wp  
Build dir: /home/gianmaria/myWorkspace/swi-linux-src/build\_bin  
Enable Qualcomm Proprietary bin

### Shell environment set up for builds.

You can now run ‘bitbake ’

Common targets are:  
core-image-minimal  
core-image-sato  
meta-toolchain  
meta-ide-support

You can also run generated qemu images with a command like ‘runqemu qemux86’  
Error: bash is not set as default provider for /bin/sh  
build is not guaranteed to work, aborting  
Makefile:384: recipe for target ‘image\_bin’ failed  
make: \*\*\* [image\_bin] Error 1

How to make linux for my wp7702?

Regards,  
Gianmaria

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 4, 2022, 9:44am UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/2 "2022-04-04T09:44:01Z")

</div>

When build yocto:

```auto
Error: bash is not set as default provider for /bin/sh
       build is not guaranteed to work, aborting
make: *** [image_bin] Error 1

```

sudo apt-get remove ccache  
sudo dpkg-reconfigure dash  
Answer “No” to the question.

* * *

For building the menuconfig, you can do:

```auto
make dev
build_bin# bitbake linux-quic -c menuconfig

```

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 4, 2022, 12:38pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/3 "2022-04-04T12:38:21Z")

</div>

Done… it worked. Now I have enabled support for BMI160 in kernel and saved the config.  
How can i build the entire linux? And do it for wp7701… ? Also… in my experience (android kernel), i have DTS to indicate i2c address and presence of accelerometer under i2c bus…

Regards,  
gian

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 4, 2022, 12:42pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/4 "2022-04-04T12:42:37Z")

</div>

![Schermata 2022-04-04 alle 14.36.01](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/9/9167c12321ed1993d64f0f9168a09e8a624fca0f.jpeg)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 4, 2022, 12:48pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/5 "2022-04-04T12:48:50Z")

</div>

I remember the mangoh layer already has bmi160 driver

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

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 4, 2022, 12:54pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/6 "2022-04-04T12:54:23Z")

</div>

Yes… but i cant use mangoH cause it defines communication with accelerometer through i2c multiplexer, and i dont have it on my board.  
So the master plan is this:  
1)Build legato (DONE…)  
2)Configure kernel on linux source with BMI support (not enabled by default but i enabled right now…DONE)  
3)Make kernel and linux for WP7702 (dont know how to do it)  
4)Make legato for WP7702 (dont know how to do it)  
5) Merge legato.cwe linux.cwe and modemdrivers to produce a complete system.

Actually I’m at point 3…  
Gian

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 4, 2022, 1:18pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/7 "2022-04-04T13:18:23Z")

</div>

After you finish the menuconfig, just type “make”

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 4, 2022, 5:00pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/8 "2022-04-04T17:00:49Z")

</div>

After reboot now i have:  
(lsh:wp77) gianmaria@leg:~/myWorkspace/swi-linux-src/build\_bin$ bitbake linux-quic -c menuconfig  
bitbake: command not foud

… do i have to init something?

gian

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 4, 2022, 5:03pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/9 "2022-04-04T17:03:32Z")

</div>

Have you done “make dev”

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 4, 2022, 5:17pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/10 "2022-04-04T17:17:10Z")

</div>

(lsh:wp77) gianmaria@leg:~/myWorkspace/swi-linux-src$ make dev  
Makefile:8: \*\*\* “Detected Makefile being re-invoked from within bitbake environment!”. Arresto.

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 4, 2022, 5:30pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/11 "2022-04-04T17:30:19Z")

</div>

Ok, now i’m able to execute following commands…  
bitbake -c compile -f linux-quic  
bitbake -c build -f linux-quic  
bitbake -c build -f mdm9x28-image-minimal

…mdm9x28-image-minimal is right for WP7702?

Gian

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 5, 2022, 2:59am UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/12 "2022-04-05T02:59:51Z")

</div>

I don’t know, what is that command for?

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 5, 2022, 10:37am UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/13 "2022-04-05T10:37:11Z")

</div>

Useless command… found on help.  
Anyway seems I’ve compiled everything… now I’ve:  
LEGATO HERE:  
/home/gianmaria/myWorkspace/legato-src/legato/build/wp77xx/legato.cwe

LINUX HERE  
/home/gianmaria/myWorkspace/swi-linux-src/build\_bin/tmp/deploy/images/swi-mdm9x28-wp/yocto\_wp77xx.4k.cwe

MODEM DRIVERS  
Original from  
[https://source.sierrawireless.com/resources/airprime/software/wp77xx/wp77xx-firmware-latest-release-components/-/media/17ae6bd0fd1449f28429a0d5b1434df6.ashx](https://source.sierrawireless.com/resources/airprime/software/wp77xx/wp77xx-firmware-latest-release-components/-/media/17ae6bd0fd1449f28429a0d5b1434df6.ashx)

are this the right files???

I will try to pack with  
swicwe -o custom-firmware.spk -c modemFW.spk yocto\_wp77xx.4k.cwe legato.cwe

gian

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 5, 2022, 11:25am UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/14 "2022-04-05T11:25:02Z")

</div>

You can download to module one by one to make sure they are working fine

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 5, 2022, 5:10pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/15 "2022-04-05T17:10:07Z")

</div>

It worked… file by file… it worked.  
Anyway i still didt see my BMI160 even if it’s enabled in kernel drivers cause i need to know witch DTS to edit to declare it… there are a lot of it and i dont know wich is the right one to define the accel i2c address… something like this:

bosch@68 { /\* Accelerometer and Gyroscope sensor \*/  
compatible = “bosch,bmi160”;  
reg = \<0x68\>;

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 5, 2022, 6:09pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/16 "2022-04-05T18:09:21Z")

</div>

Actually I’m not sure i generated the right recipe…  
With bitbake -s i see a toon of recipes i can build… which is the right one?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 6, 2022, 2:40am UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/17 "2022-04-06T02:40:17Z")

</div>

seems porting the mangoh layer bmi160 driver is easier for you

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [April 6, 2022, 3:53pm UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/18 "2022-04-06T15:53:34Z")

</div>

Can you suggest me? I’m a little bit lost…

thanks,  
gian

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 7, 2022, 1:05am UTC](https://forum.legato.io/t/build-wp77xx-steps/6168/19 "2022-04-07T01:05:54Z")

</div>

you can try to port this driver:

> **[mangOH/linux\_kernel\_modules/bmi160 at master · mangOH/mangOH](https://github.com/mangOH/mangOH/tree/master/linux_kernel_modules/bmi160)**
>
> master/linux\_kernel\_modules/bmi160
