Skip to contentSkip to conversation

Setting up environment variables under linux

U-Boot-Users Juergen Oberhofer 2 participants 2 messages Apr 24, 2004

lore
Share & tools
lore
#0 lore raw

Hi,
I mapped the environment 'partition' to /dev/mtd2. Using
cat /dev/mtd2, I am able to read all the environment variables. Now, I tried to use the fw_printenv tool to get a specific variable, but this led to a crc-error (Warning: Bad CRC, using default environment)

My mtd2 partition is on 0x8000 - 0xc000,
so I configured fw_env.h:
DEVICE1_OFFSET 0x0000
DEVICE1_ESIZE 0x4000
ENV1_SIZE 0x4000

Does anybody know where the problem could be?
Regards
Juergen

Signature · 2 lines
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgeb?hr: http://www.gmx.net/dsl
#1 lore raw
Quoted 8 lines · In message <[email protected]> you wrote:

I mapped the environment 'partition' to /dev/mtd2. Using
cat /dev/mtd2, I am able to read all the environment variables. Now, I tried to use the fw_printenv tool to get a specific variable, but this led to a crc-error (Warning: Bad CRC, using default environment)

My mtd2 partition is on 0x8000 - 0xc000,
so I configured fw_env.h:

What EXACTLY did you configure?

Did you keep the setting of HAVE_REDUND? And is does your system really use redundand flash sectors?

Did you keep the definition of CONFIG_FILE? and what does your config file contain?

Quoted 5 lines

DEVICE1_OFFSET 0x0000
DEVICE1_ESIZE 0x4000
ENV1_SIZE 0x4000

Does anybody know where the problem could be?

Misconfiguration. I think you left the "#define HAVE_REDUND" in the header file but use only a simple (non-redundand) flash sector; or you forgot to remove the CONFIG_FILE or to adapt your config file.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
No one may kill a man.  Not for any purpose.  It cannot be condoned.
	-- Kirk, "Spock's Brain", stardate 5431.6