cancel
Showing results for 
Search instead for 
Did you mean: 

Issue Using CubeMX Generated Files on STM32MP135DF with Kirkstone Yocto

Midhul_Pk
Associate II

Hi all,

I’m working with the STM32MP135DF board and trying to use a fully custom stack including Machine/Device Tree, Kernel, U-Boot, TF-A, and OP-TEE.

Here’s my setup:

  • Poky / Yocto version: kirkstone-4.0.27

  • CubeMX version: openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11

  • Added CubeMX generated files under: 

meta-st/meta-st-stm32-Addons/mx/
└── stm32mp135df-comtrol
    ├── kernel
    │   ├── Makefile
    │   └── stm32mp135f-stm32mp135df-comtrol-mx.dts
    ├── optee-os
    │   ├── conf.mk
    │   └── stm32mp135f-stm32mp135df-comtrol-mx.dts
    ├── tf-a
    │   ├── stm32mp135f-stm32mp135df-comtrol-mx.dts
    │   ├── stm32mp135f-stm32mp135df-comtrol-mx-fw-config.dts
    │   └── stm32mp13-mx.dtsi
    └── u-boot
        ├── Makefile
        ├── stm32mp135f-stm32mp135df-comtrol-mx.dts
        └── stm32mp135f-stm32mp135df-comtrol-mx-u-boot.dtsi

 

  • Generated custom machine by copying stm32mp13-disco-mx.conf.sample.

  • Successfully built the image.

 

Problem:

When I try to flash using the STM32 flashing tool Using Usb, it gets stuck after the 0x03 partition.

I suspect this is due to version mismatch between CubeMX-generated files and my Yocto version.

Questions:

  1. How can I change the Yocto version in CubeMX so it matches my kirkstone-4.0.27 setup?

  2. Am I missing any additional steps when integrating CubeMX generated files into an existing Yocto project?

  3. Are there any known compatibility issues with openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11 files on kirkstone?

Any guidance, best practices, or examples would be highly appreciated.

Thanks!

boot Log while flashing 

NOTICE:  CPU: STM32MP135F Rev.Y
NOTICE:  Model: STMicroelectronics STM32MP135F-DK STM32CubeMX board - openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11
NOTICE:  Board: MB1635 Var1.0 Rev.E-02
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:    Using USB
INFO:      Instance 2
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.6-stm32mp1-r2.1(debug):v2.6-dirty(a1f02f4f)
NOTICE:  BL2: Built : 13:14:26, Nov 23 2021
INFO:    BL2: Doing platform setup
INFO:    RAM: DDR3-DDR3L 16bits 533000kHz
INFO:    Memory size = 0x20000000 (512 MB)
INFO:    DFU USB START...
INFO:    handle USB : Suspend int
INFO:    USB Suspend mode
INFO:    handle USB : Reset
INFO:    handle USB : Reset
INFO:    phase ID :3, Manifestation 0 at c716c3de
INFO:    Send detach request
INFO:    Receive DFU Detach
INFO:    DFU USB STOP...
INFO:    BL2: Loading image id 1
INFO:    Loading image id=1 at address 0x30006000
INFO:    Image id=1 loaded: 0x30006000 - 0x30006246
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 0xde200000
INFO:    Image id=4 loaded: 0xde200000 - 0xde20001c
INFO:    OPTEE ep=0xde200000
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 0xde200000
INFO:    Image id=8 loaded: 0xde200000 - 0xde2792f8
INFO:    BL2: Loading image id 2
INFO:    Loading image id=2 at address 0xc0400000
INFO:    Image id=2 loaded: 0xc0400000 - 0xc040e7c8
INFO:    BL2: Skip loading image id 16
INFO:    BL2: Loading image id 5
INFO:    Loading image id=5 at address 0xc0000000
INFO:    Image id=5 loaded: 0xc0000000 - 0xc00e4594
NOTICE:  BL2: Booting BL32
INFO:    Entry point address = 0xde200000
INFO:    SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC: 
I/TC: Non-secure external DT found
I/TC: Embedded DTB found
I/TC: OP-TEE version: 3.16.0-dev (gcc version 11.4.0 (GCC)) #1 Fri Jan 28 02:28:18 PM UTC 2022 arm
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
E/TC:0 0 stm32_clk_parse_fdt_opp:1772 2 MAX opp in st,ck_mpu
E/TC:0 0 Panic at core/drivers/clk/clk-stm32mp13.c:1773 <stm32_clk_parse_fdt_opp>
E/TC:0 0 TEE load address @ 0xde200000
E/TC:0 0 Call stack:
E/TC:0 0  0xde203cb5
E/TC:0 0  0xde21bf01
E/TC:0 0  0xde217bed
E/TC:0 0  0xde217e57
E/TC:0 0  0xde21aad7
E/TC:0 0  0xde21b015
E/TC:0 0  0xde216d29
E/TC:0 0  0xde216de9
E/TC:0 0  0xde216e07
E/TC:0 0  0xde216e07
E/TC:0 0  0xde216f83
E/TC:0 0  0xde21cbc1
E/TC:0 0  0xde203af7
E/TC:0 0  0xde200198


