How to build fw_printenv and fw_setenv for LS1012AFRWY OpenWrt-19.04?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to build fw_printenv and fw_setenv for LS1012AFRWY OpenWrt-19.04?

Jump to solution
2,924 Views
paul7
Contributor II

Hi,

How to build fw_printenv and fw_setenv for LS1012AFRWY OpenWrt-19.04?

Thanks 

0 Kudos
1 Solution
2,715 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please execute "make menuconfig", then select select the following option and run "make" to regenerate rootfs image.

Utilities  ---> Boot Loaders  ---> <*> uboot-envtools................. read/modify U-Boot bootloader environment 

View solution in original post

3 Replies
2,716 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please execute "make menuconfig", then select select the following option and run "make" to regenerate rootfs image.

Utilities  ---> Boot Loaders  ---> <*> uboot-envtools................. read/modify U-Boot bootloader environment 

2,715 Views
paul7
Contributor II


After build with above option selected.

How to modify U-boot environment variables from Linux use these two tools?

Should I config below config file for ls1012afrwy NOR flash memory map 0x001D_0000 for env space?

/etc/fw_env.config

# NOR example
# MTD device name    Device offset    Env. size       Flash sector size    Number of sectors
/dev/mtd0                   0x001D0000      0x10000         0x4000

 

0 Kudos
2,715 Views
yipingwang
NXP TechSupport
NXP TechSupport

On the target, please create a configuration file /etc/fw_env.config, the content like this

 /dev/mtd5 0x60000 0x2000 0x100000  

MTD device name  Device Offset  Environment Size  Flash sector size  

Then execute "fw_printenv" and "fw_setenv" to read and write u-boot environment

 
Please refer to the following definition in include/configs/ls1012afrwy.h

#undef CONFIG_ENV_OFFSET

#define CONFIG_ENV_OFFSET              0x1D0000

#undef FSL_QSPI_FLASH_SIZE

#define FSL_QSPI_FLASH_SIZE            SZ_16M

#undef CONFIG_ENV_SECT_SIZE

#define CONFIG_ENV_SECT_SIZE            0x10000 /*64 KB*/

#undef CONFIG_ENV_SIZE

#define CONFIG_ENV_SIZE                 0x10000 /*64 KB*/