public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot]  Problems with fw_printenv
@ 2010-03-03 10:25 Ronald Kortekaas
  2010-03-03 20:21 ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Ronald Kortekaas @ 2010-03-03 10:25 UTC (permalink / raw)
  To: u-boot

The problem was the definition of CONFIG_ENV_ADDR_REDUND after undefining this it works.

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [U-Boot] Problems with fw_printenv
@ 2010-03-03  9:14 Ronald Kortekaas
  0 siblings, 0 replies; 7+ messages in thread
From: Ronald Kortekaas @ 2010-03-03  9:14 UTC (permalink / raw)
  To: u-boot

I have some problems with the fw_printenv tool. I use the following versions of u-boot, kernel and compiler:


-       u-boot-2009.11.1

-       linux-2.6.22

-       gcc-3.4.3-glibc-2.3.2 arm-linux-

The problem is that the fw_printenv complains about: "Warning: Bad CRC, using default environment".

My U-boot configuration for the environment is:

#define PHYS_FLASH_1                                   0xc0000000
#define CONFIG_ENV_IS_IN_FLASH
#define CONFIG_ENV_OFFSET                      (0x40000)
#define CONFIG_ENV_SECT_SIZE                 0x20000                 /* Env sector Size */
#define CONFIG_ENV_SIZE                             CONFIG_ENV_SECT_SIZE

#define MTDIDS_DEFAULT                              "nor0=physmap-flash.0"
#define MTDPARTS_DEFAULT        "mtdparts=physmap-flash.0:256k(uboot)ro,128k(ubootenv),4096k(kernel)"

Mtd in u-boot prints:

device nor0 <physmap-flash.0>, # parts = 3
 #: name                size            offset          mask_flags
 0: uboot               0x00040000      0x00000000      1
 1: ubootenv            0x00020000      0x00040000      0
 2: kernel              0x00400000      0x00060000      0

active partition: nor0,0 - (uboot) 0x00040000 @ 0x00000000

defaults:
mtdids  : nor0=physmap-flash.0
mtdparts: mtdparts=physmap-flash.0:256k(uboot)ro,128k(ubootenv),4096k(kernel)

So my environment is located at 0xc0040000. My /proc/mtd is:

dev:    size   erasesize  name
mtd0: 00800000 00020000 "NOR flash on Clever"
mtd1: 00040000 00020000 "uboot"
mtd2: 00020000 00020000 "ubootenv"
mtd3: 00400000 00020000 "Kernel"

My fw_env.config is:

/dev/mtd2               0x0000          0x20000         0x20000

When I copy the /dev/mtd2 to a file I see the environment variables from U-Boot. This starts with "G?wbootdelay=5"
When I do a fw_setenv bootdelay 4, it says "Warning: Bad CRC, using default environment". But if I use then fw_printenv everything is fine.
If I copy the contents of /dev/mtd2 to a file is starts with: "?       U(bootcmd=bootp". So I can write the environment from linux but not read it from u-boot.

If I restarts my board U-boot compains about a bad CRC (this is the expected result). So I looks like the offsets are wrong because my kernel image get damaged after saving the environment from linux.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-03-04  8:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-03 10:25 [U-Boot] Problems with fw_printenv Ronald Kortekaas
2010-03-03 20:21 ` Wolfgang Denk
2010-03-04  6:14   ` Ronald Kortekaas
2010-03-04  8:55     ` Wolfgang Denk
2010-03-04  7:26   ` Ronald Kortekaas
2010-03-04  8:57     ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2010-03-03  9:14 Ronald Kortekaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox