# How to flash new kernel to mangOH

**URL:** <https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293>\
**Category:** mangOH Green\
**Created:** [April 3, 2018, 8:22am UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293 "2018-04-03T08:22:19Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohad](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@ohad](https://mangoh.discourse.group/u/ohad)\
**Post date:** [April 3, 2018, 8:22am UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/1 "2018-04-03T08:22:19Z")

</div>

I bought a new mangOH green device, and I want to customize its kernel.

I couldn’t find any procedure for loading or building a kernel.

From searching the internet it looks like [legato-af](https://github.com/legatoproject/legato-af) is the project you use to build the new kernel, and indeed after building it I can see the file `./build_bin/tmp/deploy/images/swi-mdm9x15/boot-yocto_wp85.cwe`.

It looks like `swiflash -m wp85 -i boot-yocto_wp85.cwe` should work, but I’m not entirely sure.

I also saw the fwupdateService running on the mangOH, and I’m not sure. Does swiflush communicate with this service?

If this is the case, how would I be able to reflash the device if I accidentally flash a corrupted kernel.

Is there a document describing the flashing components architecture?

Thanks

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/nick/32/1380_2.png) [@nick](https://mangoh.discourse.group/u/nick)\
**Post date:** [April 3, 2018, 5:07pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/2 "2018-04-03T17:07:14Z")

</div>

Hey @ohad,

The source you need to customize the base OS can be found here: [https://source.sierrawireless.com/resources/legato/downloads/](https://source.sierrawireless.com/resources/legato/downloads/).

Instructions on building this code can be found here: [https://source.sierrawireless.com/resources/legato/linuxoverview/](https://source.sierrawireless.com/resources/legato/linuxoverview/). The download page is a little confusing, so I circled the ones you want.

 ![26%20AM](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/1X/ad9f438157973d8386e42f16e03aaabd9a97d04d.png)

In theory, you should be able to produce a custom `.cwe` file and flash it as described. The `fwupdateService` is used with the `fwupdate` command line tool to flash `.spk` files (I’m not certain what the difference is here, Sierra Wireless seems to provide pre-built firmware as `.spk` files).

I’m currently waiting on better build hardware to try this out. I ran it on an Ubuntu virtual machine on my late 2016 MacBook Pro and it was far too slow to make this effective. I’ll keep you updated as I go.

Cheers!

---

<div class="post-metadata">

**Author:** ![ohad](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@ohad](https://mangoh.discourse.group/u/ohad)\
**Post date:** [April 4, 2018, 1:49pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/3 "2018-04-04T13:49:23Z")

</div>

Hi @nick ,

Thank you for your help.

I was able to flash the device using fwupdate tool. However, I’d like to be able to recover the device even if it cannot to up and is in bootloader mode. I looked at fastboot and swiflash tools for that. The swiflash tool failed on download of the firmware. Regarding the bootloader, I’m not sure what should be the image to recover the device(Mangoh Green WP8548) with.

Thanks,

Ohad

---

<div class="post-metadata">

**Author:** ![ohad](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@ohad](https://mangoh.discourse.group/u/ohad)\
**Post date:** [April 4, 2018, 1:57pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/4 "2018-04-04T13:57:52Z")

</div>

And here’s the output:

$swiflash -m “WP85XX” -i WPx5xx\_Release14\_GENERIC\_SPK.spk  
Detecting USB of the target  
DONE  
Communicating with the target  
DONE  
Switching to firmware download mode  
…DONE  
Downloading the firmware  
…ERROR: Firmware Download failed. Callback status 59399DONE  
ERROR: Firmware Download Failed

---

<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:** [April 4, 2018, 3:41pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/5 "2018-04-04T15:41:04Z")

</div>

Is there a reason why you’re loading release 14 instead of release 15?

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/nick/32/1380_2.png) [@nick](https://mangoh.discourse.group/u/nick)\
**Post date:** [April 4, 2018, 5:00pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/6 "2018-04-04T17:00:35Z")

</div>

Hey @ohad,

I believe `swiflash` is designed to be used with `.cwe` files. I’ve been installing `.spk` files by invoking `fwupdate download <firmwareFile> <targetIP>`.

---

<div class="post-metadata">

**Author:** ![ohad](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@ohad](https://mangoh.discourse.group/u/ohad)\
**Post date:** [April 4, 2018, 9:59pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/7 "2018-04-04T21:59:27Z")

</div>

Hey @nick,

I followed the recovery procedure at [https://source.sierrawireless.com/resources/legato/wpxxxxrecoveryprocedure/](https://source.sierrawireless.com/resources/legato/wpxxxxrecoveryprocedure/)  
@dfrey, there’s no reason to use release 14, I tried both 14 and 15 with the same results.

---

<div class="post-metadata">

**Author:** ![daav](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/daav/32/79_2.png) [@daav](https://mangoh.discourse.group/u/daav)\
**Post date:** [April 5, 2018, 5:33am UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/8 "2018-04-05T05:33:07Z")

</div>

Hey here,  
Some information concerning images flashing:

- both `fwupdate` and `swiflash` work with both `.cwe` and `.spk` files
- actually, a `.spk` is by convention a composite concatenation of several `.cwe` images (e.g. modem Firmware image + linux image + legato image)
- the difference between `fwupdate` and `swiflash` is:
  - `fwupdate` (host script) works over an SSH connection, to provision the file and call the `fwupdate` (embedded tool) to apply the update from the Linux land.
  - `swiflash` works at a lower level, requiring a physical USB connection to the device, and is able to perform download even if linux or legato is not running correctly on the device  
(designed for recovery use cases)

---

<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:** [April 5, 2018, 3:05pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/9 "2018-04-05T15:05:28Z")

</div>

What @daav said is useful and correct. One other tool that exists in the same area is FDT2. FDT2 (like swiflash) can be used to recover units that don’t have a functional ssh service running. FDT2 runs on Windows whereas swiflash runs on Linux.

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/nick/32/1380_2.png) [@nick](https://mangoh.discourse.group/u/nick)\
**Post date:** [April 12, 2018, 1:19am UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/10 "2018-04-12T01:19:46Z")

</div>

Hey all,

I was successfully flashing official firmware packages with `swiflash` but I’ve been seeing `Callback status 59399DONE` as reported by @ohad since earlier today (on 7 separate units and 2 separate computers). I have a feeling this has something to do with the host setup but I’m not sure.

---

<div class="post-metadata">

**Author:** ![ohad](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@ohad](https://mangoh.discourse.group/u/ohad)\
**Post date:** [April 12, 2018, 9:23am UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/11 "2018-04-12T09:23:09Z")

</div>

Hi guys,

We succeeded to execute swiflash from another PC. The problem seems to be related to USB drivers on the laptop we tried to flash from(Dell Latitude 5580, Ubuntu 16.04). After we succeeded to flash from another laptop, we could do it also from the original laptop after rebooting it and when the USB1 device comes up properly(which does not always happen…).

Thanks for the help,  
Ohad

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/nick/32/1380_2.png) [@nick](https://mangoh.discourse.group/u/nick)\
**Post date:** [April 12, 2018, 10:37am UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/12 "2018-04-12T10:37:49Z")

</div>

Thanks @ohad. I definitely suspected the issue was the host computer since my entire fleet stopped working a the same time. I’ll give this a go in a few hours.

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/nick/32/1380_2.png) [@nick](https://mangoh.discourse.group/u/nick)\
**Post date:** [April 12, 2018, 8:49pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/13 "2018-04-12T20:49:16Z")

</div>

I spent an hour or so re-installing Ubuntu 16.04 and it works now. ![07f8a91fb093452bea90e52a208c62c6](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/1X/f50ece3b7915a6d01f45784488f21268a86637cb.png)

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/nick/32/1380_2.png) [@nick](https://mangoh.discourse.group/u/nick)\
**Post date:** [April 26, 2018, 9:58pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/14 "2018-04-26T21:58:25Z")

</div>

Hey all,

My issues with swiflash appear to be back… that means I got 14 days out of this Ubuntu installation with working swiflash. I have no idea what causes this, but it’s not feasible to simply re-install the OS every time this goes sideways.

Does swiflash have some cache or configuration files I should be clearing?

---

<div class="post-metadata">

**Author:** ![daav](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/daav/32/79_2.png) [@daav](https://mangoh.discourse.group/u/daav)\
**Post date:** [April 27, 2018, 7:15am UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/15 "2018-04-27T07:15:05Z")

</div>

Hi @nick

a swiflash update was posted yesterday (4.6)  
Please can you update with apt and try again?

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/nick/32/1380_2.png) [@nick](https://mangoh.discourse.group/u/nick)\
**Post date:** [April 27, 2018, 3:31pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/16 "2018-04-27T15:31:00Z")

</div>

Hey @daav,

I’ve tested with `swiflash` 4.6 and 4.5. This issue seems to be following my host computer. I’m also having trouble applying updates over `fwupdate` for some reason. I’ll keep you guys posted as I investigate this.

Cheers!

---

<div class="post-metadata">

**Author:** ![mvonflotow](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@mvonflotow](https://mangoh.discourse.group/u/mvonflotow)\
**Post date:** [September 25, 2019, 11:16pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/17 "2019-09-25T23:16:41Z")

</div>

@nick, were you every able to sort this out?

Were you operating on a VM or a dedicated host? I have not been able to successfully run swiflash from my Ubuntu VM, but fwupdate has worked well so far.

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/nick/32/1380_2.png) [@nick](https://mangoh.discourse.group/u/nick)\
**Post date:** [September 26, 2019, 4:34pm UTC](https://mangoh.discourse.group/t/how-to-flash-new-kernel-to-mangoh/1293/18 "2019-09-26T16:34:32Z")

</div>

Hey @mvonflotow,

I never really figured this out. To my knowledge, `swiflash` is another proprietary wrapper around proprietary Qualcomm software. I’m not sure if the bug is actually in `swiflash` itself or something related to the host computer. I tried from a few different towers running Ubuntu 16 and never got anywhere (I even double checked the mangOH getting started docs). For this reason I don’t adopt closed source projects such as the mangOH anymore (some of it’s open, but not the bits that matter).
