[U-Boot] Setting Uboot environment variables from within Linux

Rossco
2014-07-31T14:05:18Z

Hi,

I have an issue when attempting to access my uboot variables from within my
linux distribution.

My set-up is as follows...

Cyclone V SoC with ARM Cortex A9 processor running 3.11 kernel (git revision
a946a64), uboot version 2013.01.01 - only modification being to configure
for QSPI boot and to add some extra environment variables.

I am running a QSPI boot configuration, my QSPI has three partitions...
1. Raw partition containing Pre-loader, device-tree and uboot
2. Kernel1 - containing initial kernel
3. Kernel2 - for future updated kernel

I have a NAND device offering UBI filesystem.

I created the fw_printenv and exported to my development board, created sym
link to create fw_setenv. Also copied across the fw_env.config which looks
like this (I have not modified this)...

# NOR example
# MTD device name Device offset Env. size Flash sector size
/dev/mtd1 0x0000 0x4000 0x4000
/dev/mtd2 0x0000 0x4000 0x4000

# MTD SPI-dataflash example
# MTD device name Device offset Env. size Flash sector size
#/dev/mtd5 0x4200 0x4200
#/dev/mtd6 0x4200 0x4200

# NAND example
#/dev/mtd0 0x4000 0x4000 0x20000

cat /proc/mtd look like...
dev: size erasesize name
mtd0: 40000000 00040000 "denali-nand"
mtd1: 00800000 00010000 "Flash 0 Raw Data"
mtd2: 01900000 00010000 "Kernel Partition 1"
mtd3: 01900000 00010000 "Kernel Partition 2"

When I attempt to run fw_printenv I get the following error message..
Warning: Bad CRC, using default environment

I'm assuming that my config file is wrong but I'm not sure how to change it.
Do I need to manually workout where the environment variables are being
stored? Should I have a separate environment variables image? If so how do I
get that image?

Any guidance greatly appreciated :-)

Thanks

Rossco

--
View this message in context: http://u-boot.10912.n7.nabble.com/Setting-Uboot-environment-variables-from-within-Linux-tp185482.html
Sent from the U-Boot mailing list archive at Nabble.com.