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 calculate rootfs.jffs2 size to use in u-boot

Other Parts Discussed in Thread: AM3517

Hello guys,

I'd like to know how to calculate the rootfs.jffs2 to burn it in NAND.

My rootfs.jffs2 is 151363884 ( 0x905A12C)

and i'm trying to add 2kb 151365932 (0x905A92C)

mmc1 is available
reading rootfs.jffs2

151363884 bytes read

NAND erase: device 0 offset 0x780000, size 0xf880000
Erasing at 0xffe0000 -- 100% complete.
OK
4 BIT SW ECC selected

NAND write: device 0 offset 0x780000, size 0x905A92C
Attempt to write non page aligned data
151365932 bytes written: ERROR

Command used in u-boot: mw.b 0x81600000 0xff 0xA000000;mmc init;fatload mmc 1 0x81600000 rootfs.jffs2;nand erase 780000;nandecc bch4_sw ;nand write.i 0x81600000 780000 905A92C

CPU: Variscite AM3517  

Is there anything wrong ?

Thanks

  • Hi Eduardo,

    Try to align your write size to nand page size. Round it  up to page size (2kB).
    So don't add 2kB but round it up : 151363884+ (2048-(151363884 mod 2048)) = 151365632 (0x905A800)
    If it doesn't work try to align to higher rounded value e.g  : (0x9100000)

    Regards.

  • Hello Marko,

    It works !!

    reading rootfs.jffs2

    153354240 bytes read

    NAND erase: device 0 offset 0x780000, size 0xf880000
    Erasing at 0xffe0000 -- 100% complete.
    OK
    4 BIT SW ECC selected

    NAND write: device 0 offset 0x780000, size 0x9240800
    153356288 bytes written: OK

    Thank you.