cancel
Showing results for 
Search instead for 
Did you mean: 

Booting from eMMC STM32MP135

ChrisRCAL
Associate II

Hello,

We had to switch out an SD card for eMMC and we kept with SDMMC1. I am aware of having to burn the fuses to get eMMC to default to SDMMC1 which I did. I was able to get it to flash successfully, and now when you switch it to 010 it will boot from SDMMC1 using eMMC. It will then get an error message, 

 

 

 

 

Terminal ready
gNOTICE:  CPU: STM32MP135A Rev.Y
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mpu-v24.06.26
INFO:    PMIC version = 0x21
INFO:    Reset reason (0x35):
INFO:      Power-on Reset (rst_por)
INFO:    FCONF: Reading TB_FW firmware configuration file from: 0x2ffe0000
INFO:    FCONF: Reading firmware configuration information for: stm32mp_io
INFO:    FCONF: Reading firmware configuration information for: stm32mp_fuse
INFO:    Using EMMC
INFO:      Instance 1
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.8-stm32mp1-r2.0(debug):lts-v2.8.15-dirty(567af710)
NOTICE:  BL2: Built : 00:51:33, Jan 26 2024
INFO:    BL2: Doing platform setup
INFO:    RAM: DDR3-DDR3L 16bits 533000kHz
INFO:    Memory size = 0x20000000 (512 MB)
INFO:    BL2: Loading image id 1
INFO:    Loading image id=1 at address 0x30006000
INFO:    Image id=1 loaded: 0x30006000 - 0x300061ea
INFO:    FCONF: Reading FW_CONFIG firmware configuration file from: 0x30006000
INFO:    FCONF: Reading firmware configuration information for: mce_config
INFO:    FCONF: Reading firmware configuration information for: dyn_cfg
INFO:    FCONF: Reading firmware configuration information for: stm32mp1_firewall
INFO:    BL2: Loading image id 4
INFO:    Loading image id=4 at address 0xde000000
INFO:    Image id=4 loaded: 0xde000000 - 0xde00001c
INFO:    OPTEE ep=0xde000000
INFO:    OPTEE header info:
INFO:          magic=0x4554504f
INFO:          version=0x2
INFO:          arch=0x0
INFO:          flags=0x0
INFO:          nb_images=0x1
INFO:    BL2: Loading image id 8
INFO:    Loading image id=8 at address 0xde000000
INFO:    Image id=8 loaded: 0xde000000 - 0xde033fe8
INFO:    BL2: Loading image id 2
WARNING: Firmware Image Package header check failed.
WARNING: Failed to obtain reference to image id=2 (-2)
ERROR:   BL2: Failed to load image id 2 (-2)

 

 

 

 



When I look at the warning message in the source code for TFA. For the FIP header check failed,

 

 

 

 

if ((header->name == TOC_HEADER_NAME) && (header->serial_number != 0))

 

 

 

 


I verified with fiptool info and the name is equal to TOC_HEADER_NAME and the serial number is not 0, so I have no idea how that fails. 

Then going down to the error message in the source code it talks about trusted-boot, which it should be since i am using the default st-image-core. 

So when I use st-image-core with my .conf, I made sure to enable everything related to eMMC. 

 

 

 

 

#@TYPE: Machine
#@NAME: stm32mp13-mx
#@DESCRIPTION: Configuration for STM32CubeMX generated project
#@NEEDED_BSPLAYERS: layers/meta-openembedded/meta-oe layers/meta-openembedded/meta-python

###########################################################################
#
# Default machine configuration sections
#
###########################################################################

include conf/machine/include/st-machine-common-stm32mp.inc
include conf/machine/include/st-machine-providers-stm32mp.inc

# Define specific common machine name
MACHINEOVERRIDES .= ":stm32mp1common:stm32mp13common"
MACHINEOVERRIDES .= ":stm32mpcommonmx:stm32mp13commonmx"

# =========================================================================
# Chip architecture
# =========================================================================
DEFAULTTUNE = "cortexa7thf-neon-vfpv4"
include conf/machine/include/arm/armv7a/tune-cortexa7.inc

# =========================================================================
# Machine settings
# =========================================================================
# Enable the board device storage support with CUBEMX_DTB
STM32MP_DT_FILES_EMMC  += "${CUBEMX_DTB}"

