Hi all,
I am using Yocto to create images for a ConnectCard Jump Start reference board (ccardimx28js). An issue arises when I attempt to update a secondary rootfs partition within Linux from the primary partition using the update_flash tool. Both rootfs-es are in a UBIFS format.
BACKGROUND
The digi-embedded-yocto (dey) minimal, non-graphical build is a starting point for my images, which include some minor customizations to include additional python packages and an application-specific program baked into the firmware.
PRELIMINARIES
I have two identical UBIFS rootfs filesystems, 50MB in size. I can flash these via tftp from uboot using the Digi update feature. And can boot into either the primary or secondary Linux system and run my application as expected.
As part of a firmware update feature, a requirement exists to update the rootfs if and when a new application is available or an update to the filesystem is desired.
This update is to be invoked from the application running on Linux and will update the other (currently unmounted) rootfs. Coupled with some additional logic, this ping-pong mechanism will be used to ensure a robust system in the event that a firmware update fails due to bad image contents, some file transmittal corruption, power loss during update, etc.
THE ISSUE
The update procedure is demonstrably correct when doing the UBIFS rootfs updates from u-boot. This uses the Digi update command as referenced above.
The update fails during image prechecks when invoking the procedure within Linux. This uses the Linux tool update_flash. Specifically, the image validation prechecks complain that the image size is not a multiple of the physical erase block (PEB) size, 131072 bytes, viz.
root@ccardimx28js:/dev# update_flash dey-image-minimal-ccardimx28js-20151003000022.128.rootfs.ubifs 6
Partition 6 is NAND ()
Full Size: 51200 KiB
Good Size: 51200 KiB
Verifying File(s): dey-image-minimal-ccardimx28js-20151003000022.128.rootfs.ubifs
Updating:
dey-image-minimal-ccardimx28js-20151003000022.128.rootfs.ubifs (33480 KiB)
Flashing: FAILED! (ubiformat: error!: file “dey-image-minimal-ccardimx28js-20151003000022.128.rootfs.ubifs” (size 34283520 bytes) is not
multiple of eraseblock size (131072 bytes))
The error flagged by the prechecks seems legitimate, i.e. the UBIFS image size is not a multiple of the PEB. However, I do not see how to get the DEY yocto or the recipes used by it to generate a compatible sized image, nor do I understand how the update utility running from u-boot deals with this using the identical image.
Additionally, the parameters in the DEY configuration for the ccardimx28js seem to have correct sizes for the PEB and LEB. There is one other place in meta-fsl-arm that has MKUBIFS_NAND_ARGS that seem to be incompatible, but changing those had no effect on the built image size.
Thanks in advance for insight into the problem.