New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatwrite doesn't work for the SD card generated by YOCTO #1

Closed
robertferanec opened this Issue Mar 11, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@robertferanec
Copy link

robertferanec commented Mar 11, 2016

Issue: fatwrite

When I try to run 'fatwrite' on the SD card generated by YOCTO, this is what I get:

writing zImage
Error: Invalid FAT entry: 0x00000fff
error: overflow occurs
Error: writing contents

When I run 'fatinfo', it looks like the uBoot think, that it is FAT12. It looks like due a very small partition size, uBoot gets confused. I guess, it can be connected with the message which I get when I try to format the partition in Linux:

WARNING: Not enough clusters for .... (FAT32/16)

Work around

Insert the SD card into a Linux machine and format it. Use following command:

sudo mkfs.vfat -F16 -s 2 /dev/sdb1

Then, you can copy there zImage and dtb file. You can do so directly under your Linux host machine, or simply go to uBoot and run following commands (you need to have zImage and dtb file saved in /tftp/imx6 directory of your host Linux machine):

run update_kernel
run update_fdt

trini added a commit to trini/u-boot that referenced this issue Dec 27, 2016

fat: fatwrite: fix the command for FAT12
The u-boot command fatwrite empties FAT clusters from the beginning
till the end of the file.
Specifically for FAT12 it fails to detect the end of the file and goes
beyond the file bounds thus corrupting the file system.

Additionally, FAT entry chaining-up into a file is not implemented
for FAT12.

The users normally workaround this by re-formatting the partition as
FAT16/FAT32, like here:
FEDEVEL/openrex-uboot-v2015.10#1

The patch fixes the bounds of a file and FAT12 entries chaining into
a file, including EOF markup.

Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>

trini added a commit to trini/u-boot that referenced this issue Dec 27, 2016

fat: fatwrite: fix the command for FAT12
The u-boot command fatwrite empties FAT clusters from the beginning
till the end of the file.
Specifically for FAT12 it fails to detect the end of the file and goes
beyond the file bounds thus corrupting the file system.

Additionally, FAT entry chaining-up into a file is not implemented
for FAT12.

The users normally workaround this by re-formatting the partition as
FAT16/FAT32, like here:
FEDEVEL/openrex-uboot-v2015.10#1

The patch fixes the bounds of a file and FAT12 entries chaining into
a file, including EOF markup.

Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment