cancel
Showing results for 
Search instead for 
Did you mean: 

EMMC max offset blocks flashlayout process

BHSTSAG
Visitor

Hello,

I have a custom STM32MP131AAE6 board and it has a 7GB eMMC storage.

I am using Yocto (mickledore) as a build system.

I want to allocate 2GB for my rootfs-a and 2GB for my rootfs-b.

I have no issue with automatically generating a FlashLayout for 2 partitions for bootfs, rootfs and userfs.

In Yocto (meta-st-stm32mp/conf/machine/include/st-machine-storage-device-stm32mp.inc), there is:

# 32 Gbit
DEVICE_MAX_OFFSET:EMMC ?= "0x10000000"

This limits eMMC to 4GB.

So, I set it to none as done for SDCARD config:

# No limit for SDCARD
DEVICE_MAX_OFFSET:SDCARD ?= "non"

 It generated a FlashLayout that looks like:

#Opt Id Name Type IP Offset Binary
- 0x01 fsbl-boot Binary none 0x0 arm-trusted-firmware/tf-a-stm32mp131a-mm-mx-usb.stm32
- 0x03 fip-boot FIP none 0x0 fip/fip-stm32mp131a-mm-mx-optee-emmc.bin
P 0x04 fsbl1 Binary mmc1 boot1 arm-trusted-firmware/tf-a-stm32mp131a-mm-mx-optee-emmc.stm32
P 0x05 fsbl2 Binary mmc1 boot2 arm-trusted-firmware/tf-a-stm32mp131a-mm-mx-optee-emmc.stm32
P 0x06 metadata1 FWU_MDATA mmc1 0x00080000 arm-trusted-firmware/metadata.bin
P 0x07 metadata2 FWU_MDATA mmc1 0x00100000 arm-trusted-firmware/metadata.bin
P 0x08 fip-a FIP mmc1 0x00180000 fip/fip-stm32mp131a-mm-mx-optee-emmc.bin
PED 0x09 fip-b FIP mmc1 0x00580000 none
PED 0x0A u-boot-env ENV mmc1 0x00980000 none
P 0x10 bootfs-a System mmc1 0x00A00000 st-image-bootfs-openstlinux-mm-mm.ext4
P 0x11 bootfs-b System mmc1 0x04A00000 st-image-bootfs-openstlinux-mm-mm.ext4
P 0x12 rootfs-a FileSystem mmc1 0x08A00000 image-mm-dev-mm.ext4
P 0x13 rootfs-b FileSystem mmc1 0x88A00000 image-mm-dev-mm.ext4
P 0x14 userfs-a FileSystem mmc1 0x108A00000 st-image-userfs-openstlinux-mm-mm.ext4
P 0x15 userfs-b FileSystem mmc1 0x110A00000 st-image-userfs-openstlinux-mm-mm.ext4

So, it exceeded the max offset size.

Now, when I try to flash the eMMC with STM32_Programmer_CLI (Version 2.10.0), flashing get loading bootfs.

I have attached the log of the programmer, and the console log that shows no issue.

My question is:

  • Why exceeding the offset limit produces this issue ?
  • Am I allowed to exceed the max offset ?
  • How can I then use full eMMC 7GB layout ?

In case you wonder how I made it generate the flashlayout and define new partitions, here is my config:

# Remove default rootfs, bootfs and userfs images
PARTITIONS_IMAGES:remove = "rootfs"
PARTITIONS_IMAGES:remove = "bootfs"
PARTITIONS_IMAGES:remove = "userfs"

# Create new partitions
PARTITIONS_IMAGES:append = " rootfs-a rootfs-b"
PARTITIONS_IMAGES:append = " ${@bb.utils.contains('ST_BOOTFS', '1', 'bootfs-a bootfs-b', '', d)}"
PARTITIONS_IMAGES:append = " ${@bb.utils.contains('ST_USERFS', '1', 'userfs-a userfs-b', '', d)}"

STM32MP_BOOTFS_LABEL_A
= "bootfs-a"
STM32MP_BOOTFS_LABEL_B = "bootfs-b"
PARTITIONS_IMAGES[bootfs-a] ?= "${STM32MP_BOOTFS_IMAGE},${STM32MP_BOOTFS_LABEL_A},${STM32MP_BOOTFS_MOUNTPOINT},${STM32MP_BOOTFS_SIZE},System"
PARTITIONS_IMAGES[bootfs-b] ?= "${STM32MP_BOOTFS_IMAGE},${STM32MP_BOOTFS_LABEL_B},${STM32MP_BOOTFS_MOUNTPOINT},${STM32MP_BOOTFS_SIZE},System"

STM32MP_ROOTFS_LABEL_A = "rootfs-a"
STM32MP_ROOTFS_LABEL_B = "rootfs-b"
PARTITIONS_IMAGES[rootfs-a] ?= "${STM32MP_ROOTFS_IMAGE},${STM32MP_ROOTFS_LABEL_A},,${IMAGE_ROOTFS_MAXSIZE},FileSystem"
PARTITIONS_IMAGES[rootfs-b] ?= "${STM32MP_ROOTFS_IMAGE},${STM32MP_ROOTFS_LABEL_B},,${IMAGE_ROOTFS_MAXSIZE},FileSystem"

STM32MP_USERFS_LABEL_A = "userfs-a"
STM32MP_USERFS_LABEL_B = "userfs-b"
PARTITIONS_IMAGES[userfs-a] ?= "${STM32MP_USERFS_IMAGE},${STM32MP_USERFS_LABEL_A},${STM32MP_USERFS_MOUNTPOINT},${STM32MP_USERFS_SIZE},FileSystem"
PARTITIONS_IMAGES[userfs-b] ?= "${STM32MP_USERFS_IMAGE},${STM32MP_USERFS_LABEL_B},${STM32MP_USERFS_MOUNTPOINT},${STM32MP_USERFS_SIZE},FileSystem"

PARTITIONS_LIST = "${@bb.utils.contains('ST_BOOTFS', '1', 'bootfs-a bootfs-b', '', d)}"
PARTITIONS_LIST += "rootfs-a rootfs-b"
PARTITIONS_LIST += "${@bb.utils.contains('ST_USERFS', '1', 'userfs-a userfs-b', '', d)}"

Thanks

 

EDIT: Using STM32_Programmer_CLI (Version 2.15.0), same error.

I cannot use latest version because my distro does not have the required GLIBC version for the binary.

0 REPLIES 0