Cube Programmer
Screenshot from 2025-10-23 18-42-30.png

Image Folder 

├── arm-trusted-firmware
│   ├── debug
│   │   ├── debug-tf-a-stm32mp135f-stm32mp135df-comtrol-mx-sdcard.stm32
│   │   ├── debug-tf-a-stm32mp135f-stm32mp135df-comtrol-mx-uart.stm32
│   │   ├── debug-tf-a-stm32mp135f-stm32mp135df-comtrol-mx-usb.stm32
│   │   ├── tf-a-bl2-stm32mp13-sdcard.elf
│   │   ├── tf-a-bl2-stm32mp13-uart.elf
│   │   └── tf-a-bl2-stm32mp13-usb.elf
│   ├── fwconfig
│   │   └── stm32mp135f-stm32mp135df-comtrol-mx-fw-config-optee.dtb
│   ├── metadata.bin
│   ├── tf-a-stm32mp135f-stm32mp135df-comtrol-mx-sdcard.stm32
│   ├── tf-a-stm32mp135f-stm32mp135df-comtrol-mx-uart.stm32
│   └── tf-a-stm32mp135f-stm32mp135df-comtrol-mx-usb.stm32
├── core-image-minimal-openstlinux-weston-stm32mp135df-comtrol-20251023130245.rootfs.ext4
├── core-image-minimal-openstlinux-weston-stm32mp135df-comtrol-20251023130245.rootfs.manifest
├── core-image-minimal-openstlinux-weston-stm32mp135df-comtrol-20251023130245.rootfs.tar.xz
├── core-image-minimal-openstlinux-weston-stm32mp135df-comtrol-20251023130245.testdata.json
├── core-image-minimal-openstlinux-weston-stm32mp135df-comtrol.ext4 -> core-image-minimal-openstlinux-weston-stm32mp135df-comtrol-20251023130245.rootfs.ext4
├── core-image-minimal-openstlinux-weston-stm32mp135df-comtrol.manifest -> core-image-minimal-openstlinux-weston-stm32mp135df-comtrol-20251023130245.rootfs.manifest
├── core-image-minimal-openstlinux-weston-stm32mp135df-comtrol.tar.xz -> core-image-minimal-openstlinux-weston-stm32mp135df-comtrol-20251023130245.rootfs.tar.xz
├── core-image-minimal-openstlinux-weston-stm32mp135df-comtrol.testdata.json -> core-image-minimal-openstlinux-weston-stm32mp135df-comtrol-20251023130245.testdata.json
├── fip
│   └── fip-stm32mp135f-stm32mp135df-comtrol-mx-optee.bin
├── flashlayout_core-image-minimal
│   ├── deleteall
│   │   └── FlashLayout_cubemx_stm32mp135f-stm32mp135df-comtrol-mx-deleteall.tsv
│   ├── extensible
│   │   └── FlashLayout_sdcard_stm32mp135f-stm32mp135df-comtrol-mx-extensible.tsv
│   └── optee
│       └── FlashLayout_sdcard_stm32mp135f-stm32mp135df-comtrol-mx-optee.tsv
├── kernel
│   ├── config-5.15.145
│   ├── Image -> Image--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   ├── Image--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   ├── Image-stm32mp135df-comtrol.bin -> Image--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   ├── modules--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.tgz
│   ├── modules-stm32mp135df-comtrol.tgz -> modules--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.tgz
│   ├── modules-stripped--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.tgz
│   ├── modules-stripped-stm32mp135df-comtrol.tgz -> modules-stripped--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.tgz
│   ├── stm32mp135f-stm32mp135df-comtrol-mx--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.dtb
│   ├── stm32mp135f-stm32mp135df-comtrol-mx.dtb -> stm32mp135f-stm32mp135df-comtrol-mx--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.dtb
│   ├── stm32mp135f-stm32mp135df-comtrol-mx-stm32mp135df-comtrol.dtb -> stm32mp135f-stm32mp135df-comtrol-mx--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.dtb
│   ├── uImage -> uImage--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   ├── uImage--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   ├── uImage-stm32mp135df-comtrol.bin -> uImage--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   ├── vmlinux -> vmlinux--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   ├── vmlinux--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   ├── vmlinux-stm32mp135df-comtrol.bin -> vmlinux--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   ├── zImage -> zImage--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   ├── zImage--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
│   └── zImage-stm32mp135df-comtrol.bin -> zImage--5.15.145-stm32mp-r2.2-r0.1-stm32mp135df-comtrol-20251023130245.bin
├── optee
│   ├── debug
│   │   └── tee-stm32mp135f-stm32mp135df-comtrol-mx.elf
│   ├── tee-header_v2-stm32mp135f-stm32mp135df-comtrol-mx.bin
│   ├── tee-pageable_v2-stm32mp135f-stm32mp135df-comtrol-mx.bin
│   └── tee-pager_v2-stm32mp135f-stm32mp135df-comtrol-mx.bin
├── scripts
│   └── create_sdcard_from_flashlayout.sh
├── st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.bootfs.ext4
├── st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.bootfs.manifest
├── st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.bootfs.tar.xz
├── st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.testdata.json
├── st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol.ext4 -> st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.bootfs.ext4
├── st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol.manifest -> st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.bootfs.manifest
├── st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol.tar.xz -> st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.bootfs.tar.xz
├── st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol.testdata.json -> st-image-bootfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.testdata.json
├── st-image-resize-initrd-openstlinux-weston-stm32mp135df-comtrol-20251023130245.rootfs.cpio.gz
├── st-image-resize-initrd-openstlinux-weston-stm32mp135df-comtrol-20251023130245.rootfs.manifest
├── st-image-resize-initrd-openstlinux-weston-stm32mp135df-comtrol-20251023130245.testdata.json
├── st-image-resize-initrd-openstlinux-weston-stm32mp135df-comtrol.cpio.gz -> st-image-resize-initrd-openstlinux-weston-stm32mp135df-comtrol-20251023130245.rootfs.cpio.gz
├── st-image-resize-initrd-openstlinux-weston-stm32mp135df-comtrol.manifest -> st-image-resize-initrd-openstlinux-weston-stm32mp135df-comtrol-20251023130245.rootfs.manifest
├── st-image-resize-initrd-openstlinux-weston-stm32mp135df-comtrol.testdata.json -> st-image-resize-initrd-openstlinux-weston-stm32mp135df-comtrol-20251023130245.testdata.json
├── st-image-userfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.testdata.json
├── st-image-userfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.userfs.ext4
├── st-image-userfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.userfs.manifest
├── st-image-userfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.userfs.tar.xz
├── st-image-userfs-openstlinux-weston-stm32mp135df-comtrol.ext4 -> st-image-userfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.userfs.ext4
├── st-image-userfs-openstlinux-weston-stm32mp135df-comtrol.manifest -> st-image-userfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.userfs.manifest
├── st-image-userfs-openstlinux-weston-stm32mp135df-comtrol.tar.xz -> st-image-userfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.userfs.tar.xz
├── st-image-userfs-openstlinux-weston-stm32mp135df-comtrol.testdata.json -> st-image-userfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.testdata.json
├── st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.testdata.json
├── st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.vendorfs.ext4
├── st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.vendorfs.manifest
├── st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.vendorfs.tar.xz
├── st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol.ext4 -> st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.vendorfs.ext4
├── st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol.manifest -> st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.vendorfs.manifest
├── st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol.tar.xz -> st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.vendorfs.tar.xz
├── st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol.testdata.json -> st-image-vendorfs-openstlinux-weston-stm32mp135df-comtrol-20251023130245.testdata.json
├── st-initrd-openstlinux-weston-stm32mp135df-comtrol
└── u-boot
    ├── debug
    │   └── u-boot-stm32mp13.elf
    ├── u-boot-nodtb-stm32mp13.bin
    └── u-boot-stm32mp135f-stm32mp135df-comtrol-mx.dtb

