2022-11-08 05:08 AM
Hi experts and community!
(Still on DISTRO_VERSION = "3.1.11-snapshot-20221108")
Following the instructions https://wiki.stmicroelectronics.cn/stm32mpu/wiki/How_to_create_your_own_machine
I tried to create a custom machine.
mx
└── stm32mp1-custom
├── kernel
│ └── stm32mp1-custom.dts
├── optee-os
├── tf-a
│ ├── stm32mp15-ddr-512m-fw-config.dts
│ ├── stm32mp1-custom.dts
│ └── stm32mp1-custom-fw-config.dts
└── u-boot
├── stm32mp1-custom.dts
└── stm32mp1-custom-u-boot.dts
For the first "simple" test, I took the dts files for the stm32mp157f-dk2 board (and not from CubeMX).
The MACHINE configuration looks like this:
#@TYPE: Machine
#@NAME: stm32mp15-custom
#@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 .= ":stm32mpcommonmx:stm32mp15commonmx"
MACHINEOVERRIDES .= ":stm32mp1common:stm32mp15common"
# =========================================================================
# Chip architecture
# =========================================================================
DEFAULTTUNE = "cortexa7thf-neon-vfpv4"
include conf/machine/include/tune-cortexa7.inc
# =========================================================================
# Machine settings
# =========================================================================
STM32MP_DEVICETREE = "${CUBEMX_DTB}"
# =========================================================================
# Machine features (default for stm32mp1 like)
# =========================================================================
MACHINE_FEATURES += "splashscreen"
MACHINE_FEATURES += "watchdog"
MACHINE_FEATURES += "${@'gpu' if d.getVar('ACCEPT_EULA_'+d.getVar('MACHINE')) == '1' else ''}"
MACHINE_FEATURES += "m4copro"
# =========================================================================
# Device Storage
# =========================================================================
# Enable the board device storage support with CUBEMX_DTB according to BOOTDEVICE_LABELS
DEVICE_BOARD_ENABLE_NAND += "${@bb.utils.contains('BOOTDEVICE_LABELS', 'nand-4-256', '${CUBEMX_DTB}', '', d)}"
DEVICE_BOARD_ENABLE_NOR += "${@bb.utils.contains('BOOTDEVICE_LABELS', 'nor-sdcard' , '${CUBEMX_DTB}', '', d)}"
DEVICE_BOARD_ENABLE_EMMC += "${@bb.utils.contains('BOOTDEVICE_LABELS', 'emmc', '${CUBEMX_DTB}', '', d)}"
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_emmc = "${@bb.utils.contains('BOOTDEVICE_LABELS', 'emmc', '${CUBEMX_DTB}', '', d)}"
FLASHLAYOUT_TYPE_LABELS_nand-4-256 = "${@bb.utils.contains('BOOTDEVICE_LABELS', 'nand-4-256', '${CUBEMX_DTB}', '', d)}"
FLASHLAYOUT_TYPE_LABELS_nor-sdcard = "${@bb.utils.contains('BOOTDEVICE_LABELS', 'nor-sdcard' , '${CUBEMX_DTB}', '', d)}"
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 += "trusted"
#BOOTSCHEME_LABELS += "optee"
# Boot Device Choice
# =========================================================================
# Define the boot device supported
BOOTDEVICE_LABELS += "sdcard"
BOOTDEVICE_LABELS += "emmc"
BOOTDEVICE_LABELS += "nand-4-256"
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-my-demo"
CUBEMX_DTB = "stm32mp1-custom"
#CUBEMX_PROJECT = "mx/STM32MP157C-EV1/my-demo/DeviceTree/my-demo"
#CUBEMX_PROJECT = "mx/stm32mp1-custom/DeviceTree/custom"
CUBEMX_PROJECT = "mx/stm32mp1-custom"
# 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"
#CUBEMX_BOARD_DDR_SIZE = "1024"
# Indicate if you like to disable the DVFS which are activated by default
CUBEMX_SOC_DVFS_OFF = "0"
When I now try to build a "Distribution" image most seem to work, but the stm32mp1-custom-trusted.dtb file for tf-a will not be generated.
bitbake core-image-minimal
ERROR: tf-a-stm32mp-v2.4-stm32mp-r2-r0 do_deploy: Missing u-boot-stm32mp1-custom-trusted.dtb file in folder: /home/jenkins/Development/SW_APP/_tmp/openstlinux-5.10-dunfell-mp1-21-11-17/build-openstlinuxweston-stm32mp1-custom/tmp-glibc/deploy/images/stm32mp1-custom/u-boot
ERROR: tf-a-stm32mp-v2.4-stm32mp-r2-r0 do_deploy: Execution of '/home/jenkins/Development/SW_APP/_tmp/openstlinux-5.10-dunfell-mp1-21-11-17/build-openstlinuxweston-stm32mp1-custom/tmp-glibc/work/stm32mp1_custom-ostl-linux-gnueabi/tf-a-stm32mp/v2.4-stm32mp-r2-r0/temp/run.do_deploy.3121445' failed with exit code 1:
WARNING: exit code 1 from a shell command.
ERROR: Logfile of failure stored in: /home/jenkins/Development/SW_APP/_tmp/openstlinux-5.10-dunfell-mp1-21-11-17/build-openstlinuxweston-stm32mp1-custom/tmp-glibc/work/stm32mp1_custom-ostl-linux-gnueabi/tf-a-stm32mp/v2.4-stm32mp-r2-r0/temp/log.do_deploy.3121445
ERROR: Task (/home/jenkins/Development/SW_APP/_tmp/openstlinux-5.10-dunfell-mp1-21-11-17/layers/meta-st/meta-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_2.4.bb:do_deploy) failed with exit code '1'
When I used MACHINE=stm32mp1 before, the according u-boot-stm32mp157*-trusted.dtb files always got generated and the build succeeded.
I assume I am missing steps.
I know there are manual steps for building tf-a-bl2 and bl32 but what I am missing is the documentation for the necessary steps needed for a custom machine in a yocto build environment.
Thank you!
Best regards Gunther
Solved! Go to Solution.
2022-11-09 04:51 AM
Funny! A naming problem
A filter in u-boot-stm32mp.inc hit.
Renaming the devicetree files from stm32mp1-*** to stm32mp15-*** did the trick.
2022-11-09 04:51 AM
Funny! A naming problem
A filter in u-boot-stm32mp.inc hit.
Renaming the devicetree files from stm32mp1-*** to stm32mp15-*** did the trick.