You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

寻求Yocto自定义设备树创建教程及Ka-Ro QS8M-MQ00适配方案

自定义Yocto设备树(无需修改源DTS或补丁)的问题

环境与背景

  • 开发板:Ka-ro qs8m-mq00 qsbase2
  • Yocto版本:mickledore
  • 需求:自定义SPI/I2C引脚,通过继承现有imx8mm-qs8m-mq00.dts创建自定义DTS,不修改源文件或打补丁
  • 当前状态:已创建spitest配方和镜像,但自定义DTS未被编译,即使写入语法错误也无报错输出

当前目录结构

├── COPYING.MIT
├── README
├── conf
│	└── layer.conf
├── readme.md
└── recipes-spitest
    ├── images
    │	└── spitest-image.bb
    └── spitest
        ├── files
        │	├── CMakeLists.txt
        │	├── main.cpp
        │	└── spitest.dts
        └── spitest_1.0.bb

关键文件内容

conf/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 += "spitest"
BBFILE_PATTERN_spitest = "^${LAYERDIR}/"
BBFILE_PRIORITY_spitest = "6"

LAYERDEPENDS_spitest = "core"
LAYERSERIES_COMPAT_spitest = "mickledore"

recipes-spitest/images/spitest-image.bb

SUMMARY = "spitest image"

require ../../meta-karo-distro/recipes-core/images/karo-image-minimal.bb

IMAGE_INSTALL:append = " spitest"

recipes-spitest/spitest/files/spitest.dts

// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
 * Copyright (C) 2019 Lothar Waßmann <LW@KARO-electronics.de>
 *
 */

/dts-v1/;

#include "imx8mm-qs8m-mq00.dts"

/ {
    model = "Ka-Ro electronics QS8M-MQ00 (NXP i.MX8MM) module on QSBASE2 baseboard";

// Some changes
};

recipes-spitest/spitest/spitest_1.0.bb

SUMMARY = "bitbake-layers recipe"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

DESCRIPTION = "This is spitest image."

SRC_URI = "\
    file://CMakeLists.txt \
    file://main.cpp \
    file://spitest.dts \
    "

S = "${WORKDIR}"

KERNEL_DEVICETREE:append = " spitest.dtb"

inherit pkgconfig cmake

do_install() {
    install -d ${D}${bindir}
    install -m 0755 ${B}/spitest ${D}${bindir}/spitest
}

核心问题

  • 在spitest.dts中故意写入语法错误,执行bitbake spitest-image时无任何报错,说明自定义DTS未被编译,也未生成spitest.dtb
  • 希望实现:不使用补丁或修改源DTS文件的前提下,生成包含自定义设备树的镜像

内容的提问来源于stack exchange,提问作者Oleksandr N.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 16:54:59