[U-Boot] Uboot-Environment at bad block

Arno Steffen arno.steffen at googlemail.com
Mon Jun 20 08:42:21 CEST 2011


In one of my devices, uboot-environment is located at a bad block.
"save
Saving Environment to NAND...
Erasing Nand...
Skipping bad block at  0x000c0000

Writing to Nand... FAILED!"

In my memory mapping I have already reseverd 2blocks.
How can I setup uboot in a way, that it will look at c0000 or (in case
of bad block) at the next block e0000?

In my configs file I found somewhat like:
#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
#define SMNAND_ENV_OFFSET		0xC0000 /* environment starts here */
#define CONFIG_SYS_ENV_SECT_SIZE	boot_flash_sec

in mem.c of my processor I found:
	f_sec = (128 << 10);	/* 128 KiB */
	/* env setup */
	boot_flash_base = base;
	boot_flash_off = f_off;
	boot_flash_sec = f_sec;

uboot is based on 2010.03 release.

Maybe someone can give me an advice?
Thanks
- Arno

PS:
Move the base address of environment is not an option, as in next
device the bad block might be on exact this location.
Environment itself is just 2kB, but a block is 128k.  Can I decrease
the environment to that size and still use access from linux (via
fw_printenv)?


More information about the U-Boot mailing list