unable to read uboot environment using fw_printenv in imx8mm evk

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

unable to read uboot environment using fw_printenv in imx8mm evk

10,089 Views
ganesh_k
Contributor III

i m trying to update the imx-boot(bootloader) image from user space(target board). from the target board, i can able to see below partitions.
mmcblk2 mmcblk2boot1 mmcblk2p2
mmcblk2boot0 mmcblk2p1 mmcblk2rpmb

i m bit confused to update the bootloader image and also in which partition environment variable available to read the environment variables from user space using fw_printenv command.
while running this fw_printenv command i m getting below error.
-----------------------------------------------------------------------------------
root@arm:~# fw_printenv
Cannot read environment, using default
Cannot read default environment from file
-----------------------------------------------------------------------------------
below lines are edit for fw_evn.config file in /etc folder
-----------------------------------------------------------------------------------
root@arm:~# cat /etc/fw_env.config
/dev/mmcblk2 0x400000 0x1000
/dev/mmcblk2 0x400000 0x1000
------------------------------------------------------------------------------------

can someone tell me ..where i m doing mistake here.
Thanks in advance...

Labels (1)
0 Kudos
Reply
3 Replies

10,085 Views
igorpadykov
NXP Employee
NXP Employee

Hi ganesh_k

 

one can look at fw_printenv discussion on yocto mail list

https://lists.yoctoproject.org/g/meta-freescale/topic/80166140#24508

 

Best regards
igor

0 Kudos
Reply

10,068 Views
ganesh_k
Contributor III

Solved this issue by following procedure.
-> added the "#define CONFIG_SYS_MMC_ENV_PART 0" in the "include/configs/imx8mm_evk.h" file in uboot.

which makes the environment will rw to userspace area.

and made one partition(/dev/mmcblk2p1) in emmc for this environment. and given the env partition starting address as env offset address(0x400000) in uboot.

etc/fw_env.config configured as below

/dev/mmcblk2p1 0x400000 0x1000

 

now i can able to read and write to the env using fw_printenv and fw_setenv.

0 Kudos
Reply

10,046 Views
BiyongSUN
NXP Employee
NXP Employee

I don't know if you define new one for env. It can sync with u-boot command or not.

Linux fw_printenv fw_setenv to access U-Boot's environment variables
https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Linux-fw-printenv-fw-setenv-to-access-U-...

fw_env.config
fw_env.config default directory is in the /etc/
/dev/mmcblk1 0x400000 0x2000
uboot/include/configs/imx8qxp_mek.h
0x2000 : #define CONFIG_ENV_SIZE 0x2000
0x400000: #define CONFIG_ENV_OFFSET (64 * SZ_64K)