# Legato not installed using fwupdate

**URL:** <https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553>\
**Category:** Legato Application Framework\
**Created:** [July 17, 2023, 9:26am UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553 "2023-07-17T09:26:20Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![ben1](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@ben1](https://forum.legato.io/u/ben1)\
**Post date:** [July 19, 2023, 12:09pm UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/21 "2023-07-19T12:09:13Z")

</div>

Does the `lefwkro` partition only contain the Legato Framework?  
I mean by that, does it not contain any of the application code we’ve written?

---

<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:** [July 19, 2023, 12:37pm UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/22 "2023-07-19T12:37:41Z")

</div>

When you download application to it by .update, it will install in userapp partition

---

<div class="post-metadata">

**Author:** ![ben1](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@ben1](https://forum.legato.io/u/ben1)\
**Post date:** [July 19, 2023, 12:41pm UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/23 "2023-07-19T12:41:09Z")

</div>

And when the application is bundled with the framework as the output of `mksys` and `systocwe`, is all of it written in lefwkro or are the apps written into `userapp`?

---

<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:** [July 19, 2023, 1:31pm UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/24 "2023-07-19T13:31:37Z")

</div>

for the application embedded in legato.cwe, it will be installed in /mnt/legato which is the lefwkro partition

---

<div class="post-metadata">

**Author:** ![ben1](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@ben1](https://forum.legato.io/u/ben1)\
**Post date:** [July 19, 2023, 1:49pm UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/25 "2023-07-19T13:49:32Z")

</div>

thanks ok. So if we never use `update`, the userapp partition is never used?

---

<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:** [July 19, 2023, 2:04pm UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/26 "2023-07-19T14:04:08Z")

</div>

you can use userapp partition as file storge.  
e.g.  
/home/root

---

<div class="post-metadata">

**Author:** ![ben1](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@ben1](https://forum.legato.io/u/ben1)\
**Post date:** [July 19, 2023, 3:02pm UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/27 "2023-07-19T15:02:11Z")

</div>

Is there a way to unlock `at!partition`?

---

<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:** [July 19, 2023, 3:25pm UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/28 "2023-07-19T15:25:50Z")

</div>

You need to contact distributor to get a tool

Btw, what is the relationship of at!partition to current issue?

---

<div class="post-metadata">

**Author:** ![ben1](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@ben1](https://forum.legato.io/u/ben1)\
**Post date:** [July 19, 2023, 4:49pm UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/29 "2023-07-19T16:49:06Z")

</div>

> Btw, what is the relationship of at!partition to current issue?

The current issue is that mtd14 is now too small after a bad block appeared. Increasing the size of the partition would allow to have a bad block and still have enough space for legato

Alternatively, is there a way to increase the compression of squashfs when building legato?

---

<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:** [July 19, 2023, 5:11pm UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/30 "2023-07-19T17:11:22Z")

</div>

Have you tried to format that partition?

---

<div class="post-metadata">

**Author:** ![ben1](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@ben1](https://forum.legato.io/u/ben1)\
**Post date:** [July 20, 2023, 7:46am UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/31 "2023-07-20T07:46:37Z")

</div>

Do you expect it to remove bad block? It has been marked bad by the `fwupdate` process after failing to write or erase the block.

Is that a known issue?

---

<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:** [July 20, 2023, 7:54am UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/32 "2023-07-20T07:54:01Z")

</div>

i don’t know if it helps or damages the module, i never met such problem before

---

<div class="post-metadata">

**Author:** ![ben1](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@ben1](https://forum.legato.io/u/ben1)\
**Post date:** [July 20, 2023, 8:54am UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/33 "2023-07-20T08:54:00Z")

</div>

Is it possible to apply compression to the legato image when using systocwe?

I’ve been saving space where I could (using `-s` with systocwe saved significant space), but now I think the squashfs compression is likely the next best way to reduce the size.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/e/eadf981bb391e6423853e3debe754adc4d061282.png)

Here I see compress is set to 0. Do you have some documentation on how to improve the compression?

---

<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:** [July 20, 2023, 9:14am UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/34 "2023-07-20T09:14:19Z")

</div>

not sure if swicwe can help on compressing the image:

```auto

owner@ubuntu:~/Yocto/tools/swicwe/linux64$ ./swicwe --full-help
swicwe (version 1.8.1)
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.

Usage:
swicwe <--LCWE|--YCWE|--ACWE|--BCWE|--MCWE|--CONT|--REPL| -P> [-Z] [-F] [-R] [-X] [-x] [<image type>...] [<image name>...] [-o <output cwe file>]

Commands and options:
--LCWE: set to generate Legato CWE file.
                  If no 'image type' specified will assume '--framework legato.* -o legato[z].cwe'.
                  output CWE filename defaulted to legato[z].cwe if not specified.
--YCWE: set to generate Yocto CWE file. If no or less 'image type' specified will assume'.
                  '--lk appsboot-yocto.mbn --kernel kernel --rootfs rootfs -o yocto[z].cwe'.
                  output CWE filename defaulted to yocto[z].cwe if not specified.
--ACWE: set to generate application CWE file, which contains Legato and Yocto images. If no or less 'image type' specified will assume
                  '--lk appsboot-yocto.mbn --kernel kernel --rootfs rootfs --framework legato.* -o yocto-legato[-z].cwe'.
                  output CWE filename defaulted to yocto-legato[-z].cwe if not specified.
--BCWE: set to generate bootloader CWE file. If no or less 'image type' specified will assume.
                  '--sbl2 sbl2.mbn --rpm rpm.mbn -o boot[z].cwe'.
                  output CWE filename defaulted to boot[z].cwe if not specified.
--MCWE: set to generate modem CWE file. If no or less 'image type' specified will assume.
                  '--dsp1 dsp1.mbn --dsp2 dsp2.mbn --dsp3 dsp3.mbn -o modem[z].cwe'.
                  output CWE filename defaulted to modem[z].cwe if not specified.
--CONT: set to concatenate CWE files.
--REPL: set to replace CWE files.
-Z: set to compress mode for output CWE file.
-F: set to generate forward full-FOTA CWE file.
-R: set to generate reverse full-FOTA CWE file.
-P: set to parse the input CWE file.
-X: set to parse psb of the input FOTA CWE file.
-x: set to parse the input FOTA CWE file.
image type: specify the type(s) of the input image, options:
                  -a: application CWE file (including Legato and Yocto ones) when do CWE concatenation, doesn't coexist with -l|-y.
                  -b: bootloader CWE file when do CWE concatenation.
                  -l: Legato CWE file when do CWE concatenation, doesn't coexist with -a.
                  -m: modem CWE file when do CWE concatenation.
                  -y: Yocto CWE file when do CWE concatenation, doesn't coexist with -a.
                  -f: (full or delta) FOTA CWE file when do CWE concatenation.
                  --af: application CWE file (including Legato and Yocto forward ones) when do CWE concatenation, doesn't coexist with -lr|-yr.
                  --bf: bootloader forward CWE file when do CWE concatenation.
                  --lf: Legato forward CWE file when do CWE concatenation, doesn't coexist with -ar.
                  --mf: modem forward CWE file when do CWE concatenation.
                  --yf: Yocto forward CWE file when do CWE concatenation, doesn't coexist with -ar.
                  --ar: application CWE file (including Legato and Yocto reverse ones) when do CWE concatenation, doesn't coexist with -lr|-yr.
                  --br: bootloader reverse CWE file when do CWE concatenation.
                  --lr: Legato reverse CWE file when do CWE concatenation, doesn't coexist with -ar.
                  --mr: modem reverse CWE file when do CWE concatenation.
                  --yr: Yocto reverse CWE file when do CWE concatenation, doesn't coexist with -ar.
                  --fr: (full or delta) FOTA reverse CWE file when do CWE concatenation.
                  --lk: LK bootloader image when generate Yocto CWE file from LK, defaulted to 'appsboot-yocto.mbn'.
                  --kernel: kernel image when generate Yocto CWE file from kernel, defaulted to 'kernel'.
                  --rootfs: root file system image when generate Yocto CWE file from rootfs, defaulted to 'rootfs'.
                  --framework: Legato framework image when generate Legato CWE file from framework, defaulted to 'legato.*'.
                  --application: Legato user application image when generate Legato CWE file from application.
                  --dsp1: DSP1 image when generate modem CWE from dsp1, defaulted to 'dsp1.mbn'.
                  --dsp2: DSP2 image when generate modem CWE from dsp2, defaulted to 'dsp2.mbn'.
                  --dsp3: DSP3 image when generate modem CWE from dsp3, defaulted to 'dsp3.mbn'.
                  --rpm: RPM image when generate bootloader CWE from rpm, defaulted to 'rpm.mbn'.
                  --part: QPAR image when generate bootloader CWE from partition table.
                  --sbl1: SBL1 image when generate bootloader CWE from sbl1.
                  --sbl2: SBL2 image when generate bootloader CWE from sbl2, defaulted to 'sbl2.mbn'.
                  --lk_rev: LK bootloader image when generate reverse full-FOTA Yocto CWE file from LK, defaulted to 'appsboot-yocto_rev.mbn'.
                  --kernel_rev: kernel image when generate reverse full-FOTA Yocto CWE file from kernel, defaulted to 'kernel_rev'.
                  --rootfs_rev: root file system image when generate reverse full-FOTA Yocto CWE file from rootfs, defaulted to 'rootfs_rev'.
                  --framework_rev: Legato framework image when generate reverse full-FOTA Legato CWE file from framework, defaulted to 'legato_rev.*'.
                  --application_rev: Legato user application image when generate reverse full-FOTA Legato CWE file from application.
                  --dsp1_rev: DSP1 image when generate reverse full-FOTA modem CWE from dsp1, defaulted to 'dsp1_rev.mbn'.
                  --dsp2_rev: DSP2 image when generate reverse full-FOTA modem CWE from dsp2, defaulted to 'dsp2_rev.mbn'.
                  --dsp3_rev: DSP3 image when generate reverse full-FOTA modem CWE from dsp3, defaulted to 'dsp3_rev.mbn'.
                  --rpm_rev: RPM image when generate reverse full-FOTA bootloader CWE from rpm, defaulted to 'rpm_rev.mbn'.
                  --part_rev: QPAR image when generate reverse full-FOTA bootloader CWE from partition.
                  --sbl1_rev: SBL1 image when generate reverse full-FOTA bootloader CWE from sbl1.
                  --sbl2_rev: SBL2 image when generate reverse full-FOTA bootloader CWE from sbl2, defaulted to 'sbl2_rev.mbn'.
                  -v: specify the version of output CWE file.
                  --pid: specify the product id of CWE file.
                  --lk_cwe: LK cwe image when do concatenate CWE concatenation, just for mdm9x40.
                  --file: file CWE file when do CWE concatenation.
image name: set to the name(s) of input image.
output CWE file: set to the name output image.

Examples:
Generate Legato CWE file:
swicwe --LCWE [-Z] [-F] [-R] [--framework <image>] [--application <image>] [-v <version>] [--pid <product id>] [-o <cwe file>]
swicwe --LCWE -Z
swicwe --LCWE --framework legato-image.ar7.yaffs2
swicwe --LCWE --application userapp.yaffs2 --pid A911 -o uapp.cwe
swicwe --LCWE -Z --framework legato-image.ar7.yaffs2 --application userapp.yaffs2 -o legato-uapp-z.cwe
swicwe --LCWE -F -Z --framework legato-image.ar7.yaffs2 -o fota-legato-uapp-z.cwe
swicwe --LCWE -R -Z --framework legato-image.ar7.yaffs2 --framework_rev legato-image_rev.ar7.yaffs2 -o fota-legato-reverse.cwe
swicwe --LCWE --pid 9X40 --framework legato-image.ar759x.yaffs2 -o legato-mdm9x40.cwe

Generate Yocto CWE file:
swicwe --YCWE [-Z] [-F] [-R] [--lk <image>] [--kernel <image>] [--rootfs <image>] [-v <version>] [--pid <product id>] [-o <cwe file>]
swicwe --YCWE
swicwe --YCWE --lk appsboot-yocto.mbn --kernel kernel --rootfs rootfs -o yocto.cwe
swicwe --YCWE --kernel kernel -v 06.03.00 --pid A911 -o kernel.cwe
swicwe --YCWE -Z --kernel kernel-test -o kernelz.cwe
swicwe --YCWE -F -Z --lk appsboot-yocto.mbn --kernel kernel --rootfs rootfs -o fota-yocto.cwe
swicwe --YCWE -R -Z --lk appsboot-yocto.mbn --lk_rev appsboot-yocto_rev.mbn -o fota-yocto-reverse.cwe
swicwe --YCWE --kernel boot-yocto-mdm9x40.img --rootfs mdm9x40-image-minimal-swi-mdm9x40.2k.yaffs2 -o yocto-mdm9x40.cwe

Generate application (Legato+Yocto) CWE file (just for mdm9x15):
swicwe --ACWE [-Z] [-F] [-R] [--lk <image>] [--kernel <image>] [--rootfs <image>] [-v <version>] [--pid <product id>] [--framework <image>] [--application <image>] [-o <cwe file>]
swicwe --ACWE --lk appsboot-yocto.mbn --kernel kernel --rootfs rootfs --framework legato-image.ar7.yaffs2 --application userapp.yaffs2 -o yocto.cwe
swicwe --ACWE -Z --rootfs rootfs --framework legato-image.ar7.yaffs2 --pid A911 -o rootfs-framework-z.cwe
swicwe --ACWE -F -Z --lk appsboot-yocto.mbn --kernel kernel -o fota-yocto.cwe
swicwe --ACWE -R -Z --lk --kernel kernel --kernel_rev kernel_rev --framework legato-image.ar7.yaffs2 --framework_rev legato-image_rev.ar7.yaffs2 -o fota-yocto-reverse.cwe

Generate bootloader CWE file:
swicwe --BCWE [-Z] [-F] [-R] [--sbl1 <image>] [--sbl2 <image>] [--rpm <image>] [-v <version>] [--pid <product id>] [-o <cwe file>]
swicwe --BCWE
swicwe --BCWE --sbl2 sbl2.mbn --rpm rpm.mbn -v 06.03.00 -o boot.cwe
swicwe --BCWE --part partition_nand_9x15_sierra_ar_4g.xml.mbn --sbl1 sbl1.mbn --sbl2 sbl2.mbn --rpm rpm.mbn -o boot_partition_update.cwe
swicwe --BCWE -F --part partition_nand_9x15_sierra_ar_4g.xml.mbn --sbl1 sbl1.mbn --sbl2 sbl2.mbn --rpm rpm.mbn -o fota-boot_partition_update.cwe
swicwe --BCWE -R --sbl1 sbl1.mbn --sbl1 sbl1.mbn -o fota-boot-reverse.cwe
swicwe --BCWE --pid 9X40 --lk lk.mbn -o lk.cwe
swicwe --BCWE --pid 9X40 --tz tz.mbn --sbl1 sbl1.mbn --rpm rpm.mbn --lk lk.mbn -o boot_mdm9x40.cwe

Generate modem CWE file:
swicwe --MCWE [-Z] [-F] [-R] [--dsp1 <image>] [--dsp2 <image>] [--dsp3 <image>] [-v <version>] [--pid <product id>] [-o <cwe file>]
swicwe --MCWE -Z --dsp1 dsp1.mbn --dsp2 dsp2.mbn --dsp3 dsp3.mbn -o modemz.cwe
swicwe --MCWE -F -Z --dsp1 dsp1.mbn --dsp2 dsp2.mbn -o fota-modem.cwe
swicwe --MCWE -Z -R --dsp1 dsp1.mbn --dsp1_rev dsp1_rev.mbn --dsp2 dsp2.mbn --dsp2_rev dsp2_rev.mbn -o fota-modemz-reverse.cwe
swicwe --MCWE -Z
swicwe --MCWE --dsp2 dsp2.mbn NON-HLOS.ubi -o modem-mdm9x40.cwe

Concatenate CWE files:
swicwe --CONT <[[-a <cwe image>]|[-l <cwe image>][-y <cwe image>]] [-m <cwe image>] [-v <version>] [--pid <product id>] [-b <cwe image>]>
                [--file <cwe image>] [-f <cwe image>] [-o <[spkg][-boot[z]][-modem[z]][-yocto[z]][-legato[z]][-file][-fota]>.cwe]
swicwe --CONT -a yocto-legato-z.cwe -m modem.cwe -b boot.cwe -o spkg-boot-modem-yoctoz-legatoz.cwe
swicwe --CONT -a yocto-legato-z.cwe -m modem.cwe -b boot.cwe -f fota.cwe -o foto-boot-modem-yoctoz-legatoz.cwe
swicwe --CONT -f fota.cwe --pid A911 -o foto-fota.cwe
swicwe --CONT -l legatoz.cwe -f full-fota.cwe -o foto-legato-fota.cwe
swicwe --CONT -l legatoz.cwe -y yoctoz.cwe -f delta-fota.cwe -o foto-legato-yocto-fota.cwe
swicwe --CONT --lf fota-legato-forward.cwe --yr fota-yocto-forward.cwe --f delta-fota-forward.cwe -o foto-legato-yocto-fota-forward.cwe
swicwe --CONT --lr fota-legato-reverse.cwe --yr fota-yocto-reverse.cwe --fr delta-fota-reverse.cwe -o foto-legato-yocto-fota-reverse.cwe
swicwe --CONT --pid 9X40 -b boot-mdm9x40.cwe -l legato-mdm9x40.cwe -y yocto-mdm9x40.cwe -m modem-mdm9x40.cwe -o spkg-boot-modem-yocto-legato.cwe
swicwe --CONT --pid 9X40 -b boot-mdm9x40.cwe -l legato-mdm9x40.cwe -y yocto-mdm9x40.cwe -m modem-mdm9x40.cwe --lk_cwe lk.cwe -o spkg-boot-modem-yocto-legato.cwe
swicwe --CONT --pid 9X40 -b boot.cwe -l legato.cwe -y yocto.cwe -m modem.cwe --file file.cwe -o spkg-boot-modem-yocto-legato-file.cwe

Concatenate CWE files:
swicwe --REPL <[[-i <spk image>]|[-l <cwe image>][-y <cwe image>]] [-m <cwe image>] [-v <version>] [--pid <product id>] [-b <cwe image>]>
                [-o <[boot[z]][-modem[z]][-yocto[z]][-legato[z]]>.spk]
swicwe --REPL -i boot-modem-yocto-legato-file.spk -b boot.cwe -o boot-modem-yocto-legato-file-replace.spk
swicwe --REPL -i boot-modem-yocto-legato-file.spk -l legato.cwe -o boot-modem-yocto-legato-file-replace.spk
swicwe --REPL -i boot-modem-yocto-legato-file.spk -y yocto.cwe -o boot-modem-yocto-legato-file-replace.spk
swicwe --REPL -i boot-modem-yocto-legato-file.spk -m modem.cwe -o boot-modem-yocto-legato-file-replace.spk

Parse CWE file
swicwe -P <cwe image>
swicwe -P yocto-legato-z.cwe

Parse psb of FOTA CWE file
swicwe -X <full-FOTA/delta-FOTA image>
swicwe -X full-fota.cwe

Parse FOTA cwe file
swicwe -x <full-FOTA/delta-FOTA image>
swicwe -x full-fota.cwe

```

---

<div class="post-metadata">

**Author:** ![ben1](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@ben1](https://forum.legato.io/u/ben1)\
**Post date:** [July 21, 2023, 7:18am UTC](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553/35 "2023-07-21T07:18:12Z")

</div>

Reducing the size of the legato system allowed to recover the unit.

In conclusion to this issue:

- Our legato system (including apps) was fitting the partition, but the first bad block declared in the memory led to not having enough space for it
- Although that unit cannot be recovered without flashing over USB, reducing the size of the legato system should allow to prevent the problem in further updates (bad blocks are declared during updates, when the partition is erased then written again)
- One of the simplest way to gain space was to strip the binary when building with `systocwe`, using the `-s` parameter
- For our application, the partition can now have up to 7 bad blocks and still have enough space for the firmware (instead of 0)

Here are useful commands to monitor the states of the bad blocks in the memory:  
`cat /proc/mtd` lists the partitions and their name  
`mtdinfo -M /dev/mtd14` shows the details of mtd14 partition including any bad blocks

[Previous page](https://forum.legato.io/t/legato-not-installed-using-fwupdate/6553.md?page=1)
