getting uboot env variables in linux

Discussion about U-Boot and the kernel.

getting uboot env variables in linux

Postby shobin » Thu Feb 27, 2014 5:27 am

Hi,
I have to get environment variables in linux from uboot. For that i did make cross compile on env tools in my uboot(uboot-toradex).after this i executed the fw_printenv in my linux it is giving like following,

sh-4.2# fw_printenv
Too few good blocks within range

and my fw_env.config file is,

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

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

# NAND example
#/dev/mtd0 0x4000 0x4000 0x20000 2
/dev/mtd5 0x0000 0x200000 0x40000 2


and in linux,

sh-4.2# cat /proc/mtd
dev: size erasesize name
mtd0: 1e7c0000 00040000 "USR"
mtd1: 00300000 00040000 "BCT"
mtd2: 00040000 00040000 "PT"
mtd3: 00200000 00040000 "EBT"
mtd4: 00040000 00040000 "BMP"
mtd5: 00200000 00040000 "ENV"
mtd6: 00800000 00040000 "LNX"
mtd7: 00040000 00040000 "ARG"


please give me a solution.. :oops:



regards,
shobin.b
shobin
 
Posts: 3
Joined: Mon Dec 23, 2013 7:45 am

Re: getting uboot env variables in linux

Postby WarheadsSE » Thu Feb 27, 2014 1:27 pm

Are you sure you have the configuration right?
- Device -- looks probably good
- Offset -- definitely good
- Sector Size -- thats a massive sector size.. almost the whole partition.. maybe consider setting that to something sane.
- Number of sectors -- Obviously partition size x # sectors > partition size.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm


Return to U-Boot/Kernel

Who is online

Users browsing this forum: No registered users and 21 guests