[U-Boot] Setting uboot env vars from OS

Jason Cipriani jason.cipriani at gmail.com
Wed Apr 3 21:15:02 CEST 2013


I found fw_setenv / fw_printenv, however fw_setenv does not seem to work
properly on the Gumstix. I have about the same problem as this person:

http://lists.denx.de/pipermail/u-boot/2007-July/022640.html

Where fw_printenv works fine, but fw_setenv produces:

nand_write: Attempt to write not page aligned data

And corrupts the environment block.

I found this guy who did some research:

http://gumstix.8.n6.nabble.com/u-boot-fw-saveenv-doesn-t-work-td638302.html

And says he traced the problem down an unaligned write of the 2-byte CRC.
There is no easy fix posted there though, presuming that's the problem.

Any ideas?

Thanks,
Jason




On Wed, Apr 3, 2013 at 2:36 PM, Jason Cipriani <jason.cipriani at gmail.com>wrote:

> Hi all,
>
> I have about 50 Gumstix Overos, each running uboot and:
>
> root at overo:~# uname -a
> Linux overo 3.2.28-rt42+ #6 PREEMPT RT Fri Sep 21 12:23:39 EDT 2012 armv7l
> GNU/Linux
>
> I'm trying to automate installing our software on each one, but this
> includes setting and saving one uboot environment variable (which is stored
> on the Gumstix NAND):
>
>   # setenv dvimode="1024x768MC-24 at 60"
>   # saveenv
>
> Our current deployment process will be, for each of the 50 Gumstix:
>
>   1. Clone SD card from image, using a PC
>   2. Copy device-unique configuration files to SD image
>   3. SD card into Gumstix
>   4. Boot Gumstix, interrupt uboot
>   5. Set and save uboot environment variables
>
> Steps 1, 2, and 3 are automated in a script. I'd really like to get rid of
> steps 4 and 5, which currently are going to be a significant part of
> deployment time.
>
> My question is: Is there any way to set and save a uboot environment
> variable from the Linux OS? If so, what I would do is make a startup script
> that runs once which sets up uboot then reboots, and that way our
> deployment script can just copy it to the SD card and the first time we
> boot each Gumstix it will automatically configure the uboot environment.
>
> Thanks!
> Jason
>


More information about the U-Boot mailing list