* [U-Boot] environment variables crc
@ 2009-04-20 15:46 Gerrit Van Damme
2009-04-20 18:25 ` Mike Frysinger
0 siblings, 1 reply; 5+ messages in thread
From: Gerrit Van Damme @ 2009-04-20 15:46 UTC (permalink / raw)
To: u-boot
Hello all,
I've copied a flash image of one board to another one and changed the
ethaddr (environment variable)
of course when I start Uboot now the system says: CRC bad, using default
environment variables.
Now what I would like to do is recalculate that CRC, change it in the
image and then copy it to the second board.
Can anyone tell me how I can calculate the CRC and where it is located.
I already understood that it's a CRC32.
Any other ideas are also welcome...
Maybe It's even possible with the crc32 command of Uboot but then again
I would need the location of the CRC and which data is used to calculate it.
Thanks a lot
Regards,
Gerrit
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] environment variables crc
2009-04-20 15:46 [U-Boot] environment variables crc Gerrit Van Damme
@ 2009-04-20 18:25 ` Mike Frysinger
2009-04-21 8:15 ` Gerrit Van Damme
0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2009-04-20 18:25 UTC (permalink / raw)
To: u-boot
On Monday 20 April 2009 11:46:22 Gerrit Van Damme wrote:
> I've copied a flash image of one board to another one and changed the
> ethaddr (environment variable)
> of course when I start Uboot now the system says: CRC bad, using default
> environment variables.
> Now what I would like to do is recalculate that CRC, change it in the
> image and then copy it to the second board.
> Can anyone tell me how I can calculate the CRC and where it is located.
> I already understood that it's a CRC32.
"saveenv". the CRC is the first 4 bytes of the environment and is calculated
using the environment.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090420/0b61f078/attachment.pgp
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] environment variables crc
2009-04-20 18:25 ` Mike Frysinger
@ 2009-04-21 8:15 ` Gerrit Van Damme
2009-04-21 14:43 ` Wolfgang Denk
0 siblings, 1 reply; 5+ messages in thread
From: Gerrit Van Damme @ 2009-04-21 8:15 UTC (permalink / raw)
To: u-boot
Mike Frysinger wrote:
> On Monday 20 April 2009 11:46:22 Gerrit Van Damme wrote:
>
>> I've copied a flash image of one board to another one and changed the
>> ethaddr (environment variable)
>> of course when I start Uboot now the system says: CRC bad, using default
>> environment variables.
>> Now what I would like to do is recalculate that CRC, change it in the
>> image and then copy it to the second board.
>> Can anyone tell me how I can calculate the CRC and where it is located.
>> I already understood that it's a CRC32.
>>
>
> "saveenv". the CRC is the first 4 bytes of the environment and is calculated
> using the environment.
> -mike
>
Hey Mike,
Thanks for your answer.
The saveenv command doesn't work for me because then the default env
variables are stored and this is what I want to avoid.
It's already a good thing that I can see that the first 4 bytes really
look like the CRC of the environment. So this was really helpfull info.
Now you tell me it's calculated using the environment. In the source
code I found the env variables crc calculated for a size of ENV_SIZE, but
I was unable to see how it was defined. Do you have more info on this?
Is the environment data (for crc calculation) terminated by a certain
char (or sequence of chars) ?
Thanks and regards,
Gerrit
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] environment variables crc
2009-04-21 8:15 ` Gerrit Van Damme
@ 2009-04-21 14:43 ` Wolfgang Denk
2009-04-21 15:11 ` Gerrit Van Damme
0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2009-04-21 14:43 UTC (permalink / raw)
To: u-boot
Dear Gerrit Van Damme,
In message <49ED809D.5030702@mgb-tech.com> you wrote:
>
> The saveenv command doesn't work for me because then the default env
> variables are stored and this is what I want to avoid.
Then change the environment before running saveenv? Or even better -
adjust the default environment so it matches your needs. What's the
problem?
> It's already a good thing that I can see that the first 4 bytes really
> look like the CRC of the environment. So this was really helpfull info.
> Now you tell me it's calculated using the environment. In the source
> code I found the env variables crc calculated for a size of ENV_SIZE, but
> I was unable to see how it was defined. Do you have more info on this?
Hmmm... "grep" is your friend.
> Is the environment data (for crc calculation) terminated by a certain
> char (or sequence of chars) ?
No. Not for CRC calculation.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If you want to eat hippopatomus, you've got to pay the freight." -
attributed to an IBM guy, about why IBM software uses so much memory
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] environment variables crc
2009-04-21 14:43 ` Wolfgang Denk
@ 2009-04-21 15:11 ` Gerrit Van Damme
0 siblings, 0 replies; 5+ messages in thread
From: Gerrit Van Damme @ 2009-04-21 15:11 UTC (permalink / raw)
To: u-boot
Dear Wolgang Denk,
Wolfgang Denk wrote:
> Dear Gerrit Van Damme,
>
> In message <49ED809D.5030702@mgb-tech.com> you wrote:
>
>> The saveenv command doesn't work for me because then the default env
>> variables are stored and this is what I want to avoid.
>>
>
> Then change the environment before running saveenv? Or even better -
> adjust the default environment so it matches your needs. What's the
> problem?
>
Thing is I would like to bypass the Uboot commands.
Maybe I'll explain my problem a little more detailed.
We're using a taskit panelcard based on the Atmel at91sam9261. Atmel
provides some boot assistant software (SAM-BA) which allows you to
create images and clone them.
Now we set up a complete system on the taskit and now we want to start
cloning. We were succesfull on this part the only thing is the MAC
address sits also in this flash image.
We created a script which gets the original MAC address from the board.
Inserts it in the flash image file and then writes it to the board.
And then we got the CRC error because we didn't recalculate the CRC. We
want to include the CRC calculation in our SAM-BA script so that
everything is already set and we can skip the
Uboot part. This is why I needed some specific info on the CRC calculation.
But if I'm unable to calculate the CRC I'll have to go for a second
(Uboot) script to set up the environment. But it wont be highly
appreciated by our production team :-)
>
>> It's already a good thing that I can see that the first 4 bytes really
>> look like the CRC of the environment. So this was really helpfull info.
>> Now you tell me it's calculated using the environment. In the source
>> code I found the env variables crc calculated for a size of ENV_SIZE, but
>> I was unable to see how it was defined. Do you have more info on this?
>>
>
> Hmmm... "grep" is your friend.
>
Indeed that's true... but only if you're already friends with "Linux"
>
>> Is the environment data (for crc calculation) terminated by a certain
>> char (or sequence of chars) ?
>>
>
> No. Not for CRC calculation.
>
> Best regards,
>
> Wolfgang Denk
>
>
Thanks for your answer Wolfgang
Regards,
Gerrit
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-04-21 15:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 15:46 [U-Boot] environment variables crc Gerrit Van Damme
2009-04-20 18:25 ` Mike Frysinger
2009-04-21 8:15 ` Gerrit Van Damme
2009-04-21 14:43 ` Wolfgang Denk
2009-04-21 15:11 ` Gerrit Van Damme
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox