working fw_env.config for lx2160a fw_printenv

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

working fw_env.config for lx2160a fw_printenv

1,831 Views
robert_hammond
Contributor I

Hi , Has anyone been able to get u-boot tools fw_printenv to work successfully on LX2160ardb? If so are you using the u-boot tools source that gets shipped with flexbuilder LSDK or standard u-boot tools cross compiled to arm64?

The fw_env.config file that is in the flexbuilder source doesn't work for us. 

I can see the environement with hexdump :-

# hexdump -C -s 0x500000 /dev/mtd0 | head -n 5
00500000  ee 1f 12 15 42 4f 41 52  44 3d 6c 78 32 31 36 30  |....BOARD=lx2160|
00500010  61 72 64 62 00 61 72 63  68 3d 61 72 6d 00 62 61  |ardb.arch=arm.ba|
00500020  75 64 72 61 74 65 3d 31  31 35 32 30 30 00 62 6f  |udrate=115200.bo|
00500030  61 72 64 3d 6c 78 32 31  36 30 61 00 62 6f 61 72  |ard=lx2160a.boar|
00500040  64 5f 6e 61 6d 65 3d 6c  78 32 31 36 30 61 00 62  |d_name=lx2160a.b|

This is suggesting that env starts at 00500000

The fw_env.config that ships with flexbuilder has :-

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

which is completely wrong since /dev/mtd0 and /dev/mtd1 only.

the sector size according to u-boot is 128KiB 0x20000 -- 128KiB 

so our config line is 

/dev/mtd0 0x500000 0x40000 0x20000 

however , the usual crc checksum error is coming back.

If anyone can read uboot vars from Linux Userspace could you please share your configuration?

0 Kudos
Reply
2 Replies

1,763 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following definition in include/configs/lx2160a_common.h in u-boot source code.

#define CONFIG_SYS_MMC_ENV_DEV          0

#define CONFIG_ENV_SIZE                 0x2000          /* 8KB */

#define CONFIG_ENV_SECT_SIZE            0x20000

#define CONFIG_ENV_OFFSET               0x500000

#define CONFIG_ENV_ADDR                 (CONFIG_SYS_FLASH_BASE + \

                                         CONFIG_ENV_OFFSET)

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

 /dev/mtd0  0x500000  0x2000  0x20000 

MTD device name  Device Offset  Environment Size  Flash sector size  

 

0 Kudos
Reply

1,763 Views
robert_hammond
Contributor I

For anyone needing this information the line in fw_env.config is :-

/dev/mtd0 0x500000 0x2000 0x20000 1

this will only work after the env have been saved in the bootloader. The default env is hardcoded within u-boot in 
./include/configs/lx2160ardb.h under CONFIG_EXTRA_ENV_SETTINGS.

0 Kudos
Reply