# =========================================================================
# Machine features (default for stm32mp1 like)
# =========================================================================
MACHINE_FEATURES += "watchdog"
MACHINE_FEATURES += "nosmp"

# =========================================================================
# Flashlayout
# =========================================================================
# Set the FLASHLAYOUT_TYPE_LABELS for 'extensible' to CUBEMX_DTB
FLASHLAYOUT_TYPE_LABELS:extensible = "${CUBEMX_DTB}"

# =========================================================================
# CubeMX extra config
# =========================================================================
ENABLE_CUBEMX_DTB ?= "1"

# =========================================================================
# OPTEE profile
# =========================================================================
# Optee profile, permit to activate or desactvate a list of service on optee.
# There is two configuration available:
#  - secure_and_system_services aka optee boot scheme
#  - system_services aka opteemin boot scheme

# Default optee profile use by all soc, (if exception see if there is a specific
# profile for a soc)
ST_OPTEE_PROFILE ?= "system_services"

###########################################################################
#
# User machine customization sections
#
###########################################################################


# Partitions
# =========================================================================
ST_VENDORFS = "0"
ST_USERFS   = "0"

IMAGE_ROOTFS_MAXSIZE = "1048576"


# Boot Scheme
# =========================================================================
BOOTSCHEME_LABELS += "optee"

# Boot Device Choice
# =========================================================================
# Define the boot device supported
BOOTDEVICE_LABELS += "emmc"

# Support Feature Choice
# =========================================================================
# Define the features to enable on board
#MACHINE_FEATURES += "bluetooth"
#MACHINE_FEATURES += "wifi"
MACHINE_FEATURES += "usbg0"

# Specific firmwares and kernel modules configuration
# =========================================================================
# Set the list of kernel module to be auto-loaded during boot
#KERNEL_MODULE_AUTOLOAD += ""

# Set Bluetooth related package list needed when 'bluetooth' feature is enabled
#BLUETOOTH_LIST += ""

# Set Wifi related package list needed when 'wifi' feature is enabled
#WIFI_LIST += ""

# CubeMX Project Config
# =========================================================================
# Assign CubeMX Board devicetree and project path name
CUBEMX_DTB = "stm32mp135a-ac-comm-mx"
CUBEMX_PROJECT = "/home/chris/STM32CubeIDE/workspace_1.16.0/ac-comm/DeviceTree/ac-comm"

# Indicate which STM32MP package are used: 'A', 'C', 'D' or 'F'
CUBEMX_SOC_PACKAGE = "A"

# Indicate the size of DDR available on BOARD: 512 or 1024 (size in MB unit)
CUBEMX_BOARD_DDR_SIZE = "512"

# Indicate if you like to disable the DVFS which are activated by default
CUBEMX_SOC_DVFS_OFF = "0"

 

 

 

 

 

and for my device tree in TFA and UBOOT, 

 

 

 

 

&sdmmc1{
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc1_pins_mx>;
	status = "okay";

	/* USER CODE BEGIN sdmmc1 */
	non-removable;
	no-sd;
	no-sdio;
	st,neg-edge;
	mmc-ddr-3_3v;
	
	bus-width = <4>;
	vmmc-supply = <&vdd>;
	vqmmc-supply = <&vdd>;
	/* USER CODE END sdmmc1 */
};

 

 

 

 


Which I followed from the wiki. 

Any solutions or suggestions would be highly appreciated. Hopefully I provided enough information. Doing everything similar works when using an SD-Card, its only when trying to switch to an eMMC things get broken. Thank you for your time.







3 REPLIES 3
DMårt
Lead

@ChrisRCAL 

I'm booting from eMMC on MP151

Se my signature for the project. Just copy my device tree.

Copy also my flash layout.

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer

Hello DMart,

Thank you for your response!

I looked at the flash-layout and it looks exactly like the one the ST BSP creates, which is what I am using. I looked at the DTS, and the SDMMC looks practically like mine except I only have 4 data pins. I do not know if the device tree is the issue, because it worked for the SD-Card just fine. I do not know if I copy and paste your dts it would work on a stm32mp135 since they are different flavors, I practically started from the stm32mp135f-dk board, and trimmed the tree down to only the devices/peripherals I needed. 

@ChrisRCAL 

 

Activate the Op-tee debug and set the debug level to 4. 

When you got this message when the software of the image is corrupt.

Firmware Image Package header check failed.

 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer