1. 程式人生 > >fw_printenv/fw_setenv can't work in my arm-linux board's userspace?

fw_printenv/fw_setenv can't work in my arm-linux board's userspace?

@author : Mingling.lu
@date   : 20151123日 08:53:22
@e-mail : mingllu@163.com

How to get fw_printenv/fw_setenv?

cd $(U_BOOTDIR)
make env
ls tools/env/
Then you will find fw_printenv . 

rename $(U-BOOTDIR)/tools/env/fw_printenv.c     $(U_BOOTDIR)/tools/env/fw_setenv.c
make env
ls tools/env/
Then you will find fw_setenv. 

How to use fw_printenv/fw_setenv in my arm-linux board’s userspace?

fw_printenv usage example:
[root@demobaord] fw_printenv

fw_setenv usage example:
[root@demobaord] fw_setenv bootdelay 1 

*note : fw_printenv will change env’s value in SDRAM, not write into nandflash/norflash/eeprom., but, fw_setenv will write env’s value into nandflash/norflash/eeprom.

Why am I can’t run fw_printenv/fw_setenv in my arm-linux board’s userspace?

  • Maybe your u-boot and your linux kernel use different ECC mode,You must ensure your u-boot and your kernel use same ECC mode if you use NandFlash to store ENV.
  • Your u-boot’s CROSS_COMPILE must be same as your kernel’s CROSS_COMPILE.

Last but not least

To sump up, if you want to use fw_printenv/fw_setenv in Userspace, I think you should be clear ECC mode if you use NandFlash to store your ENV parameter.U-boot’s nand Ecc mode must be same as your linux kernel’s ECC mode.