Ubi write command shows error on using m4 boot for free rtos

On using the method “From U-Boot using m4boot” for booting the Cortex-M4 core on Vybrid module it ends up in an error on doing the step “Colibri VFxx # ubi write ${loadaddr} m4firmware ${filesize}”. The error shown is attached below. Can anyone fix this!!

link text

alt text

Hello sreemadhav

Which hardware and software for the Toradex module you using? Send a complete log as a file instead of a printscreen, please.

Colibri VFxx # run create_m4firmware
UBI: default fastmap pool size: 200
UBI: default fastmap WL pool size: 25
UBI: attaching mtd1 to ubi0
UBI: attached by fastmap
UBI: fastmap pool size: 200
UBI: fastmap WL pool size: 100
UBI: attached mtd1 (name "mtd=3", size 510 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good PEBs: 4075, bad PEBs: 5, corrupted PEBs: 0
UBI: user volume: 3, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
UBI: available PEBs: 0, total reserved PEBs: 4075, PEBs reserved for bad PEB handling: 75
Remove UBI volume rootfs (id 2)
Creating static volume m4firmware of size 917504
UBI: detaching mtd1 from ubi0
UBI: mtd1 is detached from ubi0
UBI: default fastmap pool size: 200
UBI: default fastmap WL pool size: 25
UBI: attaching mtd1 to ubi0
UBI: attached by fastmap
UBI: fastmap pool size: 200
UBI: fastmap WL pool size: 100
UBI: attached mtd1 (name "mtd=3", size 510 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good PEBs: 4075, bad PEBs: 5, corrupted PEBs: 0
UBI: user volume: 3, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
UBI: available PEBs: 3917, total reserved PEBs: 158, PEBs reserved for bad PEB handling: 75
Creating static volume kernel of size 8388608
No size specified -> Using max size (497364992)
Creating dynamic volume rootfs of size 497364992
Colibri VFxx # fatload mmc 0:1 ${loadaddr} vybridm4-freertos.itb
reading vybridm4-freertos.itb
14280 bytes read in 15 ms (929.7 KiB/s)
Colibri VFxx # ubi write ${loadaddr} m4firmware ${filesize}
14280 bytes written to volume m4firmware
Colibri VFxx # run update_rootfs
reading colibri_vf/ubifs.img
111865856 bytes read in 3688 ms (28.9 MiB/s)
111865856 bytes written to volume rootfs
Colibri VFxx # ubi part ubi
UBI: detaching mtd1 from ubi0
UBI: mtd1 is detached from ubi0
UBI: default fastmap pool size: 200
UBI: default fastmap WL pool size: 25
UBI: attaching mtd1 to ubi0
UBI: attached by fastmap
UBI: fastmap pool size: 200
UBI: fastmap WL pool size: 100
UBI: attached mtd1 (name "mtd=3", size 510 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good PEBs: 4075, bad PEBs: 5, corrupted PEBs: 0
UBI: user volume: 4, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
UBI: available PEBs: 0, total reserved PEBs: 4075, PEBs reserved for bad PEB handling: 75
Colibri VFxx # ubi write ${loadaddr} m4firmware ${filesize}
size > volume size! Aborting!
Colibri VFxx #

Hw: Toradex Colibri VF61 V1.2A

link text

which bsp are you using?

@jaski.tx

Linux Image V2.6

What is create_m4firmware exaclty doing? This seems not a script provided by Toradex.

That log above is somewhat confusing. You load the UBI rootfs and then try to write it to the m4firmware partition, which naturally won’t fit…

In general, U-Boot does not like when UBI gets initialized to often. Try to initialize UBI only once (using ubi part ubi only once) and then go from there.

hi @stefan.tx

But “create_firmware” is there in the script provided by Toradex as mentioned in the website “FreeRTOS on the Cortex-M4 of a Colibri VF61 | Toradex Developer Center”.

With the first block you already took care of writing the firmware, no need to do the second block. There is a sentence in between: “Once the UBI volume is in place, a new firmware can be written by just using ubi write:” Hence those operations are ment when you want to update/rewrite the firmware.

hi @stefan.tx

Okay, Thankyou!! I think it starts working now.

you are welcome