* [U-Boot] Creating U-Boot env image
@ 2013-12-09 14:34 Alexey Smishlayev
2013-12-09 20:12 ` Wolfgang Denk
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Alexey Smishlayev @ 2013-12-09 14:34 UTC (permalink / raw)
To: u-boot
Hello!
I would like to flash the environment variable values to my board,
rather than setting them at the prompt. I've founa a tool mkenvimage is
made specially for that. I used it to create a binary image of the
U-Boot environment. However, when I flash it to my board, I get the message
*** Warning - bad CRC, using default environment
I thought it is due to that redundant memory wasn't written aswell, so I
commented out #define CONFIG_ENV_REDUND_OFFSET in the
include/configs/at91sam9g20ek.h, and tried once again, but I'm still
getting this error.
What should I do to flash environment values directly to the board's NAND?
Best regards,
Alexey Smishlayev
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot] Creating U-Boot env image
2013-12-09 14:34 [U-Boot] Creating U-Boot env image Alexey Smishlayev
@ 2013-12-09 20:12 ` Wolfgang Denk
2013-12-09 21:39 ` Alexey Smishlayev
2013-12-10 11:39 ` Mats Kärrman
2013-12-11 9:59 ` Bo Shen
2 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2013-12-09 20:12 UTC (permalink / raw)
To: u-boot
Dear Alexey Smishlayev,
In message <52A5D4F1.7020101@xtech2.lv> you wrote:
>
> I would like to flash the environment variable values to my board,
> rather than setting them at the prompt. I've founa a tool mkenvimage is
> made specially for that. I used it to create a binary image of the
> U-Boot environment. However, when I flash it to my board, I get the message
> *** Warning - bad CRC, using default environment
>
> I thought it is due to that redundant memory wasn't written aswell, so I
> commented out #define CONFIG_ENV_REDUND_OFFSET in the
> include/configs/at91sam9g20ek.h, and tried once again, but I'm still
> getting this error.
>
> What should I do to flash environment values directly to the board's NAND?
Why don't you just use "env import"?
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
Living on Earth may be expensive, but it includes an annual free trip
around the Sun.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] Creating U-Boot env image
2013-12-09 20:12 ` Wolfgang Denk
@ 2013-12-09 21:39 ` Alexey Smishlayev
2013-12-09 21:56 ` Stephen Warren
0 siblings, 1 reply; 9+ messages in thread
From: Alexey Smishlayev @ 2013-12-09 21:39 UTC (permalink / raw)
To: u-boot
Dear Wolfgang Denk,
On 2013.12.09. 22:12, Wolfgang Denk wrote:
> Dear Alexey Smishlayev,
>
> In message <52A5D4F1.7020101@xtech2.lv> you wrote:
>> What should I do to flash environment values directly to the board's NAND?
> Why don't you just use "env import"?
>
I didn't have any information about that. Also, I would like to get done
without entering the U-Boot prompt. I am flashing my board using the
J-TAG - USB cable, and it will be much more simple and convenient if I'd
be able to just write the binary images on the NAND flash.
So, there is no way to do something like that straight away?
Best regards,
Alexey Smishlayev
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] Creating U-Boot env image
2013-12-09 21:39 ` Alexey Smishlayev
@ 2013-12-09 21:56 ` Stephen Warren
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Warren @ 2013-12-09 21:56 UTC (permalink / raw)
To: u-boot
On 12/09/2013 02:39 PM, Alexey Smishlayev wrote:
> Dear Wolfgang Denk,
>
> On 2013.12.09. 22:12, Wolfgang Denk wrote:
>> Dear Alexey Smishlayev,
>>
>> In message <52A5D4F1.7020101@xtech2.lv> you wrote:
>>> What should I do to flash environment values directly to the board's
>>> NAND?
>> Why don't you just use "env import"?
>>
>
> I didn't have any information about that. Also, I would like to get done
> without entering the U-Boot prompt. I am flashing my board using the
> J-TAG - USB cable, and it will be much more simple and convenient if I'd
> be able to just write the binary images on the NAND flash.
>
> So, there is no way to do something like that straight away?
I have no idea if something similar would work on your SoC, but I flash
my Tegra devices as follows:
* Download a copy of U-Boot into RAM and execute it.
I use "tegrarcm" to download it (a method of talking to Tegra's boot
ROM), but I imagine you could download using JTAG too.
* This U-Boot's bootcmd (specified in the attached device tree in my
case) writes the desired binary to boot flash; I flash from the device
itself rather than using JTAG/... for the actual flash writes.
* After flashing the U-Boot binary, the same U-Boot does "env default -f
-a; saveenv" and hence re-initializes the environment in flash. You can
easily "setenv foo bar" between those two commands for any custom
overrides. You could even push a file into some known RAM location and
run "env import" on it too...
* Reboot into the newly-flashed U-Boot.
The code is at:
https://github.com/NVIDIA/tegra-uboot-flasher-scripts
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] Creating U-Boot env image
2013-12-09 14:34 [U-Boot] Creating U-Boot env image Alexey Smishlayev
2013-12-09 20:12 ` Wolfgang Denk
@ 2013-12-10 11:39 ` Mats Kärrman
2013-12-10 12:32 ` Alexey Smishlayev
2013-12-11 9:59 ` Bo Shen
2 siblings, 1 reply; 9+ messages in thread
From: Mats Kärrman @ 2013-12-10 11:39 UTC (permalink / raw)
To: u-boot
Hi Alexey,
on: Monday, December 09, 2013 3:34 PM, Alexey Smishlayev wrote:
> I would like to flash the environment variable values to my board,
> rather than setting them at the prompt. I've founa a tool mkenvimage is
> made specially for that. I used it to create a binary image of the
> U-Boot environment. However, when I flash it to my board, I get the message
> *** Warning - bad CRC, using default environment
>
> I thought it is due to that redundant memory wasn't written aswell, so I
> commented out #define CONFIG_ENV_REDUND_OFFSET in the
> include/configs/at91sam9g20ek.h, and tried once again, but I'm still
> getting this error.
I can definitely see the use case in producing a complete flash image, e.g. for
production use and maybe be able to select the env image from one of many
depending on some factor.
What you describe should definitely be possible. Are you sure that it's not
something simple like a missmatch in env size?
You could use U-Boots Linux fw_printenv tools and/or dd to read the flashed env
image and perhaps compare it to an image saved by U-Boot to figure out what is
going wrong.
BR // Mats
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] Creating U-Boot env image
2013-12-10 11:39 ` Mats Kärrman
@ 2013-12-10 12:32 ` Alexey Smishlayev
2013-12-10 13:33 ` Mats Kärrman
0 siblings, 1 reply; 9+ messages in thread
From: Alexey Smishlayev @ 2013-12-10 12:32 UTC (permalink / raw)
To: u-boot
Hello, Mats,
On 2013.12.10. 13:39, Mats K?rrman wrote:
> Hi Alexey,
>
> I can definitely see the use case in producing a complete flash image, e.g. for
> production use and maybe be able to select the env image from one of many
> depending on some factor.
Yes, the use case is exactly as you described.
> What you describe should definitely be possible. Are you sure that it's not
> something simple like a missmatch in env size?
I'm not sure, if that's not something simple, that's why I wrote to this
list. I just don't know every little detail about using U-Boot.
> You could use U-Boots Linux fw_printenv tools and/or dd to read the flashed env
> image and perhaps compare it to an image saved by U-Boot to figure out what is
> going wrong.
That's what I've thought also - if I just dd the environment contents to
a file, can I then use it as a valid image for production? That could be
the most simple way to achieve what I want.
Best regards,
Alexey Smishlayev
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] Creating U-Boot env image
2013-12-10 12:32 ` Alexey Smishlayev
@ 2013-12-10 13:33 ` Mats Kärrman
2013-12-10 13:36 ` Alexey Smishlayev
0 siblings, 1 reply; 9+ messages in thread
From: Mats Kärrman @ 2013-12-10 13:33 UTC (permalink / raw)
To: u-boot
On: Tuesday, December 10, 2013 1:32 PM, Alexey Smishlayev wrote:
> I'm not sure, if that's not something simple, that's why I wrote to this
> list. I just don't know every little detail about using U-Boot.
I was thinking something like: [flash-sector-size] <= [U-Boot-configured-env-size]
and you must give the right number to the env image generation program.
> That's what I've thought also - if I just dd the environment contents to
> a file, can I then use it as a valid image for production? That could be
> the most simple way to achieve what I want.
Yes, should be possible. If you're using redundant environments, you
probably want to use the env copy that has "0x01" in the 5:th byte.
See common/env_flash.c and include/environment.h.
// Mats
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] Creating U-Boot env image
2013-12-10 13:33 ` Mats Kärrman
@ 2013-12-10 13:36 ` Alexey Smishlayev
0 siblings, 0 replies; 9+ messages in thread
From: Alexey Smishlayev @ 2013-12-10 13:36 UTC (permalink / raw)
To: u-boot
Hello Mats,
On 2013.12.10. 15:33, Mats K?rrman wrote:
> On: Tuesday, December 10, 2013 1:32 PM, Alexey Smishlayev wrote:
>> I'm not sure, if that's not something simple, that's why I wrote to this
>> list. I just don't know every little detail about using U-Boot.
> I was thinking something like: [flash-sector-size] <= [U-Boot-configured-env-size]
> and you must give the right number to the env image generation program.
>
>> That's what I've thought also - if I just dd the environment contents to
>> a file, can I then use it as a valid image for production? That could be
>> the most simple way to achieve what I want.
> Yes, should be possible. If you're using redundant environments, you
> probably want to use the env copy that has "0x01" in the 5:th byte.
> See common/env_flash.c and include/environment.h.
Thank you, I will check that. How can I see if I'm compiling U-Boot with
redundant environment, or not?
Best regards,
Alexey
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] Creating U-Boot env image
2013-12-09 14:34 [U-Boot] Creating U-Boot env image Alexey Smishlayev
2013-12-09 20:12 ` Wolfgang Denk
2013-12-10 11:39 ` Mats Kärrman
@ 2013-12-11 9:59 ` Bo Shen
2 siblings, 0 replies; 9+ messages in thread
From: Bo Shen @ 2013-12-11 9:59 UTC (permalink / raw)
To: u-boot
Hi Alexey Smishlayev,
On 12/09/2013 10:34 PM, Alexey Smishlayev wrote:
> Hello!
>
> I would like to flash the environment variable values to my board,
> rather than setting them at the prompt. I've founa a tool mkenvimage is
> made specially for that. I used it to create a binary image of the
> U-Boot environment. However, when I flash it to my board, I get the message
> *** Warning - bad CRC, using default environment
Can you try the sam-ba tool provide by Atmel to generate this kind of
image? Run the bat file in demo package [1]. It will generate the image
automatically.
More information, please reference the demo package [1].
[1]
ftp://ftp.linux4sam.org/pub/demo/linux4sam_2.0/linux4sam-angstrom-at91sam9g20ek.zip
> I thought it is due to that redundant memory wasn't written aswell, so I
> commented out #define CONFIG_ENV_REDUND_OFFSET in the
> include/configs/at91sam9g20ek.h, and tried once again, but I'm still
> getting this error.
>
> What should I do to flash environment values directly to the board's NAND?
>
> Best regards,
> Alexey Smishlayev
Best Regards,
Bo Shen
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-12-11 9:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09 14:34 [U-Boot] Creating U-Boot env image Alexey Smishlayev
2013-12-09 20:12 ` Wolfgang Denk
2013-12-09 21:39 ` Alexey Smishlayev
2013-12-09 21:56 ` Stephen Warren
2013-12-10 11:39 ` Mats Kärrman
2013-12-10 12:32 ` Alexey Smishlayev
2013-12-10 13:33 ` Mats Kärrman
2013-12-10 13:36 ` Alexey Smishlayev
2013-12-11 9:59 ` Bo Shen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox