cancel
Showing results for 
Search instead for 
Did you mean: 

migrating from krikstone to mickledore unable to flash via DFU panic halt

iheb
Associate III

Dear STM comunity, 
i am currently trying migrate my solution from the kirkstone to  mickledore because it offers more software functions that i need and cant properly use on the kirkstone, 

i have spent alot of time trying to port the configurations from OSD32MP1F to mickledore via cube mx, here are the device tree, there are alot of differences between versions but overall nothing too diffrent, i managed to compile the image and started flashing , however i don't know what are the issues but i am not able to flash the image due to a panic error leading to flashing halt as shown in the LOG 1 and LOG2 

 

USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN          : 004400453230510532393433
DFU protocol: 1.1
Board       : --
Device ID   : 0x0500
Device name : 
Device type : MPU
Device CPU  : Cortex-A7
Start operation done successfully at partition 0x03


Memory Programming ...
Opening and parsing file: tf-a-stm32mp157c-osd32-mx-usb.stm32
  File          : tf-a-stm32mp157c-osd32-mx-usb.stm32
  Size          : 220,41 KB 
  Partition ID  : 0x01 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:01.646

RUNNING Program ... 
  PartID:      :0x01 
Start operation done successfully at partition 0x01


Memory Programming ...
Opening and parsing file: fip-stm32mp157c-osd32-mx-optee-sdcard.bin
  File          : fip-stm32mp157c-osd32-mx-optee-sdcard.bin
  Size          : 1,39 MB 
  Partition ID  : 0x03 

Download in Progress:
[==================================================] 100% 

File download complete
Time elapsed during download operation: 00:00:01.673

RUNNING Program ... 
  PartID:      :0x03 

Reconnecting the device ...

 

 LOG 1 : DFU flashing sequance 

 

the LOG 1 show the flashing halted and asking to connect after further inspection on the UART communication as shown on LOG2

 

NOTICE:  CPU: STM32MP157F?? Rev.Z
NOTICE:  Model: STMicroelectronics custom STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mpu-v24.06.26
INFO:    PMIC version = 0x21
INFO:    Reset reason (0x214):
INFO:      IWDG2 Reset (rst_iwdg2)
INFO:    FCONF: Reading TB_FW firmware configuration file from: 0x2ffe2000
INFO:    FCONF: Reading firmware configuration information for: stm32mp_io
INFO:    FCONF: Reading firmware configuration information for: stm32mp_fuse
INFO:    Using USB
INFO:      Instance 2
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 400000kHz
INFO:    Memory size = 0x20000000 (512 MB)
INFO:    DFU USB START...
INFO:    phase ID :3, Manifestation 3 at c716499a
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 0x2ffff000
INFO:    Image id=1 loaded: 0x2ffff000 - 0x2ffff1ea
INFO:    FCONF: Reading FW_CONFIG firmware configuration file from: 0x2ffff000
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 - 0xde02ee08
INFO:    BL2: Skip loading image id 9
INFO:    BL2: Loading image id 2
INFO:    Loading image id=2 at address 0xc0500000
INFO:    Image id=2 loaded: 0xc0500000 - 0xc0520bd0
INFO:    BL2: Skip loading image id 16
INFO:    BL2: Loading image id 5
INFO:    Loading image id=5 at address 0xc0100000
INFO:    Image id=5 loaded: 0xc0100000 - 0xc0214c94
NOTICE:  BL2: Booting BL32
INFO:    Entry point address = 0xde000000
INFO:    SPSR = 0x1d3
I/TC: Early console on UART#4
I/TC: 
I/TC: Embedded DTB found
I/TC: OP-TEE version: 3.19.0-dev (gcc version 12.3.0 (GCC)) #1 Fri Oct 14 19:00:05 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 Panic

 

LOG2 : Print of uart 4 connected via serial coomunication using cutecom during flashing 
as seen in LOG2 there is a panic during the flashing process, i was trying to blindly modfiy the device tree on the optee half and tfa while following the examples on the EV1 DT board and while adding my rcc and source code from the Cubemx generated code but no luck. i dont know why its paniking , i can not use GDB to further debug. 
here is my board config text as seen in scrc1 and src2 . 

 

 

#@TYPE: Machine
#@NAME: stm32mp15-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:stm32mp15common"
MACHINEOVERRIDES .= ":stm32mpcommonmx:stm32mp15commonmx"

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

# =========================================================================
# boot scheme
# =========================================================================
BOOTSCHEME_LABELS += "optee"
#BOOTSCHEME_LABELS += "fastboot"
# Default optee profile use by all soc, (if exception see if there is a specific
# profile for a soc)
ST_OPTEE_PROFILE ?= "secure_and_system_services"
# For stm32mp15 force "system_services"
ST_OPTEE_PROFILE:stm32mp15 ?= "system_services"

