public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] fw_printenv (uboot2011.12) 'Warning: Bad CRC, using default environment'
Date: Wed, 31 Jul 2013 18:51:17 +0200	[thread overview]
Message-ID: <51F94085.1050802@googlemail.com> (raw)
In-Reply-To: <BLU178-W870845D31BD2C09AFD65A84570@phx.gbl>

Dear Andy Neubi,

On 31.07.13 15:26, Andy Neubi wrote:
> hi,
> i'm using the uboot-tools (fw_printenv) to readout the env-settings of my beagleboard-XM uboot. unfortunately i always getthe 'Warning: Bad CRC, using default environment' msg

please configure your MUA to wrap at about 78 chars

> [root at buildroot ~]# cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00080000 00020000 "X-Loader"
> mtd1: 001e0000 00020000 "U-Boot"
> mtd2: 00020000 00020000 "U-Boot Env"
> mtd3: 00800000 00020000 "Kernel"
> mtd4: 00800000 00020000 "Kernel Backup Partition"
> mtd5: 0ed80000 00020000 "File System"
> 

Next seems to be /etc/fw_env.config

> # MTD device name       Device offset   Env. size       Flash sector size
> /dev/mtd2              0x0000          0x20000          0x20000

Do you really know the env size is the same as the sector size?
Sometimes one define a smaller space for faster reading.
Have you tried to dd the mtd2 into an file and investigate it (the env
structure is quite simple and should easily be understood when reading
the code).

> [root at buildroot ~]# fw_printenv
> Warning: Bad CRC, using default environment
> bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
> bootdelay=5
> baudrate=115200

(re-formatted for better readability)

That's the 'default env' defined in fw_env.h, not the default env of
your board!

> - uboot-version of my beagleboard is 2013.04- uboot-tools-version under buildroot is 2011.12- ubuntu 13.04
> 
> Q: what i'm doing wrong?
> 
> -> IMHO so in most cases 2 different uboot versions are not good, so i tried to build the uboot-tools-2013.04 ... unfortunately i always get

That's not true! You can use an older fw_printenv tool to read the
environment of a newer u-boot. The environment format is fix since ages
and will not change cause we want to read an older environment with an
newer u-boot .. so that's obvious.

> uboot-tools-2013.04/lib/crc32.c:14:20: fatal error: common.h: No such file or directory

This means your u-boot is not configured. Somewhere in 2012 a commit
stopped building env target for unconfigured u-boot. There where a lot
of discussion around, unfortunately no solution was found. Maybe your
complaint gives some new input to that.
So a 'make <your board name>_config' before 'make
HOSTCC=${CROSS_COMPILE}gcc env' should solve your issue.

Best regards

Andreas Bie?mann

  reply	other threads:[~2013-07-31 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 13:26 [U-Boot] fw_printenv (uboot2011.12) 'Warning: Bad CRC, using default environment' Andy Neubi
2013-07-31 16:51 ` Andreas Bießmann [this message]
2013-08-01 15:15   ` Andreas Neubacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51F94085.1050802@googlemail.com \
    --to=andreas.devel@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox