How to Read uboot EMMC Environment from the userspace for imx8MP

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

How to Read uboot EMMC Environment from the userspace for imx8MP

223 Views
ankitpanchal167
Contributor III

I have tried to read U-boot Environment from Userspace using fw_printenv command.

But it is showing below error:
# fw_printenv
Cannot read the environment, using the default
Cannot read default environment from file

Below is the fw_env.config file 
# cat /etc/fw_env.config
/dev/mmcblk2 0x400000 0x4000

 I am doing partition using the parted command.
Below EMMC partition information.

# parted /dev/mmcblk2 unit s print list
Model: MMC IX2932 (sd/mmc)
Disk /dev/mmcblk2: 61120512s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number        Start           End            Size            File system Name Flags
1                   2048s        489471s     487424s      fat16 primary msftdata
2                   489472s    2834431s   2344960s    ext4 primary
3                   2834432s  5177343s   2342912s    ext4 primary
4                   5177344s  61118463s  55941120s  ext4 primary


Error: /dev/mmcblk2boot1: unrecognised disk label
Model: Generic SD/MMC Storage Card (sd/mmc)
Disk /dev/mmcblk2boot1: 8192s
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mmcblk2boot0: unrecognised disk label
Model: Generic SD/MMC Storage Card (sd/mmc)
Disk /dev/mmcblk2boot0: 8192s
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Below U-boot configuration.
CONFIG_ENV_SIZE=0x4000
CONFIG_ENV_OFFSET=0x400000
CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_ENV_OFFSET_REDUND=0x404000
CONFIG_SYS_MMC_ENV_DEV=2
CONFIG_SYS_MMC_ENV_PART=0
CONFIG_CMD_SAVEENV=y

how to calculate the CONFIG_ENV_OFFSET?
Please let me know anything I am missing here.

0 Kudos
2 Replies

182 Views
ankitpanchal167
Contributor III
I have tried. I have faced same issue.

This above offset is for sdcard. I want to use EMMC with a custom partition.
0 Kudos