[U-Boot] fw_readenv not working with uboot.env stored on FAT partition BAD CRC

Christian Erhardt christian.erhardt at mojo2k.de
Mon Dec 29 13:43:40 CET 2014


Hello,

i'm using a Raspberry Pi with u-boot. I'm building a stock RPI Kernel 
3.12.y with buildroot. The u-boot version is 2015.01-rc3.

U-Boot is working fine and when i call saveenv a file uboot.env is 
written to the first FAT Partition on the SD Card. But when i try to 
access the boot params with fw_readenv, i always get the BAD CRC error. 
I tried every possible configuration in fw_env.config, but it will not work.

if first tried the obvious configuration

/dev/mmcblk0p1    0x0000    0x4000

does not work, then i tried to calculate the offset from /dev/mmcblk0:

/dev/mmcblk0p1    0x100000    0x4000

0x100000 because startsecotor is 2048 * 512 byte = 1048576 = 0x100000 in hex

It will not work. I'm a little confused if this configuration makes 
sense at all, i thought, with the rpi config, fw_readenv will look for 
the file uboot.env in the given partition?

My partion layout is as follows

243 heads, 62 sectors/track, 1022 cylinders, total 15407104 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xee294a37

    Device Boot      Start         End      Blocks   Id  System
/dev/sdf1   *        2048      104447       51200    e  W95 FAT16 (LBA)
/dev/sdf2          104448      411647      153600   83  Linux
/dev/sdf3          411648      718847      153600   83  Linux
/dev/sdf4          718848    15407103     7344128   83  Linux


Regards

Christian Erhardt


More information about the U-Boot mailing list