2022-10-07 02:21 PM
The default configuration for the trusted defconfig has CONFIG_ENV_IS_NOWHERE=y . How can I store the u-boot-env on mmc such that fw_printenv can read it. When I took out CONFIG_ENV_IS_NOWHERE I am unable to get the boot process to u-boot. The last thing I get is
NOTICE: SP_MIN: v2.4-r1.0(debug):devtool-patched-5-g73e4b89f4-dirty
NOTICE: SP_MIN: Built : 19:06:02, Sep 21 2022
INFO: ARM GICv2 driver initialized
INFO: Set calibration timer to 60 sec
INFO: stm32mp1 IWDG1 is secure
INFO: SP_MIN: Initializing runtime services
INFO: SP_MIN: Preparing exit to normal world
INFO: CPU 0 IT Watchdog 2
INFO: CPU : 0
INFO: sp_usr : 0x0
INFO: lr_usr : 0x0
INFO: spsr_irq : 0x0
INFO: sp_irq : 0x0
INFO: lr_irq : 0x0
INFO: spsr_fiq : 0x0
INFO: sp_fiq : 0x0
INFO: lr_fiq : 0x0
INFO: spsr_svc : 0x0
INFO: sp_svc : 0xc00fcf08
INFO: lr_svc : 0xc0174d5d
INFO: spsr_abt : 0x0
INFO: sp_abt : 0x0
INFO: lr_abt : 0x0
INFO: spsr_und : 0x0
INFO: sp_und : 0x0
INFO: lr_und : 0x0
INFO: spsr_mon : 0xa00001f3
INFO: sp_mon : 0x2ffd8a80
INFO: lr_mon : 0xc0174d5c
INFO: scr : 0x225
INFO: pmcr : 0x41072000
and then a watchdog timer. My gpt image looks like this.
EOF
part fsbl1 --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=fsbl1 --sourceparams="file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware/tf-a-stm32mp157c-osd32mp1-system-controller-sdcard.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 256K --align 17
part fsbl2 --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=fsbl2 --sourceparams="file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware/tf-a-stm32mp157c-osd32mp1-system-controller-sdcard.stm32" --ondisk mmcblk --part-type 0x8301 --fixed-size 256K
part fip --source rawcopy --fstype=ext4 --fsoptions "noauto" --part-name=fip --sourceparams="file=${DEPLOY_DIR_IMAGE}/fip/fip-stm32mp157c-osd32mp1-system-controller-trusted.bin" --ondisk mmcblk --part-type 0x8301 --fixed-size 4096K
part --source rawcopy --sourceparams="file=${WORKDIR}/uboot.env" --ondisk "$ondisk_dev" --align $boot_env_align_kb --no-table
part --source rootfs --rootfs-dir ${WORKDIR}/bootfs.${BB_CURRENTTASK} --ondisk "$ondisk_dev" --fstype=vfat --label boot --align $alignment_kb --fixed-size ${MENDER_BOOT_PART_SIZE_MB} --active $boot_part_params
part --source rootfs --ondisk "$ondisk_dev" --fstype=${ARTIFACTIMG_FSTYPE} --label primary --align $alignment_kb --fixed-size ${MENDER_CALC_ROOTFS_SIZE}k $exclude_path_options
part --source rootfs --ondisk "$ondisk_dev" --fstype=${ARTIFACTIMG_FSTYPE} --label secondary --align $alignment_kb --fixed-size ${MENDER_CALC_ROOTFS_SIZE}k $exclude_path_options
part --source rootfs --rootfs-dir ${IMAGE_ROOTFS}/data --ondisk "$ondisk_dev" --fstype=${ARTIFACTIMG_FSTYPE} --label data --align $alignment_kb --fixed-size ${MENDER_DATA_PART_SIZE_MB}
bootloader --ptable gpt
EOF
My u-boot defconfig looks like
CONFIG_ARM=y
CONFIG_ARCH_STM32MP=y
CONFIG_TFABOOT=y
CONFIG_SYS_MALLOC_F_LEN=0x3000
# CONFIG_ENV_OFFSET=0x280000
# CONFIG_ENV_OFFSET_REDUND=0x2c0000
CONFIG_ENV_OFFSET=0x280400
CONFIG_ENV_OFFSET_REDUND=0x282400
# CONFIG_ENV_SECT_SIZE=0x40000
# CONFIG_ENV_OFFSET=0x280000
# CONFIG_ENV_OFFSET_REDUND=0x2c0000
CONFIG_TARGET_AXCEND_SYSTEM_CONTROLLER=y
CONFIG_CMD_STM32PROG=y
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-osd32mp1-system-controller"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_FIT=y
CONFIG_BOOTDELAY=1
CONFIG_BOOTCOMMAND="run mender_setup; run bootcmd_stm32mp"
CONFIG_SYS_PROMPT="u-boot> "
# CONFIG_CMD_BOOTD is not set
CONFIG_CMD_ADTIMG=y
# CONFIG_CMD_ELF is not set
CONFIG_CMD_EEPROM=y
CONFIG_CMD_ERASEENV=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMTEST=y
CONFIG_SYS_MEMTEST_START=0xc0000000
CONFIG_SYS_MEMTEST_END=0xc4000000
CONFIG_CMD_ADC=y
CONFIG_CMD_CLK=y
CONFIG_CMD_DFU=y
CONFIG_CMD_FUSE=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
CONFIG_CMD_REMOTEPROC=y
CONFIG_CMD_SPI=y
CONFIG_CMD_USB=y
CONFIG_CMD_USB_MASS_STORAGE=y
CONFIG_CMD_BMP=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_TIME=y
CONFIG_CMD_TIMER=y
CONFIG_CMD_PMIC=y
CONFIG_CMD_REGULATOR=y
CONFIG_CMD_EXT4_WRITE=y
CONFIG_CMD_MTDPARTS=y
CONFIG_CMD_UBI=y
# CONFIG_ENV_IS_NOWHERE=y
CONFIG_CMD_SAVEENV=y
CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SYS_MMC_ENV_DEV=0
CONFIG_SYS_MMC_ENV_PART=3
CONFIG_ENV_SIZE=0x2000
CONFIG_STM32_ADC=y
CONFIG_CLK_SCMI=y
CONFIG_SET_DFU_ALT_INFO=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
CONFIG_FASTBOOT_BUF_SIZE=0x02000000
CONFIG_FASTBOOT_USB_DEV=1
CONFIG_FASTBOOT_FLASH=y
CONFIG_FASTBOOT_FLASH_MMC_DEV=1
CONFIG_GPIO_HOG=y
CONFIG_DM_HWSPINLOCK=y
CONFIG_HWSPINLOCK_STM32=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_STM32F7=y
CONFIG_LED=y
CONFIG_LED_GPIO=y
CONFIG_DM_MAILBOX=y
CONFIG_STM32_IPCC=y
CONFIG_STM32_FMC2_EBI=y
CONFIG_I2C_EEPROM=y
CONFIG_DM_MMC=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_STM32_SDMMC2=y
CONFIG_MTD=y
CONFIG_DM_MTD=y
CONFIG_SYS_MTDPARTS_RUNTIME=y
CONFIG_MTD_RAW_NAND=y
CONFIG_NAND_STM32_FMC2=y
CONFIG_MTD_SPI_NAND=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH_MACRONIX=y
CONFIG_SPI_FLASH_SPANSION=y
CONFIG_SPI_FLASH_STMICRO=y
CONFIG_SPI_FLASH_WINBOND=y
# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
CONFIG_SPI_FLASH_MTD=y
CONFIG_PHY_REALTEK=y
CONFIG_DM_ETH=y
CONFIG_DWC_ETH_QOS=y
CONFIG_PHY=y
CONFIG_PHY_STM32_USBPHYC=y
CONFIG_PINCONF=y
CONFIG_PINCTRL_STMFX=y
CONFIG_DM_PMIC=y
CONFIG_PMIC_STPMIC1=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
CONFIG_DM_REGULATOR_STPMIC1=y
CONFIG_REMOTEPROC_STM32_COPRO=y
CONFIG_RESET_SCMI=y
CONFIG_DM_RNG=y
CONFIG_RNG_STM32MP1=y
CONFIG_DM_RTC=y
CONFIG_RTC_STM32=y
CONFIG_SERIAL_RX_BUFFER=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_STM32_QSPI=y
CONFIG_STM32_SPI=y
CONFIG_TEE=y
CONFIG_OPTEE=y
# CONFIG_OPTEE_TA_AVB is not set
CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_DM_USB_GADGET=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
CONFIG_USB_GADGET_VENDOR_NUM=0x0483
CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
CONFIG_USB_GADGET_DWC2_OTG=y
CONFIG_DM_VIDEO=y
CONFIG_BACKLIGHT_GPIO=y
CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y
CONFIG_VIDEO_LCD_RAYDIUM_RM68200=y
CONFIG_VIDEO_STM32=y
CONFIG_VIDEO_STM32_DSI=y
CONFIG_VIDEO_STM32_MAX_XRES=1280
CONFIG_VIDEO_STM32_MAX_YRES=800
CONFIG_WDT=y
CONFIG_WDT_STM32MP=y
CONFIG_ERRNO_STR=y
CONFIG_FDT_FIXUP_PARTITIONS=y
CONFIG_LMB_RESERVED_REGIONS=16
CONFIG_BOOTCOUNT_ENV=y
CONFIG_BOOTCOUNT_LIMIT=y
but I can't seem to get it to boot.
2022-10-13 05:52 AM
Hi,
do you got this while trying to flash the image?
2022-10-13 09:30 AM
Yes
2022-10-13 09:48 AM
Your problem not with u-boot env .
You cannot flash with mender compiled fsbl and fip . I mean that the first two files:
#Opt Id Name Type IP Offset Binary
- 0x01 fsbl-boot Binary none 0x0 arm-trusted-firmware/tf-a-stm32mp153a-mx-usb.stm32
- 0x03 fip-boot FIP none 0x0 fip/fip-stm32mp153a-mx-trusted.bin
you need to build one time without mender layer save this files a side and then to make image with mender.