* [U-Boot] u-boot on raspberry pi with fw_printenv/fw_setenv
@ 2015-01-06 12:08 Waldemar Brodkorb
2015-01-06 17:01 ` B.R. Oake
[not found] ` <54AC14A6.2090102@openmailbox.org>
0 siblings, 2 replies; 5+ messages in thread
From: Waldemar Brodkorb @ 2015-01-06 12:08 UTC (permalink / raw)
To: u-boot
Hi Developers,
I am looking for a way to change u-boot environment from Linux
on a Raspberry PI. I have fw_printenv/fw_setenv, but I have no clue
how the config file looks like, when using uboot.env as a file on
the first vfat partition. I am not sure, but it looks like there
is no code to use fw_printenv/fw_setenv with files.
rpi.h from git sets:
#define CONFIG_ENV_SIZE SZ_16K
#define CONFIG_ENV_IS_IN_FAT
#define FAT_ENV_INTERFACE "mmc"
#define FAT_ENV_DEVICE_AND_PART "0:1"
#define FAT_ENV_FILE "uboot.env"
This works fine when I use savenv inside of u-boot shell.
What do I miss?
best regards
Waldemar
^ permalink raw reply [flat|nested] 5+ messages in thread* [U-Boot] u-boot on raspberry pi with fw_printenv/fw_setenv
2015-01-06 12:08 [U-Boot] u-boot on raspberry pi with fw_printenv/fw_setenv Waldemar Brodkorb
@ 2015-01-06 17:01 ` B.R. Oake
2015-01-07 17:12 ` B.R. Oake
[not found] ` <54AC14A6.2090102@openmailbox.org>
1 sibling, 1 reply; 5+ messages in thread
From: B.R. Oake @ 2015-01-06 17:01 UTC (permalink / raw)
To: u-boot
On 06/01/15 12:08, Waldemar Brodkorb wrote:
> I am looking for a way to change u-boot environment from Linux
> on a Raspberry PI. I have fw_printenv/fw_setenv, but I have no clue
> how the config file looks like, when using uboot.env as a file on
> the first vfat partition. I am not sure, but it looks like there
> is no code to use fw_printenv/fw_setenv with files.
Hi Waldemar,
fw_printenv and fw_setenv can act on an ordinary file instead of a
device if you want; their config file is normally /etc/fw_env.config .
So for example, first you could create an empty 16K file uboot.env:
dd if=/dev/zero of=uboot.env bs=1K count=16
then you could configure fw_printenv and fw_setenv to act upon that
file by putting the following line in /etc/fw_env.config:
uboot.env 0x0000 0x4000 0x4000
I hope that helps,
B.R.
^ permalink raw reply [flat|nested] 5+ messages in thread* [U-Boot] u-boot on raspberry pi with fw_printenv/fw_setenv
2015-01-06 17:01 ` B.R. Oake
@ 2015-01-07 17:12 ` B.R. Oake
0 siblings, 0 replies; 5+ messages in thread
From: B.R. Oake @ 2015-01-07 17:12 UTC (permalink / raw)
To: u-boot
On 06/01/15 17:01, B.R. Oake wrote:
> [...]
> then you could configure fw_printenv and fw_setenv to act upon that
> file by putting the following line in /etc/fw_env.config:
>
> uboot.env 0x0000 0x4000 0x4000
P.S. I realise now that the third column, 'Flash sector size', is
actually unnecessary in the case of the regular file, so it should
be omitted. Only the offset (zero) and the environment size are
needed.
Cheers,
B.R.
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <54AC14A6.2090102@openmailbox.org>]
* [U-Boot] u-boot on raspberry pi with fw_printenv/fw_setenv
[not found] ` <54AC14A6.2090102@openmailbox.org>
@ 2015-01-07 12:17 ` Waldemar Brodkorb
2015-01-07 16:52 ` B.R. Oake
0 siblings, 1 reply; 5+ messages in thread
From: Waldemar Brodkorb @ 2015-01-07 12:17 UTC (permalink / raw)
To: u-boot
Hi,
B.R. Oake wrote,
> On 06/01/15 12:08, Waldemar Brodkorb wrote:
> > I am looking for a way to change u-boot environment from Linux
> > on a Raspberry PI. I have fw_printenv/fw_setenv, but I have no clue
> > how the config file looks like, when using uboot.env as a file on
> > the first vfat partition. I am not sure, but it looks like there
> > is no code to use fw_printenv/fw_setenv with files.
>
> Hi Waldemar,
>
> fw_printenv and fw_setenv can act on an ordinary file instead of a
> device if you want; their config file is normally /etc/fw_env.config .
> So for example, first you could create an empty 16K file uboot.env:
>
> dd if=/dev/zero of=uboot.env bs=1K count=16
>
> then you could configure fw_printenv and fw_setenv to act upon that
> file by putting the following line in /etc/fw_env.config:
>
> uboot.env 0x0000 0x4000 0x4000
>
> I hope that helps,
Thanks a lot! This helps. Maybe an additional example in
fw_env.config would avoid another question about this in the future
;)
BTW: I needed a small path to let fw_printenv compiled:
---
u-boot-d8bec60c1b0de7770f9b56ad092ab9be801d99af.orig/tools/env/fw_env.h
2015-01-06 09:00:23.000000000 +0100
+++
u-boot-d8bec60c1b0de7770f9b56ad092ab9be801d99af/tools/env/fw_env.h
2015-01-07 13:13:44.399072426 +0100
@@ -14,6 +14,8 @@
#include <config.h>
#endif
+#include <generated/autoconf.h>
+
/*
* To build the utility with the static configuration
* comment out the next line.
Otherwise compile breaks:
HOSTCC tools/env/fw_env.o
In file included from tools/env/fw_env.c:117:0:
include/env_default.h:110:11: error: expected '}' before
'CONFIG_SYS_ARCH'
"arch=" CONFIG_SYS_ARCH "\0"
^
make[4]: *** [tools/env/fw_env.o] Error 1
best regards
Waldemar
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-01-07 17:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-06 12:08 [U-Boot] u-boot on raspberry pi with fw_printenv/fw_setenv Waldemar Brodkorb
2015-01-06 17:01 ` B.R. Oake
2015-01-07 17:12 ` B.R. Oake
[not found] ` <54AC14A6.2090102@openmailbox.org>
2015-01-07 12:17 ` Waldemar Brodkorb
2015-01-07 16:52 ` B.R. Oake
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox