# Unexpected automatic firmware upgrade

**URL:** <https://forum.legato.io/t/unexpected-automatic-firmware-upgrade/3906>\
**Category:** Legato Application Framework\
**Created:** [November 23, 2018, 9:03am UTC](https://forum.legato.io/t/unexpected-automatic-firmware-upgrade/3906 "2018-11-23T09:03:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien\_B](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@Julien\_B](https://forum.legato.io/u/Julien_B)\
**Post date:** [November 23, 2018, 9:03am UTC](https://forum.legato.io/t/unexpected-automatic-firmware-upgrade/3906/1 "2018-11-23T09:03:07Z")

</div>

Hi,

I noticed that my Mangoh Red got automatically upgraded to a version that does not contain my custom app.

To be more precise, I developed my own app and flashed the mangoh Red with this firmware.  
With `app status` I can see my app in the list.  
`legato status` returns:

> Systems installed:  
> 156 [good] \<– current  
> Legato framework is running.

So it looks like the firmware is correctly marked as good (I tried to run `update --mark-good` but it did not make any difference)  
I let the device run on the battery until it gets fully discharged (takes ~10 hours)  
The next day I power up the device with USB cable.  
After the device fully boots I see with `legato status` that the firmware has been upgraded

> Systems installed:  
> 157 [good] \<– current  
> Legato framework is running.

And my custom app is not listed in the `app status` list (as well as other apps that were previously there by default in my build)

I noticed some reboots and corrupted console logs when the battery is almost empty as well as when I plug the USB cable back on the board.

Is there some kind of automatic firmware upgrades? How can I disable it?

Thanks,

---

<div class="post-metadata">

**Author:** ![niladri](https://avatars.discourse-cdn.com/v4/letter/n/779978/32.png) [@niladri](https://forum.legato.io/u/niladri)\
**Post date:** [November 23, 2018, 3:06pm UTC](https://forum.legato.io/t/unexpected-automatic-firmware-upgrade/3906/2 "2018-11-23T15:06:30Z")

</div>

I have the same issue. Is there any way to update golden image with custom image?

---

<div class="post-metadata">

**Author:** ![CoRfr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/corfr/32/69_2.png) [@CoRfr](https://forum.legato.io/u/CoRfr)\
**Post date:** [November 23, 2018, 4:42pm UTC](https://forum.legato.io/t/unexpected-automatic-firmware-upgrade/3906/3 "2018-11-23T16:42:57Z")

</div>

Which vereions do you have?

It could be caused by the device rebooting multiple times in a row when the battery is almost dead. I’m not sure why would that caused a rollback though.

Is there any chance you could try again and capture the UART logs?

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/dfrey/32/563_2.png) [@dfrey](https://forum.legato.io/u/dfrey)\
**Post date:** [November 23, 2018, 6:25pm UTC](https://forum.legato.io/t/unexpected-automatic-firmware-upgrade/3906/4 "2018-11-23T18:25:54Z")

</div>

FYI: I directed this user here after they made a [post on the mangOH forum](https://forum.mangoh.io/t/unexpected-automatic-firmware-upgrade/2146) about the same topic. I suspect @CoRfr is right that it is related to brown-out. I’m not really familiar with all of the details of the rollback code. @kdunwoody can you provide some insight on this issue?

---

<div class="post-metadata">

**Author:** ![kdunwoody](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/kdunwoody/32/500_2.png) [@kdunwoody](https://forum.legato.io/u/kdunwoody)\
**Post date:** [November 23, 2018, 7:22pm UTC](https://forum.legato.io/t/unexpected-automatic-firmware-upgrade/3906/5 "2018-11-23T19:22:09Z")

</div>

@niladri: Yes, if you upgrade using FOTA (e.g. using fwupdate program), it will update the golden image.

@dfrey: @CoRfr is spot on – we need to know what Legato version this is. If it’s pre 18.07 the first step would be to try upgrading to Legato 18.09 using FOTA.

---

<div class="post-metadata">

**Author:** ![Julien\_B](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@Julien\_B](https://forum.legato.io/u/Julien_B)\
**Post date:** [November 23, 2018, 9:49pm UTC](https://forum.legato.io/t/unexpected-automatic-firmware-upgrade/3906/6 "2018-11-23T21:49:55Z")

</div>

@kdunwoody My legato version is: 18.07.0-2

I uploaded my custom firmware using this command:  
`update build/update_files/red/mangOH.wp76xx.update 192.168.2.2`  
(after flashing WP76xx\_Release9\_GENERIC\_SPK.spk through swiflash)

Can I use the fwupdate tool to install the same binary as a golden image? Or should I first create a more “complete” fw image?

Thanks for your help,  
Julien.

---

<div class="post-metadata">

**Author:** ![kdunwoody](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/kdunwoody/32/500_2.png) [@kdunwoody](https://forum.legato.io/u/kdunwoody)\
**Post date:** [November 23, 2018, 10:46pm UTC](https://forum.legato.io/t/unexpected-automatic-firmware-upgrade/3906/7 "2018-11-23T22:46:18Z")

</div>

You need to use a .cwe.

---

<div class="post-metadata">

**Author:** ![Julien\_B](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@Julien\_B](https://forum.legato.io/u/Julien_B)\
**Post date:** [November 28, 2018, 3:22pm UTC](https://forum.legato.io/t/unexpected-automatic-firmware-upgrade/3906/8 "2018-11-28T15:22:03Z")

</div>

I used systocwe to convert the mangOH.wp76xx.update into .cwe files and flashed the legato.cwe file with fwupdate and it looks to work fine.  
I ran the system on battery until it went down, plugged an USB cable to power it up and I still had the same firmware installed (with my custom app)

I will run more cycles to make sure it is now fixed.

Thanks,
