This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to change Androids img partition size to work with fastboot

Hi,

I need a larger system img partition size. I have changed and created it correctly in devices BoardConfig.mk file to 512M.

However during fastboot for writing it to MMC it fails:

sending 'system' (262144 KB)...

FAILED (remote: data too large)

Why it still "thinks" this image has 256M? How could I change it?

  • Hi Rafael,

    u-boot provides a maximum data limit that is declared in the board config header file. If the data to upload is bigger than this value, fastboot will failed with the exact error you have.

    It is declared in <ti_android_bsp>/u-boot/include/configs/am335x_evm.h line 411
    By default the value is 240M:

    #define CONFIG_FASTBOOT_MAX_TRANSFER_SIZE (SZ_256M - SZ_16M)

    You can just redefine this macro CONFIG_FASTBOOT_MAX_TRANSFER_SIZE to get rid of this limitation.
  • Great, that was it. However there is a comment in there that it was only 256 (less 16) to fit the RAM memory. So fastboot puts the entire partition in RAM before writing it? Why not just streaming the partition directly to the mmc?

    Well i'm going to try to write a 512mb partition, hope it will handle it even having only 512mb of RAM on BBB.

    Thanks a lot.
  • For some reason it still fails with a 400m userdata image. Any ideas of the max size a partition could have? I want to have a 256mb system, 256mb cache and 512mb userdata. Why it does not let me do it? Besides how can I use the other 1Gb of this memory?

    sending 'system' (262144 KB)...
    OKAY [ 84.005s]
    writing 'system'...
    OKAY [ 39.714s]
    finished. total time: 123.720s
    sending 'userdata' (409600 KB)...
    OKAY [131.262s]
    writing 'userdata'...
    FAILED (remote: image too large for partition)
  • Hi Rafael,

    It seems like your partition "userdata" is too small for your image.
    Can you please check the size defined for it in u-boot/drivers/usb/gadget/u_fastboot_mmc.c ?

    By default, it's 256MB

    drivers/usb/gadget/u_fastboot_mmc.c: { "userdata", 256*1024 }, /* User data */

    Thanks.
  • Hi, sorry for the delay, but I was out of office.

    Actually I have changed all partitions there:

    static struct partition partitions[] = {
    { "-", 128 }, /* Master Boot Record and GUID Partition Table */
    { "spl", 128 }, /* First stage bootloader */
    { "bootloader", 512 }, /* Second stage bootloader */
    { "misc", 128 }, /* Rserved for internal purpose */
    { "-", 128 }, /* Reserved */
    { "recovery", 8*1024 }, /* Recovery partition */
    { "boot", 8*1024 }, /* Partition contains kernel + ramdisk images */
    { "system", 512*1024 }, /* Android file system */
    { "cache", 256*1024 }, /* Store Application Cache */
    { "userdata", 512*1024 }, /* User data */
    { "media", 0 }, /* Media files */
    { 0, 0 },
    };

     

    It's odd user data still fails

  • One more question, is those configs who define the actual space on the user data in beagleboneblack? Or could I after fastboot resize the user data partition to use the entire memory?
  • Hi,

    Have you format the mmc with your new partitioning?
    If not, please try

    fastboot oem format

    And please send me the trace of this command if you are still facing issues.