# =========================================================================
# boot device
# =========================================================================
BOOTDEVICE_LABELS += "sdcard"

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

# =========================================================================
# Machine features (default for stm32mp1 like)
# =========================================================================
MACHINE_FEATURES += "splashscreen"
MACHINE_FEATURES += "watchdog"
MACHINE_FEATURES += "bluetooth"
MACHINE_FEATURES += "wifi"
MACHINE_FEATURES += "${@'gpu' if d.getVar('ACCEPT_EULA_'+d.getVar('MACHINE')) == '1' else ''}"
MACHINE_FEATURES += "m4copro"
MACHINE_FEATURES += "usbg0"

# Bluetooth
BLUETOOTH_LIST += "linux-firmware-bluetooth-bcm4343"
# Wifi
WIFI_LIST += "linux-firmware-bcm43430"

# =========================================================================
# Flashlayout
# =========================================================================
# Set the FLASHLAYOUT_TYPE_LABELS for 'extensible' to CUBEMX_DTB
FLASHLAYOUT_TYPE_LABELS:extensible = "${CUBEMX_DTB}"
# =========================================================================
# U-Boot configuration
# =========================================================================
#UBOOT_CONFIG = "stm32mp157c-osd32mp157c-512m-baa_minimalconfig-mx_defconfig,,${BINARY_NAME}"
#UBOOT_CONFIG[optee] = "osd32mp1_brk_trusted_defconfig,,${BINARY_NAME}"
#UBOOT_DEVICETREE[optee]= "stm32mp157c-osd32mp1-brk"
# U-Boot config
#UBOOT_CONFIG = "viper_butcombe_beta"
#UBOOT_CONFIG[viper_butcombe_beta] = "viper-innovations_butcombe-beta_defconfig,,u-boot.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
#
###########################################################################
LINUX_A7_EXAMPLES_DT += "stm32mp157c-dk2-a7-examples"
CUBE_M4_EXAMPLES_DT += "stm32mp157c-dk2-m4-examples"
M4_BOARDS = "STM32MP157C-EV1"
# Boot Scheme
# =========================================================================
#BOOTSCHEME_LABELS += "optee"

# Boot Device Choice
# =========================================================================
# Define the boot device supported
#BOOTDEVICE_LABELS += "sdcard"
#BOOTDEVICE_LABELS += "emmc"
#BOOTDEVICE_LABELS += "nand-4-256-1024"
#BOOTDEVICE_LABELS += "nor-sdcard"

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

# 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 = "stm32mp157c-osd32-mx"
CUBEMX_PROJECT = "mx/stm32mp157c-osd32/"

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

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

#------------------------ 

# =========================================================================
# WIC for sdcard raw image
# =========================================================================
WIC_CREATE_EXTRA_ARGS = "--no-fstab-update"
WKS_FILE_DEPENDS ?= " \
    virtual/bootloader \
    virtual/trusted-firmware-a \
    ${@bb.utils.contains('BOOTSCHEME_LABELS', 'optee', 'virtual/optee-os', '', d)} \
    st-image-bootfs \
    ${@bb.utils.contains('ST_VENDORFS','1','st-image-vendorfs', '', d)} \
    st-image-userfs \
"
OPTEE_WIC_FILE = "${@bb.utils.contains('ST_VENDORFS','1','sdcard-stm32mp157f-ev1-optee-vendorfs-1GB.wks.in','sdcard-stm32mp157f-ev1-optee-1GB.wks.in',d)}"

# for generated a WIC file, please uncomment the 2 following lines or add them to local.conf
#WKS_IMAGE_FSTYPES += "wic wic.bz2 wic.bmap"
#WKS_FILE += "${OPTEE_WIC_FILE}"

# ---------------------------------
#  Usage of FIT Image signed
# ---------------------------------
# Need to have MACHINE_FEATURES += "fit"
# Need to uncomment the follwing variable
# NOTE: you can specify another directlry to keep same key at each new compilation (UBOOT_SIGN_KEYDIR)

# keys name in keydir (eg. "ubootfit.crt", "ubootfit.key")
#UBOOT_SIGN_KEYNAME = "ubootfit"
#UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"
#UBOOT_SIGN_ENABLE = "1"
#UBOOT_SIGN_KEYDIR = "${DEPLOY_DIR_IMAGE}"

#FIT_GENERATE_KEYS = "1"
EXTRA_OEMAKE += "CFG_TEE_CORE_LOG_LEVEL=4"

 

SRC1 : costum machine config
SRC1 showes the costum machine config to generate the right image for the osd32mp1-brk board

 

# Provides CubeMX device tree file management:
# User can configure recipe file so that extra device tree files provided by
# CubeMX can be integrated in original source code (and so get compiled)

# Configure generation of device tree binary with CubeMX output files
ENABLE_CUBEMX_DTB ??= "1"

