Larger RootFS WP8548

Hi everyone,

I’m trying to increase the size of the RootFS on the WP8548 to be able to add Java and other layers to the Yocto image. I found the following topic viewtopic.php?f=179&t=8564 with as it seemed exactly the same problem.

I started with the following configuration:

AT!APPPARTCHG? Total APP partition size: 253824 kB APPSBL,PAD,APPS,PAD,SYSTEM,PAD,USERDATA,PAD,USERAPP,PAD = 896,128,20096,384,50048,384,37888,2560,140288,1280

And I increased the system partition to 160000KB:

AT!ENTERCND="A710" AT!APPPARTCHG=896,128,20096,384,160000,384,37888,2560,31615,1 AT!RESET

After this I checked the layout again:

AT!APPPARTCHG? Total APP partition size: 253824 kB APPSBL,PAD,APPS,PAD,SYSTEM,PAD,USERDATA,PAD,USERAPP,PAD = 896,128,20096,384,160000,384,37888,2560,30335,1153

The most important partitions are correct, only for some reason it added some padding after the last partition. After this I tried to flash a Yocto image with a bigger RootFS to the WP8548 with the FirmwareDownloadTool but i got the following error every time i tried it:

[code]./fdt boot-yocto-legato_wp85.cwe
FDT version: 4.1.1408.1
Checking modem mode …
Disabling selective suspend …
Switching device to boot & hold mode …
Checking modem mode …
Switching device to streaming mode …
Checking modem mode …
Verifying image file …
Downloading firmware …

Flashing firmware …

Firmware download failed.
Primary error code: 77 - Failed in streaming download stage.
Secondary error code: 55 - Failed in closing unframed data write.
Total time elapsed: 101729 ms.[/code]

When i tried to flash an image with a smaller RootFS it didn’t fail, so I thought that something went wrong while formatting the partitions. To make sure the partitions were correct i checked it from Linux:

[code]root@swi-mdm9x15:~# mtdinfo -a
Count of MTD devices: 7
Present MTD devices: mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6
Sysfs interface supported: yes

mtd0
Name: bootloader
Type: nand
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 8 (1048576 bytes, 1024.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:0
Bad blocks are allowed: true
Device is writable: true

mtd1
Name: kernel
Type: nand
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 160 (20971520 bytes, 20.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:2
Bad blocks are allowed: true
Device is writable: true

mtd2
Name: rootfs
Type: nand
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 1253 (164233216 bytes, 156.6 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:4
Bad blocks are allowed: true
Device is writable: true

mtd3
Name: user0
Type: nand
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 316 (41418752 bytes, 39.5 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:6
Bad blocks are allowed: true
Device is writable: true

mtd4
Name: user1
Type: nand
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 257 (33685504 bytes, 32.1 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:8
Bad blocks are allowed: true
Device is writable: true

mtd5
Name: user2
Type: nand
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 40 (5242880 bytes, 5.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:10
Bad blocks are allowed: true
Device is writable: true

mtd6
Name: user3
Type: nand
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:12
Bad blocks are allowed: true
Device is writable: true[/code]

Only this doesn’t seem to correspond to the mounted file system:

root@swi-mdm9x15:~# df -h Filesystem Size Used Available Use% Mounted on devtmpfs 256.0K 0 256.0K 0% /dev /dev/ubiblock0_0 16.5M 16.5M 0 100% / mdev 256.0K 0 256.0K 0% /dev tmpfs 74.2M 0 74.2M 0% /dev/shm tmpfs 74.2M 0 74.2M 0% /run tmpfs 74.2M 32.0K 74.2M 0% /var tmpfs 74.2M 0 74.2M 0% /tmp /dev/mtdblock4 32.1M 1.7M 30.4M 5% /mnt/flash /dev/mtdblock3 39.5M 31.4M 8.1M 79% /mnt/legato /dev/mtdblock5 5.0M 1.3M 3.7M 27% /mnt/userrw aufs 32.1M 1.7M 30.4M 5% /etc aufs 32.1M 1.7M 30.4M 5% /data

After this i tried to change the partitions again but now i can’t anymore, even the old partition layout gives an error:

AT!ENTERCND="A710" OK AT!APPPARTCHG=896,128,20096,384,50048,384,37888,2560,140288,1280 ERROR

So I have a couple of questions:
[ul]

  • How can I flash a image with a larger RootFS?
  • Why can’t I change the flash partitions anymore, while I have been able to do it before?
  • Where can I find the reference manual for the AT commands for the WP8548? I only know of AT commands that I have found in other topics.
    [/ul]
    Thanks!

Model: WP8548
Revision: SWI9X15Y_07.08.02.00 r31088 CARMD-EV-FRMWR1 2016/02/05 23:29:29

This command is trying to be too smart for itself.

First suggestion is to always work in increments of 128, as this is the block size of the flash.
You can correlate the values returned against the output from ‘mtdinfo -a’.

root@swi-mdm9x15:~# mtdinfo -a
Count of MTD devices:           7
Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6
Sysfs interface supported:      yes

mtd0
Name:                           bootloader
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          8 (1048576 bytes, 1024.0 KiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:0
Bad blocks are allowed:         true
Device is writable:             true

mtd1
Name:                           kernel
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          160 (20971520 bytes, 20.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:2
Bad blocks are allowed:         true
Device is writable:             true

mtd2
Name:                           rootfs
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          394 (51642368 bytes, 49.2 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:4
Bad blocks are allowed:         true
Device is writable:             true

mtd3
Name:                           user0
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          316 (41418752 bytes, 39.5 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:6
Bad blocks are allowed:         true
Device is writable:             true

mtd4
Name:                           user1
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          1116 (146276352 bytes, 139.5 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:8
Bad blocks are allowed:         true
Device is writable:             true

mtd5
Name:                           user2
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          40 (5242880 bytes, 5.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:10
Bad blocks are allowed:         true
Device is writable:             true

mtd6
Name:                           user3
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:12
Bad blocks are allowed:         true
Device is writable:             true

For mtd0, there are 8 eraseblocks. This corresponds to (896+128) / 128 (That’s APPSBL+PAD in the output from AT!APPPARTCHG?).

You may notice the last values for USERAPP+PAD (mtd4) don’t line up. 1116 eraseblocks != (140288+1280)/128. That’s because the AT command is trying to be smart and hide 1280 kB from you, mainly to give people a buffer if they aren’t working in increments of 128. Ideally, this command would be better if it worked in eraseblocks.

Note there are newer releases available than the SWI9X15Y_07.08.02.00 you’ve listed in your email.
source.sierrawireless.com/resources/legato/wpfirmwarerelease/

Last week I tried to recreate the problem to gather logs from the Firmware Download Tool, but now it works and I can’t recreate the problem. At first I thought it had something to do with the new image I build with Yocto, but I can even flash the original image without any problem.