cancel
Showing results for 
Search instead for 
Did you mean: 

Path to custom CubeMX DTS files ignored when building kernel/u-boot/tf-a

AMurr.2282
Associate III

I am getting the following error when trying to build tf-a, u-boot, or the linux kernel (the following is when trying to bitbake tf-a-stm32mp):

make: *** No rule to make target 'fdts/stm32mp153a-raichu-cubemx-mx.dts', needed by 'build-openstlinuxtkrt-stm32mp1-raichu-cubemx/tmp-glibc/work/stm32mp1_raichu_cubemx-ostl-linux-gnueabi/tf-a-stm32mp/2.2.r1-r0/build/trusted/fdts/stm32mp153a-raichu-cubemx-mx.dtb'. Stop.

It seems that the variable CUBEMX_PROJECT is being ignored in my machine conf file, because it is searching in the tf-a source folder for my DTS files. How do I tell yocto to use the DTS files in my layer's "mx" folder?

Here's the directory listing of my layer:

meta-raichu
├── conf
│   ├── layer.conf
│   └── machine
│       └── stm32mp1-raichu-cubemx.conf
├── mx
│   └── raichu-cubemx
│       ├── CA7
│       │   └── DeviceTree
│       │       └── raichu-cubemx
│       │           ├── kernel
│       │           │   └── stm32mp153a-raichu-cubemx-mx.dts
│       │           ├── tf-a
│       │           │   ├── stm32mp153a-raichu-cubemx-mx.dts
│       │           │   └── stm32mp15-mx.dtsi
│       │           └── u-boot
│       │               ├── stm32mp153a-raichu-cubemx-mx.dts
│       │               ├── stm32mp153a-raichu-cubemx-mx-u-boot.dtsi
│       │               ├── stm32mp15-mx.dtsi
│       │               └── stm32mp15-mx.h
└── recipes-tkrt
    └── images
        └── tkrt-image-raichu.bb

Here is my conf/layer.conf file:

# 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-raichu"
BBFILE_PATTERN_meta-raichu = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-raichu = "7"
 
LAYERDEPENDS_meta-raichu = "core"
LAYERSERIES_COMPAT_meta-raichu = "dunfell"

And here is my conf/machine/stm32mp1-raichu-cubemx.conf file:

#@TYPE: Machine
#@NAME: stm32mp1-mx
#@DESCRIPTION: Configuration for STM32CubeMX generated project
#@NEEDED_BSPLAYERS: layers/meta-openembedded/meta-oe layers/meta-openembedded/meta-python
 
###########################################################################
#
# Default machine configuration sections
#
###########################################################################
 
require conf/machine/include/st-machine-common-stm32mp.inc
require conf/machine/include/st-machine-providers-stm32mp.inc
 
# Define specific common machine name
MACHINEOVERRIDES .= ":stm32mpcommonmx"
 
# =========================================================================
# 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
# =========================================================================
# 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"
#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_PROJECT = "mx/STM32MP157C-EV1/my-demo/DeviceTree/my-demo"
CUBEMX_DTB = "stm32mp153a-raichu-cubemx-mx"
CUBEMX_PROJECT = "mx/raichu-cubemx/CA7/DeviceTree/raichu-cubemx/"
 

1 ACCEPTED SOLUTION

Accepted Solutions
AMurr.2282
Associate III

It was a silly mistake. The class wasn't being included because meta-st-stm32mp-addons layer wasn't included in my BBLAYERS variable.

View solution in original post

2 REPLIES 2
Olivier GALLIEN
ST Employee

Hi @AMurr.2282​ 

As a first verification/hint, did you follow recommendation on page https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Distribution_Package

Else can you cross check ?

Thanks

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
AMurr.2282
Associate III

It was a silly mistake. The class wasn't being included because meta-st-stm32mp-addons layer wasn't included in my BBLAYERS variable.