# CubeMX device tree file name
CUBEMX_DTB ??= "stm32mp157c-osd32-mx"
# Path to CubeMX project generated device tree files
CUBEMX_PROJECT ??= "mx/stm32mp157c-osd32"

# Internal class variable to manage CubeMX file location:
#   CUBEMX_PROJECT_ABS
#       Absolute path to CubeMX project generated device tree files, initialized
#       thanks to BBPATH
CUBEMX_PROJECT_ABS = "mx/stm32mp157c-osd32"

# M33 co-processor is used with Trustzone enabled or not
CUBEMX_M33_TZ ??= "1"

# internal, for M33_TZ, we need to update the dependency variable
M33PROJECT_TF_M_TRUSTZONE = "${CUBEMX_M33_TZ}"

# CubeMX use external_dt class
inherit external-dt

EXTERNAL_DT_ENABLED:stm32mpcommonmx = "${@bb.utils.contains('ENABLE_CUBEMX_DTB', '1', '1', '0', d)}"

STAGING_EXTDT_DIR:stm32mpcommonmx = "${CUBEMX_PROJECT_ABS}"

EXTDT_DIR_TF_A:stm32mpcommonmx  = "tf-a"
EXTDT_DIR_UBOOT:stm32mpcommonmx = "u-boot"
EXTDT_DIR_TF_M:stm32mpcommonmx  = "tf-m"
EXTDT_DIR_OPTEE:stm32mpcommonmx = "optee-os"
EXTDT_DIR_LINUX:stm32mpcommonmx = "kernel"

# Do not force make file generation on recipe side when file already available
CUBEMX_EXTDT_FORCE_MK ??= "1"

def cubemx_search(dirs, d):
    search_path = d.getVar("BBPATH").split(":")
    for dir in dirs.split():
        for p in search_path:
            dir_path = os.path.join(p, dir)
            if os.path.isdir(dir_path):
                return (True, dir_path)
    return (False, "")

python __anonymous() {
    if d.getVar('ENABLE_CUBEMX_DTB') == "0":
        return

    # Check that user has configured CubeMX machine properly
    cubemx_project = d.getVar('CUBEMX_PROJECT')
    if cubemx_project == "":
        raise bb.parse.SkipRecipe('\n[cubemx-stm32mp] CUBEMX_PROJECT var is empty. Please initalize it on your %s CubeMX machine configuration.\n' % d.getVar("MACHINE"))
    cubemx_dtb = d.getVar('CUBEMX_DTB')
    if cubemx_dtb == "":
        raise bb.parse.SkipRecipe('\n[cubemx-stm32mp] CUBEMX_DTB var is empty. Please initalize it on your %s CubeMX machine configuration.\n' % d.getVar("MACHINE"))

    # Set CUBEMX_PROJECT_ABS according to CubeMX machine configuration
    found, cubemx_project_dir = cubemx_search(cubemx_project, d)
    if found:
        bb.debug(1, "Set CUBEMX_PROJECT_ABS to '%s' path." % cubemx_project_dir)
        d.setVar('CUBEMX_PROJECT_ABS', cubemx_project_dir)
    else:
        bbpaths = d.getVar('BBPATH').replace(':','\n\t')
        bb.fatal('\n[cubemx-stm32mp] Not able to find "%s" path from current BBPATH var:\n\t%s.' % (cubemx_project, bbpaths))

    # Append function to check before 'do_compile' that device tree file is available
    d.prependVarFlag('do_compile', 'prefuncs', "check_cubemx_extdt ")

    # Make sure to init CONFIGURE_FILES with proper STAGING_EXTDT_DIR
    for extdt_conf in d.getVar('EXTDT_DIR_CONFIG').split():
        provider = extdt_conf.split(':')[0]
        sub_path = extdt_conf.split(':')[1]
        if provider in d.getVar('PROVIDES').split():
            extdt_dir = os.path.join(d.getVar('STAGING_EXTDT_DIR'), sub_path)
            extdt_src_configure(d, extdt_dir)
            break
}

python check_cubemx_extdt() {
    for extdt_conf in d.getVar('EXTDT_DIR_CONFIG').split():
        provider = extdt_conf.split(':')[0]
        sub_path = extdt_conf.split(':')[1]
        if provider in d.getVar('PROVIDES').split():
            cubemx_dts_file = os.path.join(d.getVar('STAGING_EXTDT_DIR'), sub_path, d.getVar('CUBEMX_DTB') + '.dts')
            if os.path.exists(cubemx_dts_file):
                break
            else:
                bb.fatal('File %s not found: compilation aborted for %s device tree.' % (cubemx_dts_file, d.getVar('BPN')))
}

 

SRC2: cubemx-stm32mp .bbclass configuration 
could you please dear ST comunity help me figure this thing out i am really out of leads , i don't know if i need to share the device treers ? or maybe help me get the location where there is an issue

Thank you 

0 REPLIES 0