Flash partitions

Hello all!
I need to expand the flash partition size to fit my rootfs. I know I have to pass the command AT!APPPARTCHG, but I have no idea about the command syntax. Can anyone give the command details - its syntax, usage and examples if possible ?

Thanks!

Hi.

If you run the command as a query you should see something like:

at!apppartchg? Total APP partition size: 261886 kB APPSBL,PAD,APPS,PAD,SYSTEM,PAD,USERDATA,PAD,USERAPP,PAD = 768,50,20000,384,50000,300,38000,2560,149440,384

That will list the sizes of the partitions. The one you care about for your rootfs is “SYSTEM”. Depending on how large it is you can steal some space from the subsequent partitions without too many consequences. e.g. increase size by 10MB …

AT!APPPARTCHG=768,50,20000,384,60000,300,38000,2560,139440,384

Some stuff you should be aware of:

  1. This is destructive. If you move a boundary for a partition it will be deleted.
  2. Be very careful to make sure the numbers add up. You don’t want to brick your device which is entirely possible.
  3. Maybe you should try booting from NFS or SD card first. There are examples in the README for the Yocto build.

Regards,
Andrew

Thank you very much! But I may have some problems… :confused:

Can’t these partitions (such as USERDATA and USERAPP) be unified in a single one (rootfs + userdata + userapp)? For my application requires Java machine, my ROOTFS got a little bigger (something around 130MB), plus my data space.

I don’t know if these partitions make part of the android system scheme (maybe I’m talking trash, please correct me if I’m wrong) or it’s just an convenient partitioning, but comparing with the majors embedded linux solutions, the rootfs+data partition are always in same place.

In short, Can I make it in the same space?

Thanks again!

Hi.

You can’t collapse them into the same space, but you can steal as much space as you want from the others. The partitions are used as follows:

APPSBL - the bootloader. Leave this one alone
APPS - kernel
SYSTEM - rootfs
USERDATA - We put the Legato framework here in some instances, but you don’t have to. You can reclaim all of this space if you like. As of 15.01 it is mounted as /mnt/legato.
USERAPP - The big writable area for your use (mounted as /mnt/flash)

You could take space from USERDATA and USERAPP to add to your SYSTEM partition. If you want to be able to leave the option oppen to write the Legato app framework into its own partition then you should leave at least 10MB of space in USERDATA. For example, if you need 150MB in SYSTEM then you could run:

AT!APPPARTCHG=768,50,20000,384,150000,300,10000,2560,77440,384

Note - I haven’t tested these numbers. Double check everything!

As I mentioned before, you can also boot from SD, NFS or a USB stick until you have fine-tuned everything and are sure you have the numbers right.

Regards,
Andrew

Thanks again, this is exactly what I need! :smiley:

Well, not everything went ok… :frowning:

[code]AT!UNLOCK=“A710”

OK
AT!APPPARTCHG=768,50,19000,384,160000,300,10000,384,71000,0 (these numbers were based on my previous partition)
ERROR[/code]

No matter what I put after “AT!APPPARTCHG=”, I’m still getting ERROR response - even using the original partition numbers.

Do I need to unlock something else? (I’m using WP7104 module)

It’s not possible to have a size of 0 for any partitions. Do you get this error with other combinations?

You were right! Although my original partition had a block with 0 size (which I took as a base), I couldn’t set it again after typing the original numbers… Who knows why? :open_mouth:

Anyway, I set my partitions as follow and it worked fine! Now I have plenty of room for my Java machine and other stuff!

[code]
AT!UNLOCK=“A710”

OK
AT!APPPARTCHG=768,50,19000,384,160000,300,10000,383,71000,1
OK [/code]

After erasing and flashing…

Filesystem Size Used Available Use% Mounted on /dev/root 156.8M 132.8M 24.0M 85% / /dev/mtdblock4 72.0M 2.3M 69.7M 3% /mnt/flash /dev/mtdblock3 10.5M 1.5M 9.0M 14% /mnt/legato /dev/mtdblock5 5.3M 2.8M 2.4M 53% /mnt/userrw unionfs 72.0M 2.3M 69.7M 3% /etc unionfs 72.0M 2.3M 69.7M 3% /data

Thank you very much!!!

Hi, I have problem executing AT!UNLOCK="A710" in order to resize rootfs, it responds ERROR, how can I unlock my device? Please help.

Hi @rio99,

For AR755x and WP targets, I believe the command is AT!ENTERCND="A710"

Cheers,
Raf

1 Like