我有一个STM32MP1 SBC,我正在与yocto项目一起使用它。STM提供了Cubemx工具,用于生成设备树等。我已经按照本文中的说明进行了操作,但无法编译设备树。。https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Distribution_Package
我的layer.conf是这样的。。
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "meta-my-demo-layer"
BBFILE_PATTERN_meta-my-demo-layer = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-my-demo-layer = "6"
EULA_FILE_ST_stm32mpmydemo = "${LAYERDIR}/conf/eula/${MACHINE}"
EULA_FILE_ST_MD5SUM_stm32mpmydemo = "8b505090fb679839cefbcc784afe8ce9"
#Inform bitbake for adding another location to search for licenses
LICENSE_PATH += "${LAYERDIR}/files/licenses"
# Set a variable to get the STM32MP MX BSP location
STM32MP_MY_DEMO_BASE = "${LAYERDIR}"
# This should only be incremented on significant changes that may
# cause compatibility issues with other layers
LAYERVERSION_meta-my-demo-layer = "1"
LAYERDEPENDS_meta-my-demo-layer = "stm-st-stm32mp-mx"
# OpenEmbedded compatibility information
# This should only be incremented on significant changes that will
# cause compatibility issues with other layers
LAYERVERSION_meta-my-demo-layer = "1"
LAYERDEPENDS_meta-my-demo-layer = "core"
LAYERSERIES_COMPAT_meta-my-demo-layer = "dunfell"
我的机器文件是这样的。。
#@TYPE: Machine
#@NAME: stm32mp1-mx
#@DESCRIPTION: Configuration for STM32CubeMX generated project
#@NEEDED_BSPLAYERS: layers/meta-openembedded/meta-oe layers/meta-openembedded/meta-python layers/meta-st/meta-st-stm32mp-addons
###########################################################################
#
# 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 .= ":stm32mpmydemo"
# =========================================================================
# 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 += "wifi"
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_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
# =========================================================================
# Set specific subdir path by components for each device tree file location
# within CUBEMX_PROJECT project folder
CUBEMX_DTB_PATH_TFA = "tf-a"
CUBEMX_DTB_PATH_TFA_SB = "tf-a"
CUBEMX_DTB_PATH_UBOOT = "u-boot"
CUBEMX_DTB_PATH_LINUX = "kernel"
CUBEMX_DTB_PATH_OPTEEOS = "optee-os"
###########################################################################
#
# User machine customization sections
#
###########################################################################
# Boot Scheme
# =========================================================================
BOOTSCHEME_LABELS += "trusted"
#BOOTSCHEME_LABELS += "optee"
# WORKAROUND to generate U-BOOT SPL for DDR Tuning tools usage
UBOOT_CONFIG += "basic"
# 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"
# 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 += "linux-firmware-bcm43430"
# CubeMX Project Config
# =========================================================================
# Assign CubeMX Board devicetree and project path name
CUBEMX_DTB = "stm32mp153c-my_stm-mx"
CUBEMX_PROJECT = "mx/MY_STM/CA7/DeviceTree/MY_STM"
但最终所有的包tf-a、内核、u-boot都无法编译,并且出现了一些错误。。。
ERROR: tf-a-stm32mp-2.2.r1-r0 do_compile: oe_runmake failed
ERROR: tf-a-stm32mp-2.2.r1-r0 do_compile: Execution of '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/temp/run.do_compile.6449' failed with exit code 1:
make: Entering directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
Including bl32/sp_min/sp_min.mk
HOSTCC stm32image.c
make: *** No rule to make target 'fdts/stm32mp153c-my_stm-mx.dts', needed by '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/build/trusted/fdts/stm32mp153c-my_stm-mx.dtb'. Stop.
make: *** Waiting for unfinished jobs....
HOSTLD stm32image
Built stm32image successfully
make: Leaving directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
WARNING: exit code 1 from a shell command.
ERROR: Logfile of failure stored in: /home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/temp/log.do_compile.6449
Log data follows:
| DEBUG: Executing python function tfaconfig_env
| DEBUG: Python function tfaconfig_env finished
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4 CROSS_COMPILE=arm-ostl-linux-gnueabi- DEBUG=1 LOG_LEVEL=40 PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 STM32MP_SDMMC=1 STM32MP_EMMC=1 STM32MP_SPI_NOR=1 STM32MP_RAW_NAND=1 STM32MP_SPI_NAND=1 -C /home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/git DTB_FILE_NAME=stm32mp153c-my_stm-mx.dtb BUILD_PLAT=/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/build/trusted AARCH32_SP=sp_min
| make: Entering directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
| Including bl32/sp_min/sp_min.mk
| HOSTCC stm32image.c
| make: *** No rule to make target 'fdts/stm32mp153c-my_stm-mx.dts', needed by '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/build/trusted/fdts/stm32mp153c-my_stm-mx.dtb'. Stop.
| make: *** Waiting for unfinished jobs....
| HOSTLD stm32image
|
| Built stm32image successfully
|
| make: Leaving directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/temp/run.do_compile.6449' failed with exit code 1:
| make: Entering directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
| Including bl32/sp_min/sp_min.mk
| HOSTCC stm32image.c
| make: *** No rule to make target 'fdts/stm32mp153c-my_stm-mx.dts', needed by '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work/stm32mp1_demo-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/build/trusted/fdts/stm32mp153c-my_stm-mx.dtb'. Stop.
| make: *** Waiting for unfinished jobs....
| HOSTLD stm32image
|
| Built stm32image successfully
|
| make: Leaving directory '/home/user/build-openstlinux-weston/tmp-openstlinux_weston-glibc/work-shared/stm32mp1-demo/tfa-source'
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/home/user/layers/meta-st/meta-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_2.2.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 720 tasks of which 650 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 2 seconds
我知道这是一篇旧帖子,但我也遇到了同样的问题,这个解决方案可以帮助未来的用户:
首先,您需要在如何在STM32CubeIDE中管理OpenSTLinux项目(您需要在linux机器上(
然后简单地从STM32CubeIDE运行CA7项目或手动将生成的.dtb复制到"/boot/stm32mp157a-dk1.dtb";(设置正确的卡名(