Legato framework seems to factory reset itself

Hi, I have an FX30s using 16.10.1.m3 R14 and am having a problem where is seems to be doing a factory reset on itself occasionally. i.e. user apps are removed and /home/root is empty after a restart.

What could cause this? (The reset button is definitely not depressed)

Thanks,
Karl

Have you checked if “legato status” is returning good system?

@jyijyi Thanks for the reply… Yes I just ran it and it report

root@fx30s:~# legato status
Systems installed:
  0 [good] <-- current
Legato framework is running.
root@fx30s:~#

Are any logs kept on why it might have been reset?

I mean just before it goes factory reset, not now.
It seems it undergoes rollback mechanism.

In the event of an error, Legato will occasionally roll back to the master firmware even if the system has been marked good.
The only way to prevent this is to use the swiflash tool or the fwupdate tool. Using these update tools updates the master firmware so it cannot be rolled back.

fwupdate download firmware.cwe 192.168.2.2

The update tool uses the same safety features that the OTA updates use with Airvantage.

My solution to this involved bundling my apps in to a cwe file, and bundling that together with the other firmware components in to an spk. I have never had a device roll back after doing this, I am not sure if it can still roll back when you only update part of the firmware.

Thanks @shib for your reply. I guess that makes sense. Although it is a bit concerning to think I can have devices in the field that roll back their FW and that I then have no way of updating them :/. I will look at creating a cwe file for my apps. I was hoping to avoid rolling my own FW and staying with the stock image, but hey ho… that does not seem feasible.

Thanks,
Karl

You can incorporate your app in to the stock image.
Use the systocwe tool to turn your app in to a cwe file.
Use the swicwe tool to create your new image.

You can probably do this:
swicwe -o my_firmware.spk -c stock_firmware.spk my_app.cwe

But I have downloaded all of the firmware components and do it like this:
swicwe -o my_firmware.spk -c carrier.spk yocto_linux.cwe legato.cwe my_app.cwe

Obviously those names are just for illustrative purposes, but you should get the idea.

Hi @shib, thanks for that. How do I determine which spk files to use and where to find them? I have downloaded and built “make” R14 and the framework…

I have now managed to create my app.cwe and what to try and create a whole bundle (as you suggested) to use in production.

Thanks

if you go to source.sierrawireless.com and find your module, you should find everything under the firmware section.

For the FX30 it can be found here.

It doesn’t look like they break the firmware components up as much with the FX30 as they do with the WP modules, but that is ok.

First you should turn your .update in to a .cwe.
systocwe wp85 app.update

If you are using the pre-built firmware, you would add your .cwe to the firmware.cwe and generate an spk.
swicwe -o firmware.spk -c stock_firmware.cwe app.cwe

If you are building everything from source, you would need to specify the individual components.
When I rebuild yocto, it generates a file yocto_wp77xx.4k.cwe. The legato build generates a cwe. The firmware package I use comes with pre-built everything else - mcu firmware, carrier firmware.
And I end up with the command I used in my previous post:
swicwe -o my_firmware.spk -c mcufw.cwe carrier.spk yocto_wp77xx.4k.cwe legato.cwe app.cwe

If you are having trouble tracking down any of these components, try running
find -name "*.cwe"
find -name "*.spk"
In the source directory.