2024-04-02 02:04 PM
Good morning, I've been trying to get EFI boot working from emmc. After configuring flash layouts to contain fat32 efi partition and getting through uboot and optee configuration to properly flash using cube programmer, I can't seem to figure out why the uboot fails to load the EFIed kernel during boot process. It would seem as if the kernel image is missing the efi stub, but my kernel config would suggest otherwise.
Any ideas on how to get the EFI boot to work?
2024-04-05 12:20 AM - edited 2024-04-05 12:21 AM
Hello @Davidomil,
Did you prepare your software using Distribution package (Yocto) or Developer package (Cross compile + SDK)
Do you confirm you are aware about the different steps mentioned in this article, specially the fragment for U-Boot and the kernel ? https://wiki.st.com/stm32mpu/wiki/How_to_configure_UEFI_boot_with_the_Distribution_Package
Kind regards,
Erwan.
2024-04-18 11:11 AM
Hello @Erwan SZYMANSKI ,
I am building from yocto environment. And my uboot efi config looks like this:
# Basic EFI configuration
# Compliant with SystemReady 1.1
#
CONFIG_BOOTM_EFI=y
CONFIG_CMD_BOOTEFI=y
CONFIG_CMD_NVEDIT_EFI=y
CONFIG_CMD_EFIDEBUG=y
CONFIG_CMD_BOOTEFI_HELLO=y
CONFIG_CMD_BOOTEFI_HELLO_COMPILE=y
CONFIG_CMD_BOOTEFI_SELFTEST=y
CONFIG_CMD_GPT=y
CONFIG_EFI_PARTITION=y
CONFIG_EFI_LOADER=y
CONFIG_EFI_DEVICE_PATH_TO_TEXT=y
CONFIG_EFI_UNICODE_COLLATION_PROTOCOL2=y
CONFIG_EFI_UNICODE_CAPITALIZATION=y
CONFIG_EFI_HAVE_RUNTIME_RESET=y
CONFIG_EFI_VARIABLE_FILE_STORE=y
# RTC: GET TIME
CONFIG_DM_RTC=y
CONFIG_EFI_GET_TIME=y
CONFIG_EFI_SET_TIME=y
CONFIG_RTC_EMULATION=y
# Capsule update
CONFIG_CMD_DFU=y
CONFIG_FLASH_CFI_MTD=y
CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y
CONFIG_EFI_CAPSULE_FIRMWARE_MANAGEMENT=y
CONFIG_EFI_CAPSULE_FIRMWARE=y
CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
CONFIG_EFI_CAPSULE_FMP_HEADER=y
CONFIG_DFU_OVER_TFTP=y
CONFIG_DFU_OVER_USB=y
CONFIG_DFU_MMC=y
CONFIG_DFU_MTD=y
CONFIG_DFU_NAND=y
CONFIG_DFU_SF=y
# filesystem
CONFIG_CMD_GPT=y
CONFIG_FAT_WRITE=y
CONFIG_FS_FAT=y
CONFIG_CMD_PART=y
CONFIG_PARTITIONS=y
CONFIG_DOS_PARTITION=y
CONFIG_ISO_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_PARTITION_UUIDS=y
# EFI addons configuration
# If you need to load an INITRD without efi bootmgr
CONFIG_EFI_LOAD_FILE2_INITRD=y
CONFIG_EFI_INITRD_FILESPEC="mmc 0:8 st-image-resize-initrd"
CONFIG_FIT_SIGNATURE=y
CONFIG_LEGACY_IMAGE_FORMAT=y
CONFIG_EFI_SECURE_BOOT=y
# Device Firmware Upgrade
CONFIG_FIT=y
CONFIG_OF_LIBFDT=y
CONFIG_DFU=y
CONFIG_CMD_DFU=y
CONFIG_DFU_MMC=y
CONFIG_DFU_MTD=y
CONFIG_DFU_NAND=y
CONFIG_DFU_SF=y
CONFIG_DFU_OVER_TFTP=y
CONFIG_DFU_OVER_USB=y
and my kernel config
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_EFI_VARS=y
CONFIG_EFI_VARS_PSTORE=m
CONFIG_EFI_CAPSULE_LOADER=m
# --------------------------
# Systemd
# --------------------------
CONFIG_EFIVAR_FS=y
CONFIG_EFI_PARTITION=y
# efi
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_EFI_VARS=y
CONFIG_EFI_VARS_PSTORE=y
CONFIG_EFI_CAPSULE_LOADER=y
CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y
CONFIG_EFI_BOOTLOADER_CONTROL=y
CONFIG_EFI_CAPSULE_LOADER=y
# needed for lttng-modules
CONFIG_KPROBES=y
CONFIG_KALLSYMS_ALL=y
CONFIG_TEE=y
CONFIG_OPTEE=y
CONFIG_RELOCATABLE=y
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_X86_SYSFB=y
CONFIG_FB_SIMPLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_EFIVAR_FS=y
CONFIG_EFI_PARTITION=y
CONFIG_EFI_MIXED=y
I do have MACHINE_FEATURES += "efi" in my machine configuration