14 directories, 82 files

 

Machine.conf

 

#@TYPE: Machine
#@NAME: stm32mp13-disco-mx
#@DESCRIPTION: [STM32CubeMX-EXAMPLE] STM32MP135F-DK board ONLY with Optee boot and SDcard support
#@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 .= ":stm32mpcommonmx:stm32mp13commonmx"
MACHINEOVERRIDES .= ":stm32mp1common:stm32mp13common"

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

# =========================================================================
# boot scheme
# =========================================================================
BOOTSCHEME_LABELS ?= ""

# =========================================================================
# boot device
# =========================================================================
BOOTDEVICE_LABELS ?= ""

# =========================================================================
# Machine settings
# =========================================================================
STM32MP_DEVICETREE = "${CUBEMX_DTB}"

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

# =========================================================================
# Device Storage
# =========================================================================
# Enable the board device storage support with CUBEMX_DTB according to BOOTDEVICE_LABELS
DEVICE_BOARD_ENABLE:SDCARD  += "${@bb.utils.contains('BOOTDEVICE_LABELS', 'sdcard', '${CUBEMX_DTB}', '', d)}"

# =========================================================================
# Flashlayout
# =========================================================================
# Set the FLASHLAYOUT_TYPE_LABELS to CUBEMX_DTB according to BOOTDEVICE_LABELS
FLASHLAYOUT_TYPE_LABELS:sdcard      = "${@bb.utils.contains('BOOTDEVICE_LABELS', 'sdcard', '${CUBEMX_DTB}', '', d)}"

# Specific settings for 'extensible' and 'deleteall' configurations
FLASHLAYOUT_CONFIG_LABELS:deleteall = "cubemx"
FLASHLAYOUT_TYPE_LABELS:deleteall:cubemx = "${CUBEMX_DTB}"
FLASHLAYOUT_TYPE_LABELS:extensible = "${CUBEMX_DTB}"

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


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

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

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

# 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
#   NOTE    'linux-firmware-bluetooth-bcm4343' firmware is specific to BT/WIFI
#           combo used on DISCO boards"
BLUETOOTH_LIST += "linux-firmware-bluetooth-bcm4343"

# Set Wifi related package list needed when 'wifi' feature is enabled
#   NOTE    'linux-firmware-bcm43430' firmware is specific to BT/WIFI combo used
#           on DISCO boards
WIFI_LIST += "linux-firmware-bcm43430"

# CubeMX Project Config
# =========================================================================
# Assign CubeMX Board devicetree and project path name
CUBEMX_DTB = "stm32mp135f-stm32mp135df-comtrol-mx"
CUBEMX_PROJECT = "mx/stm32mp135df-comtrol"

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

# 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"

 

 

@Kevin HUBER @PatrickF @Erwan SZYMANSKI 

0 REPLIES 0