ENV2 Q&A
Q1: Does ENV currently support backup partitions?
Yes, it does. The default is disabled, you need to manually enable it.
Q2: What is the ENV backup mechanism?
-
The ENV of nand flash is divided into ENV0 and ENV1, which occupy two blocks (2*128K) respectively. The actual data length is 4K, and one bad block is supported in the partition.
Refer to
image/configs/p3/spinand.ubifs.partition.dualenv.dispcam.config
ENV partition config. -
No bad blocks in nor flash, UBOOT_ENV partition size is 2*4K
Refer to
image/configs/p3/nor.squashfs.partition.dualenv.dispcam.config
ENV partition config.
Q3: How to enable ENV backup?
-
In Uboot, you need to open CONFIG_MS_NAND_ENV_BACKUP/CONFIG_MS_NOR_ENV_BACKUP (NAND / NOR)
NAND:
NOR:
Refer to configs/pioneer3_dualenv_defconfig / configs/pioneer3_dualenv_spinand_defconfig
-
The project partition configuration needs to increase the backup ENV partition, please refer to Q2.
Q3: Is the data in the two backup partitions of ENV exactly the same?
Except that the first burn is exactly the same, each saveenv is saved alternately, so there will be a difference between the results of saveenv between the two ENVs. If you want to be completely consistent, you need to do saveenv twice after setenv.
Q4: After the kernel is running, is it supported to set ENV variables through user mode?
Yes, it is. The setting can be completed through the bin of fw_printenv provided by uboot util.
Q5: Is the env backup mechanism supported by setting ENV via fw_printenv?
Yes, it is.
Q6: How to set the default ENV in uboot?
Please refer to SSD_env setting in uboot.