stm32embedded-linuxyoctostm32cubeidecortex-a

STM32MP1 OpenSTLinux - bitbake cross-compilation for custom machine does not generate sdcard.stm32 file


I am trying to deploy the st-image-core image on a custom machine board, following this approach described in the ST wiki. The custom device tree files were generated with the STM32CubeMX tool.

I have already managed to boot my custom machine, using the binaries generated within the DeveloperPackage with the STM32CubeIDE fed with my custom device tree files; the output of the build includes:

Now, I am trying to build the same binaries with the bitbake approach within the DistributionPackage. Unfortunately, when the build is completed, only the tf-a-stm32mp157c-custom-board-mx-usb.stm32 and the tf-a-stm32mp157c-custom-board-mx-uart.stm32 are generated under the arm-trusted-firmware build directory. The binary filetf-a-stm32mp157c-custom-board-mx-sdcard.stm32 is not generated in the build directory.

The recipe for the custom machine custom-board.conf is included within my custom layer meta-custom. The content of the machine recipe custom-board.conf:

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

# =========================================================================
# Chip architecture
# =========================================================================
DEFAULTTUNE = "cortexa7thf-neon-vfpv4"
include conf/machine/include/arm/armv7a/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"
ENABLE_CUBEMX_DTB   = "1"
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"

# 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 += "linux-firmware-bluetooth-bcm4343"

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

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

# Indicate if you like to disable the DVFS which are activated by default
#CUBEMX_SOC_DVFS_OFF = "0"

And the content of 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-custom"
BBFILE_PATTERN_meta-custom = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-custom = "5"

EULA_FILE_ST_custom-board = "${LAYERDIR}/conf/eula/${MACHINE}"
EULA_FILE_ST_MD5SUM_custom-board = "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
CUSTOM_BOARD_BASE = "${LAYERDIR}"

# This should only be incremented on significant changes that may
# cause compatibility issues with other layers
LAYERVERSION_meta-custom = "1"

LAYERDEPENDS_meta-custom = "core 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-custom = "1"
LAYERSERIES_COMPAT_meta-custom = "kirkstone"

Although BOOTDEVICE_LABELS += "sdcard" is specified in the custom-board.conf machine recipe file, the tf-a-stm32mp157c-custom-board-mx-sdcard.stm32 is not being generated (or it is being deleted by something I am not controlling). I am quite sure the custom-board.conf is correctly referenced by the cross-compilation, since the bcm4343 drivers are included in the built kernel (I am using the sdcard.stm32 file from the DeveloperPackage to flash the board via OTG and do the check).

Am I missing something for the generation of the sdcard.stm32?

Any help is greatly appreciated, so thank you for taking the time to read this.

P.S. I asked this on the ST Community Forum, but no answer reached me in 15 days.


Solution

  • The issue was caused by the new naming convention introduced in yocto kirkstone (old suffix separator _ vs new suffix separator :) of the variables in the custom machine conf file. See this answer for further details.