NEW YOCTO MACHINE - VERDIN 8mm

I’m working on Yocto and my main goal is to create a new image for a new HW based on verdin-imx8mm.

So, I created a new meta-my-toradex/conf/machine/myMachine.conf

MACHINE_NAME = "dina"
MACHINEOVERRIDES =. "verdin-imx8mm:"
require conf/machine/verdin-imx8mm.conf
MACHINE_PREFIX_dina= "verdin-imx8mm"

meta-my-toradex/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 += "meta-my-toradex"
BBFILE_PATTERN_meta-my-toradex = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-my-toradex = "96"

LAYERDEPENDS_meta-my-toradex = " \
    core \
"
LAYERSERIES_COMPAT_meta-my-toradex = "kirkstone"

meta-my-toradex/recipes-kernel/linux/linux-toradex_5.%.bbappend

FILESEXTRAPATHS:prepend := "${THISDIR}/linux-toradex/verdin-imx8mm:"
COMPATIBLE_MACHINE = "verdin-imx8mm"
# Prevent the use of in-tree defconfig
unset KBUILD_DEFCONFIG

SRC_URI +=  " \
	file://defconfig \
	file://0001-arm64-dts-freescale-imx8mm-add-nw29075aa-board.patch \
	"

do_configure:append() {
	# For arm32 bit devices
	# cp ${WORKDIR}/${CUSTOM_DEVICETREE} ${S}/arch/arm/boot/dts
	# For arm64 bit freescale/NXP devices
	# cp ${WORKDIR}/${CUSTOM_DEVICETREE} ${S}/arch/arm64/boot/dts/freescale
}

when I compile:
MACHINE="myMachine" bitbake virtual/kernel

It worked but my git origin is not correct, instead of https://git.toradex.com/linux-toradex.git is https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git.

Do have any ideas?

I tried to follow these instructions:
https://developer.toradex.com/linux-bsp/os-development/build-yocto/custom-meta-layers-recipes-and-images-in-yocto-project-hello-world-examples/#customize-the-kernel

but nothing changes.

Hi @dinetta!

Welcome to Toradex Community! :tada:
Feel free to browse around :smiley:

Which exact BSP version are you using? (you can use repo info to find out)

Although the article you referenced shares some methods to deal with Yocto recipes, it doesn’t outline how a new machine can be created.

To perform such task, the best reference is Yocto’s documentation:

https://docs.yoctoproject.org/4.0.7/dev-manual/common-tasks.html#adding-a-new-machine

To check what might be going wrong, you can use some approaches:

  • Use bitbake -e <recipe> to check the contents of the variables that affect the building.
  • Use bitbake-layers to check which layers are being used
  • Check your local.conf
    • There are some variables defined that depends on the MACHINE. (I think this is having a big impact)

Also, I would like to ask if you really need to create your own machine. You will need to perform its maintenance by yourself, which is quite some work.

Wouldn’t it be easier if you just use Toradex’s machines plus some extra customization that you can apply on top of it?

This way, your maintenance would be easier, don’t your think?

Best regards,

Hi Henrique,

thanks for the answer, the problem was my local.conf, my machine was not included on:

MACHINES_DOWNSTREAM_DISTRO_DEFAULT

I probably need to explain what I exactly I need, because I have others issues with the new machine and as you suggested I think is not necessary a new machine.

  1. when my verdin-imx8 starts up, it loads by default “imx8mm-verdin-nonwifi-deb.dtdb”, but I need to load my own device tree

  2. I need add others overlays, because I have multiple displays and I’d just like to replace the contents of /boot/overlay.txt withe the necessary overlay.

  3. I’d like to have a default content for /boot/overlay.txt , not at it is now:
    verdin-imx8mm_dsi-to-hdmi_overlay.dtbo verdin-imx8mm_spidev_overlay.dtbo

  4. I’d like only to enable a module on the defconfig for the verdin-im8mm, for example:
    CONFIG_TOUCHSCREEN_ILI210X=m, is it possible?

Hi @dinetta !

Thanks for sharing more details about what you are trying to accomplish. Doing so makes the information exchange a lot easier :smiley:

To most of your questions, I believe this page will help you: Custom meta layers, recipes and images in Yocto Project (hello-world examples) | Toradex Developer Center.

As for the device tree overlay part, you can refer to Device Tree Overlays (Linux) | Toradex Developer Center. Here we don’t have an explicit step-by-step with example. But reading it will surely help you.

There are many things for you to read and try out :sweat_smile:, but I believe it will help accelerate your development.

If after reading you need further help with the device tree overlay part, please create a new thread, as this one is about “New Yocto Machine” :slight_smile:

Let us know how it goes!

Best regards,