Yocto Project Zephyr Build

Yocto Project Zephyr Build

This page describes the Yocto Project Zephyr Build Architecture for MicroBlaze-V (MicroBlaze RISC-V), Cortex-A and Cortex-R processors on how to configure and build Zephyr RTOS applications using Yocto Project. This flow primarily uses SDT, Lopper and gen-machineconf tools to parse an xsa and transform them to a zephyr board source files.

Introduction

The Yocto Project can build for a variety of targets: Linux, Zephyr, baremetal, etc. Using multiconfig one can target a combination of these environments in one single configured build. Zephyr is a real-time operating system (RTOS) that is open source and hosted by the Linux Foundation. It’s an collaborative effort uniting developers and users in building a best-in-class small, scalable, real-time operating system (RTOS) optimized for resource-constrained devices, across multiple architectures. For more details see Zephyr Getting Started Guide

Yocto Zephyr Build Workflows

Yocto Zephyr Build Architecture


YP-Zephyr-Build-Flow.png

Lopper Transformation

This section describes how to transform SDT output files to an operating environment standard device-tree. Lopper tool is used to prunes a system device tree to an Zephyr operating environment standard device-tree. Lopper Transformation can be done in 2 ways.

Manual Transformation

  • Run the lopper commands manually to transform SDT to standard operating specific environment dt files.

    • Clone lopper repo:

      $ git clone https://github.com/Xilinx/lopper -b <version_branch> $ export LOPPER_REPO_PATH=$PWD/lopper $ export LOPPER_DTC_FLAGS="-b 0 -@"
    • VERSAL-2VE-2VM Cortex-A78 Processor (Example: VEK385 Cortex-A78 Core1)

      $ mkdir -p lopper-outputs/vek385-cortexa78-1/ $ export SDT_VEK385_OUTPUT_DIR=<path-to>/versal-2ve-2vm-vek385-sdt-seg/ $ export LOPPER_VEK385_OUTPUT_DIR=$PWD/lopper-outputs/vek385-cortexa78-1/ $ export CONFIG_DTFILE=versal2_apu.dts $ ${LOPPER_REPO_PATH}/lopper.py -f --enhanced -O ${LOPPER_VEK385_OUTPUT_DIR} ${SDT_VEK385_OUTPUT_DIR}/system-top.dts system-domain.dts -- gen_domain_dts cortexa78_1 $ ls -la ${LOPPER_VEK385_OUTPUT_DIR} total 232 drwxr-xr-x 2 santraju boulder 4096 Aug 22 17:13 . drwxr-xr-x 7 santraju boulder 4096 Aug 22 16:36 .. -rw-r--r-- 1 santraju boulder 227402 Aug 22 17:13 system-domain.dts $ $ ${LOPPER_REPO_PATH}/lopper.py -f --enhanced -O ${LOPPER_VEK385_OUTPUT_DIR} -i ${LOPPER_REPO_PATH}/lopper/lops/lop-a78-imux.dts ${LOPPER_VEK385_OUTPUT_DIR}/system-domain.dts system-imux.dts $ ls -la ${LOPPER_VEK385_OUTPUT_DIR} total 452 drwxr-xr-x 2 santraju boulder 4096 Aug 22 17:13 . drwxr-xr-x 7 santraju boulder 4096 Aug 22 16:36 .. -rw-r--r-- 1 santraju boulder 227402 Aug 22 17:13 system-domain.dts -rw-r--r-- 1 santraju boulder 222828 Aug 22 17:13 system-imux.dts $ $ ${LOPPER_REPO_PATH}/lopper.py -f --enhanced -O ${LOPPER_VEK385_OUTPUT_DIR} ${LOPPER_VEK385_OUTPUT_DIR}/system-imux.dts ${CONFIG_DTFILE} -- gen_domain_dts cortexa78_1 zephyr_dt $ ls -la ${LOPPER_VEK385_OUTPUT_DIR} total 404 drwxr-xr-x 2 santraju boulder 4096 Aug 11 18:33 . drwxr-xr-x 7 santraju boulder 4096 Aug 22 16:36 .. -rw-r--r-- 1 santraju boulder 191943 Aug 11 15:40 system-domain.dts -rw-r--r-- 1 santraju boulder 187968 Aug 11 15:40 system-imux.dts -rw-r--r-- 1 santraju boulder 21079 Aug 11 15:44 versal2_rpu.dts $
    • VERSAL-2VE-2VM Cortex-R52 Processor (Example: VEK385 Cortex-R52 Core0)

      $ mkdir -p lopper-outputs/vek385-cortexr52-0/ $ export SDT_VEK385_OUTPUT_DIR=<path-to>/versal-2ve-2vm-vek385-sdt-seg/ $ export LOPPER_VEK385_OUTPUT_DIR=$PWD/lopper-outputs/vek385-cortexr52-0/ $ export CONFIG_DTFILE=versal2_rpu.dts $ ${LOPPER_REPO_PATH}/lopper.py -f --enhanced -O ${LOPPER_VEK385_OUTPUT_DIR} ${SDT_VEK385_OUTPUT_DIR}/system-top.dts system-domain.dts -- gen_domain_dts cortexr52_0 $ ls -la ${LOPPER_VEK385_OUTPUT_DIR} total 176 drwxr-xr-x 2 santraju boulder 4096 Jun 17 15:07 . drwxr-xr-x 4 santraju boulder 4096 Jun 9 13:53 .. -rw-r--r-- 1 santraju boulder 171372 Jun 17 15:07 system-domain.dts $ $ ${LOPPER_REPO_PATH}/lopper.py -f --enhanced -O ${LOPPER_VEK385_OUTPUT_DIR} -i ${LOPPER_REPO_PATH}/lopper/lops/lop-r52-imux.dts ${LOPPER_VEK385_OUTPUT_DIR}/system-domain.dts system-imux.dts $ ls -la ${LOPPER_VEK385_OUTPUT_DIR} total 340 drwxr-xr-x 2 santraju boulder 4096 Jun 17 15:07 . drwxr-xr-x 4 santraju boulder 4096 Jun 9 13:53 .. -rw-r--r-- 1 santraju boulder 171372 Jun 17 15:07 system-domain.dts -rw-r--r-- 1 santraju boulder 167642 Jun 17 15:07 system-imux.dts $ $ ${LOPPER_REPO_PATH}/lopper.py -f --enhanced -O ${LOPPER_VEK385_OUTPUT_DIR} ${LOPPER_VEK385_OUTPUT_DIR}/system-imux.dts ${CONFIG_DTFILE} -- gen_domain_dts cortexr52_0 zephyr_dt $ ls -la ${LOPPER_VEK385_OUTPUT_DIR} total 348 drwxr-xr-x 2 santraju boulder 4096 Jun 17 15:08 . drwxr-xr-x 4 santraju boulder 4096 Jun 9 13:53 .. -rw-r--r-- 1 santraju boulder 171372 Jun 17 15:07 system-domain.dts -rw-r--r-- 1 santraju boulder 167642 Jun 17 15:07 system-imux.dts -rw-r--r-- 1 santraju boulder 6911 Jun 17 15:08 versal2_rpu.dts $
    • KCU105 MB-V:

      $ mkdir -p lopper-outputs/mb-v-kcu105/ $ export SDT_KCU105_OUTPUT_DIR=<path-to>/mb-v-kcu105-sdt $ export LOPPER_KCU105_OUTPUT_DIR=$PWD/lopper-outputs/mb-v-kcu105/ $ export CONFIG_DTFILE=mbv32.dts $ ${LOPPER_REPO_PATH}/lopper.py -f --enhanced -O ${LOPPER_KCU105_OUTPUT_DIR} -i ${LOPPER_REPO_PATH}/lopper/lops/lop-microblaze-riscv.dts ${SDT_KCU105_OUTPUT_DIR}/system-top.dts system-domain.dts -- gen_domain_dts microblaze_riscv_0 {'__dbg__': 0, '__modified__': False, '__pstate__': 'resolved', 'abs_path': '/cpus_microblaze_riscv@0/cpu@0/xlnx,data-size', 'binary': False, 'name': 'xlnx,data-size', 'node': <lopper.tree.LopperNode object at 0x7fbdb0fcf040>, 'number': -1, 'pclass': <class 'list'>, 'phandle_resolution': True, 'ptype': <LopperFmt.UINT32: 8>, 'string_val': 'xlnx,data-size = <0x20>;', 'value': [32]} $ ls -la ${LOPPER_KCU105_OUTPUT_DIR} total 40 drwxr-xr-x 2 santraju boulder 4096 Jun 17 15:29 . drwxr-xr-x 4 santraju boulder 4096 Jun 9 13:53 .. -rw-r--r-- 1 santraju boulder 28984 Jun 17 15:29 system-domain.dts $ #### START - For 2025.1 Release only #### $ cat cflags.yaml cflags: -march=rv32imac_zicsr_zifencei_zicbom -mabi=ilp32 libpath: riscv64-unknown-elf/riscv32-xilinx-elf/usr/lib/rv32imac/ilp32/ linkflags: -march=rv32imac $ $ mv cflags.yaml ${LOPPER_KCU105_OUTPUT_DIR} #### END - For 2025.1 Release only #### $ ls -la ${LOPPER_KCU105_OUTPUT_DIR} total 44 drwxr-xr-x 2 santraju boulder 4096 Jun 17 15:30 . drwxr-xr-x 4 santraju boulder 4096 Jun 9 13:53 .. -rw-r--r-- 1 santraju boulder 157 Jun 17 15:29 cflags.yaml -rw-r--r-- 1 santraju boulder 28984 Jun 17 15:29 system-domain.dts $ $ ${LOPPER_REPO_PATH}/lopper.py -f --enhanced -O ${LOPPER_KCU105_OUTPUT_DIR} -i ${LOPPER_REPO_PATH}/lopper/lops/lop-microblaze-riscv.dts ${LOPPER_KCU105_OUTPUT_DIR}/system-domain.dts system-zephyr.dts -- gen_domain_dts microblaze_riscv_0 zephyr_dt WARNING: Zephyr does not support fast interrupts; they will be handled as standard interrupts. Therefore, enabling FAST interrupts in the AXI INTC core will not improve interrupt latency. Additionally, fast interrupts are not supported in QEMU. $ ls -la ${LOPPER_KCU105_OUTPUT_DIR} total 60 drwxr-xr-x 2 santraju boulder 4096 Jun 17 15:31 . drwxr-xr-x 4 santraju boulder 4096 Jun 9 13:53 .. -rw-r--r-- 1 santraju boulder 157 Jun 17 15:29 cflags.yaml -rw-r--r-- 1 santraju boulder 1099 Jun 17 15:31 Kconfig -rw-r--r-- 1 santraju boulder 328 Jun 17 15:31 Kconfig.defconfig -rw-r--r-- 1 santraju boulder 28984 Jun 17 15:29 system-domain.dts -rw-r--r-- 1 santraju boulder 7742 Jun 17 15:31 system-zephyr.dts $ $ ${LOPPER_REPO_PATH}/lopper.py -f --enhanced -O ${LOPPER_KCU105_OUTPUT_DIR} -i ${LOPPER_REPO_PATH}/lopper/lops/lop-mbv-zephyr-intc.dts ${LOPPER_KCU105_OUTPUT_DIR}/system-zephyr.dts mbv32.dts $ ls -la ${LOPPER_KCU105_OUTPUT_DIR} total 68 drwxr-xr-x 2 santraju boulder 4096 Jun 17 15:32 . drwxr-xr-x 4 santraju boulder 4096 Jun 9 13:53 .. -rw-r--r-- 1 santraju boulder 157 Jun 17 15:29 cflags.yaml -rw-r--r-- 1 santraju boulder 1099 Jun 17 15:31 Kconfig -rw-r--r-- 1 santraju boulder 328 Jun 17 15:31 Kconfig.defconfig -rw-r--r-- 1 santraju boulder 7210 Jun 17 15:32 mbv32.dts -rw-r--r-- 1 santraju boulder 28984 Jun 17 15:29 system-domain.dts -rw-r--r-- 1 santraju boulder 7742 Jun 17 15:31 system-zephyr.dts $

Gen-Machine-Conf

  • Gen-Machine-Conf is an automated flow used by Yocto Project to transform SDT to standard operating specific environment generated dt, machine and multiconfig files.

Yocto AMD Zephyr meta-layers

In order to build AMD Zephyr using Yocto we need the following layers.

  1. meta-zephyr

    1. meta-zephyr-core

      1. Core layer provides meta data information for the following.

        1. zephyr, zephyr-sample and zephyr-qemu bbclass

        2. qemu zephyr wrapper scripts

        3. zephyr-kernel source recipes

        4. zephyr-<apps> recipes

        5. zephyr-sdk generation recipes

    2. meta-zephyr-bsp

      1. Core layer provides meta data for pre-defined machine files for different SoC’s, Community Boards, Vendor Boards and QEMU emulation platform.

  2. meta-amd-zephyr

    1. amd-zephyr-sdt bbclass

      1. This class will use lopper transformed files such as <board>.dts, Kconfig and Kconfig.defconfig file path is set in machine/multiconfig files are copied and replace with <zephyr-repo>/boards/amd/<boards>/<board>.dts , <zephyr-repo>/soc/xlnx/<arch>/Kconfig and <zephy-repo>/soc/xlnx/<arch>/Kconfig.defconfig file during bitbake do_configure tasks.

    2. zephyr-kernel and apps bbappends to build demo application using AMD Zephyr.

Sample Yocto AMD Zephyr Machine file

VEK385 Cortex-A78 Core 1

  • Machine file:

    # conf/machine/versal-2ve-2vm-apu.conf #@TYPE: Machine #@NAME: versal-2ve-2vm-apu #@DESCRIPTION: Machine for stock Zephyr BOARD versal2_apu # Include tune-cortexa72-cortexa53.inc require conf/machine/include/arm/armv8a/tune-cortexa72-cortexa53.inc # This machine file is demostrate building stock zephyr amd versal2_apu board using # meta-amd-zephyr layer. DEFAULTTUNE = "cortexa72-cortexa53" DISTRO = "amd-zephyr" TMPDIR = "${TOPDIR}/tmp-versal-2ve-2vm-apu" # Zephyr RTOS settings ZEPHYR_BOARD = "versal2_apu" ARCH:versal-2ve-2vm-apu = "arm"
  • Multiconfig Machine file

    # conf/multiconfig/versal-2ve-2vm-vek385-sdt-seg-cortexa78-1-zephyr.conf #@TYPE: Machine #@NAME: versal-2ve-2vm-vek385-sdt-seg-cortexa78-1-zephyr #@DESCRIPTION: Multiconfig Machine for SDT Zephyr BOARD versal2_apu DEFAULTTUNE = "cortexa72-cortexa53" DISTRO = "amd-zephyr" TMPDIR .= "-${BB_CURRENT_MC}" # Zephyr RTOS settings ZEPHYR_BOARD = "versal2_apu" ARCH:versal-2ve-2vm-apu = "arm" CONFIG_DTFILE = "${CONFIG_DTFILE_DIR}/versal-2ve-2vm-vek385-sdt-seg-cortexa78-1-zephyr.dts"

Since we are not generating versal-2ve-2vm-vek385-sdt-seg-cortexa78-1-zephyr multiconfig by default, user has to run pre-step defore you build.

  1. Copy versal-2ve-2vm-vek385-sdt-seg-cortexa78-1-zephyr.dts to meta-amd-adaptive-socs/meta-amd-adaptive-socs-bsp/conf/dts directory.

  2. Add versal-2ve-2vm-vek385-sdt-seg-cortexa78-1-zephyr to BBMULITICONFIG in meta-amd-adaptive-socs/meta-amd-adaptive-socs-bsp/conf/versal-2ve-2vm-vek385-sdt-seg.conf machine file. Example:

    BBMULTICONFIG += "versal-2ve-2vm-vek385-sdt-seg-cortexr52-0-zephyr versal-2ve-2vm-vek385-sdt-seg-cortexr52-1-baremetal versal-2ve-2vm-vek385-sdt-seg-microblaze-pmc versal-2ve-2vm-vek385-sdt-seg-cortexa78-1-zephyr"

 

VEK385 Cortex-R52 Core 0

  • Machine file:

    # conf/machine/versal-2ve-2vm-rpu.conf #@TYPE: Machine #@NAME: versal-2ve-2vm-rpu #@DESCRIPTION: Machine for stock Zephyr BOARD versal2_rpu # Include tune-cortexr52 require conf/machine/include/arm/armv8r/tune-cortexr52.inc # This machine file is demostrate building stock zephyr amd versal2_rpu board using # meta-amd-zephyr layer. DEFAULTTUNE = "cortexr52" # GLIBC will not work with Cortex-R/MB-V. TCLIBC = "newlib" DISTRO = "amd-zephyr" TMPDIR = "${TOPDIR}/tmp-versal-2ve-2vm-rpu" # Zephyr RTOS settings ZEPHYR_BOARD = "versal2_rpu" ARCH:versal-2ve-2vm-rpu = "arm"
  • Multiconfig Machine file

    # meta-amd-adaptive-socs/meta-amd-adaptive-socs-bsp/conf/multiconfig/versal-2ve-2vm-vek385-sdt-seg-cortexr52-0-zephyr.conf #@TYPE: Machine #@NAME: versal-2ve-2vm-vek385-sdt-seg-cortexr52-0-zephyr #@DESCRIPTION: Multiconfig Machine for SDT Zephyr BOARD versal2_rpu DEFAULTTUNE = "cortexr52" # GLIBC will not work with Cortex-R/MB-v. TCLIBC = "newlib" DISTRO = "amd-zephyr" TMPDIR .= "-${BB_CURRENT_MC}" # Zephyr RTOS settings ZEPHYR_BOARD = "versal2_rpu" ARCH:versal-2ve-2vm-rpu = "arm" CONFIG_DTFILE = "${CONFIG_DTFILE_DIR}/versal-2ve-2vm-vek385-sdt-seg-cortexr52-0-zephyr.dts"

MB-V-KCU105

  • Machine file:

    # meta-xilinx/meta-amd-zephyr/conf/machine/mbv32.conf #@TYPE: Machine #@NAME: mbv32 #@DESCRIPTION: Machine for Zephyr BOARD mbv32 # This machine file is demostrate building stock zephyr amd mbv32 board using # meta-amd-zephyr layer. require conf/machine/include/riscv/tune-riscv.inc DEFAULTTUNE = "riscv32" # GLIBC will not work with Cortex-R/MB-V. TCLIBC = "newlib" DISTRO = "amd-zephyr" # Zephyr RTOS settings ZEPHYR_BOARD = "mbv32" ARCH:mbv32 = "riscv32"
  • Sample Machine and Multiconfig file

    • Machine file

      # conf/machine/mbv32-kcu105.conf #@TYPE: Machine #@NAME: mbv32-kcu105 #@DESCRIPTION: Machine for SDT Zephyr BOARD mbv32 kcu105 require conf/machine/include/riscv/tune-riscv.inc DEFAULTTUNE = "riscv32" BBMULTICONFIG = "mbv32-kcu105-test-mc"
    • Multiconfig Machine file

      # conf/multiconfig/mbv32-kcu105-test-mc.conf #@TYPE: Multiconfig Machine #@NAME: mbv32-kcu105-test-mc #@DESCRIPTION: Multiconfig Machine for SDT Zephyr BOARD mbv32 kcu105 # GLIBC will not work with Cortex-R/MB-V. TCLIBC = "newlib" DISTRO = "amd-zephyr" TMPDIR .= "-${BB_CURRENT_MC}" CONFIG_DTFILE = "/scratch/sandeep/yocto/2025.1/sdtgen/lopper-outputs/mb-v-kcu105/mbv32.dts" ZEPHYR_SDT_SOC_KCONFIG = "/scratch/sandeep/yocto/2025.1/sdtgen/lopper-outputs/mb-v-kcu105/Kconfig" ZEPHYR_SDT_SOC_KCONFIG_DEFCONFIG = "/scratch/sandeep/yocto/2025.1/sdtgen/lopper-outputs/mb-v-kcu105/Kconfig.defconfig" # Zephyr RTOS settings ZEPHYR_BOARD = "mbv32" ARCH:mbv32 = "riscv32"

Yocto AMD Zephyr Recipe Template

Here is the sample AMD Zephyr Recipe Template.

Note:

  • Create a recipe

    $ touch meta-xilinx/meta-mad-zephyr/recipes-kernel/zephyr-kernel/<app-name>.bb
  • Add the below content to <app-name>.bb

    # Inheriting zephyr-sample is a must for all zephyr application recipes inherit zephyr-sample # Inheriting amd-zephyr-sdt will use zephyr-amd repo instead on upstream one. inherit amd-zephyr-sdt # To use SRC_URI_ZEPHYR pointing to zephyr-amd github tree instead of upstream # zephyr tree we need add amd-zephyr-kernel-src include file. require amd-zephyr-kernel-src.inc ZEPHYR_SRC_DIR = "${ZEPHYR_BASE}/samples/<app-name>" # Optional COMPATIBLE_MACHINE = "<machine-name>" # Additional CMake flags to be passed to zephyr cmake configuration phase. EXTRA_OECMAKE += ""

Building Zephyr Applications

Pre-requisites: Set up the build environment and Yocto Project pre-requisites by following Operating System Integration and Development AMD Versal™ device portfolio

VEK385 Cortex-A78 Core 1:

  • Without Multiconfig:

    $ MACHINE=versal-2ve-2vm-apu bitbake zephyr-helloworld
  • With Multiconfig:

    $ MACHINE=versal-2ve-2vm-vek385-sdt-seg bitbake mc:versal-2ve-2vm-vek385-sdt-seg-cortexa78-1-zephyr:zephyr-helloworld
  • Once images are built it will be deployed in ${TMPDIR}-${BB_CURRENT_MC}/deploy/images/${MACHINE} directory. Here is an example.

    $ ls -la tmp-versal-2ve-2vm-vek385-sdt-seg-cortexa78-1-zephyr/deploy/images/versal-2ve-2vm-vek385-sdt-seg/ total 4768 drwxr-xr-x 2 santraju boulder 4096 Aug 22 19:49 . drwxr-xr-x 3 santraju boulder 4096 Aug 22 19:49 .. lrwxrwxrwx 2 santraju boulder 66 Aug 22 19:49 zephyr-helloworld.bin -> zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823014541.bin lrwxrwxrwx 2 santraju boulder 66 Aug 22 19:49 zephyr-helloworld.elf -> zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823014541.elf -rwxr-xr-x 2 santraju boulder 4304900 Aug 22 19:49 zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823014541.bin -rwxr-xr-x 2 santraju boulder 544104 Aug 22 19:49 zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823014541.elf lrwxrwxrwx 2 santraju boulder 66 Aug 22 19:49 zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg.bin -> zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823014541.bin lrwxrwxrwx 2 santraju boulder 66 Aug 22 19:49 zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg.elf -> zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823014541.elf $

VEK385 Cortex-R52 Core 0:

  • Without Multiconfig:

    $ MACHINE=versal-2ve-2vm-rpu bitbake zephyr-helloworld
  • With Multiconfig:

    $ MACHINE=versal-2ve-2vm-vek385-sdt-seg bitbake mc:versal-2ve-2vm-vek385-sdt-seg-cortexr52-0-zephyr:zephyr-helloworld
  • Once images are built it will be deployed in ${TMPDIR}-${BB_CURRENT_MC}/deploy/images/${MACHINE} directory. Here is an example.

    $ ls -la tmp-versal-2ve-2vm-vek385-sdt-seg-cortexr52-0-zephyr/deploy/images/versal-2ve-2vm-vek385-sdt-seg/ total 520 drwxr-xr-x 2 santraju boulder 4096 Aug 22 19:22 . drwxr-xr-x 3 santraju boulder 4096 Aug 22 19:22 .. lrwxrwxrwx 2 santraju boulder 66 Aug 22 19:22 zephyr-helloworld.bin -> zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823011055.bin lrwxrwxrwx 2 santraju boulder 66 Aug 22 19:22 zephyr-helloworld.elf -> zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823011055.elf -rwxr-xr-x 2 santraju boulder 45508 Aug 22 19:22 zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823011055.bin -rwxr-xr-x 2 santraju boulder 456148 Aug 22 19:22 zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823011055.elf lrwxrwxrwx 2 santraju boulder 66 Aug 22 19:22 zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg.bin -> zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823011055.bin lrwxrwxrwx 2 santraju boulder 66 Aug 22 19:22 zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg.elf -> zephyr-helloworld-versal-2ve-2vm-vek385-sdt-seg-20250823011055.elf $

MB-V32 KCU105:

  • Without Multiconfig:

    $ MACHINE=mbv32 bitbake zephyr-helloworld
  • With Multiconfig:

    $ MACHINE=mbv32-kcu105 bitbake mc:mbv32-kcu105-test-mc:zephyr-helloworld
  • Once images are built it will be deployed in ${TMPDIR}/deploy/images/${MACHINE} directory. Here is an example.

    $ ls -la tmp/deploy/images/mbv32/ total 400 drwxr-xr-x 2 santraju boulder 4096 Sep 7 11:38 . drwxr-xr-x 3 santraju boulder 4096 Sep 7 11:38 .. lrwxrwxrwx 2 santraju boulder 42 Sep 7 11:38 zephyr-helloworld.bin -> zephyr-helloworld-mbv32-20250907172925.bin lrwxrwxrwx 2 santraju boulder 42 Sep 7 11:38 zephyr-helloworld.elf -> zephyr-helloworld-mbv32-20250907172925.elf -rwxr-xr-x 2 santraju boulder 19700 Sep 7 11:38 zephyr-helloworld-mbv32-20250907172925.bin -rwxr-xr-x 2 santraju boulder 378128 Sep 7 11:38 zephyr-helloworld-mbv32-20250907172925.elf lrwxrwxrwx 2 santraju boulder 42 Sep 7 11:38 zephyr-helloworld-mbv32.bin -> zephyr-helloworld-mbv32-20250907172925.bin lrwxrwxrwx 2 santraju boulder 42 Sep 7 11:38 zephyr-helloworld-mbv32.elf -> zephyr-helloworld-mbv32-20250907172925.elf

XENVMGICV3:

  • Without Multiconfig:

    $ MACHINE=xenvmgicv3 bitbake zephyr-synchronization
  • Once images are built it will be deployed in ${TMPDIR}/deploy/images/${MACHINE} directory. Here is an example.

    • Without Multiconfig:

      $ ls -la tmp/deploy/images/xenvmgicv3/ total 1340 drwxr-xr-x 2 santraju boulder 4096 Oct 14 08:44 . drwxr-xr-x 5 santraju boulder 4096 Oct 14 08:44 .. lrwxrwxrwx 2 santraju boulder 52 Oct 14 08:44 zephyr-synchronization.bin -> zephyr-synchronization-xenvmgicv3-20251014143550.bin lrwxrwxrwx 2 santraju boulder 52 Oct 14 08:44 zephyr-synchronization.elf -> zephyr-synchronization-xenvmgicv3-20251014143550.elf -rwxr-xr-x 2 santraju boulder 311300 Oct 14 08:44 zephyr-synchronization-xenvmgicv3-20251014143550.bin -rwxr-xr-x 2 santraju boulder 1046136 Oct 14 08:44 zephyr-synchronization-xenvmgicv3-20251014143550.elf lrwxrwxrwx 2 santraju boulder 52 Oct 14 08:44 zephyr-synchronization-xenvmgicv3.bin -> zephyr-synchronization-xenvmgicv3-20251014143550.bin lrwxrwxrwx 2 santraju boulder 52 Oct 14 08:44 zephyr-synchronization-xenvmgicv3.elf -> zephyr-synchronization-xenvmgicv3-20251014143550.elf $

Booting Zephyr OS on HW

This section describes on how to program Zephyr OS on HW. Here is an example for KCU105 board.

 

This section describes on how to program KCU105 Zephyr OS elf using JTAG.

  1. Source Vivado or Vitis tools and launch xsdb shell.

  2. Run the following command on xsdb shell on host console to program the bitstream and zephyr elf file.

    xsdb% connect -url TCP:<hw-server-host-name-or-ip-address>:3121 tcfchan#0 xsdb% ta 1 xcku040 xsdb% ta 1 xcku040 xsdb% fpga -f mb-v-kcu105.bit -no-revision-check 100% 15MB 1.7MB/s 00:08 xsdb% ta 1 xcku040 2 BSCAN JTAG at USER2 3 Legacy Debug Hub 4 RISC-V at USER2 5 Hart #0 (Running) xsdb% targets -set -nocase -filter {name =~ "*Hart*#0"} xsdb% rst -proc Info: Hart #0 (target 5) Stopped at 0x0 (Reset catch) xsdb% dow zephyr-helloworld.elf Downloading Program -- /wrk/yocto_dev/sandeep/yocto/2025.1/yp-edf/images/kcu105-mb-v/zephyr-helloworld.elf section, rom_start: 0x80000000 - 0x8000000f section, reset: 0x80000010 - 0x80000013 section, exceptions: 0x80000014 - 0x80000161 section, text: 0x80000164 - 0x800026b5 section, initlevel: 0x800026b8 - 0x800026f7 section, device_area: 0x800026f8 - 0x8000275b section, sw_isr_table: 0x8000275c - 0x800028bb section, intc_table_area: 0x800028bc - 0x800028cb section, tbss: 0x800028cc - 0x800028cf section, rodata: 0x800028cc - 0x80002c0b section, bss: 0x80002c10 - 0x80002e8b section, noinit: 0x80002e90 - 0x80004c8f section, datas: 0x80004c90 - 0x80004cd3 section, device_states: 0x80004cd4 - 0x80004cdd section, k_heap_area: 0x80004ce0 - 0x80004cf3 100% 0MB 0.0MB/s 00:00 Setting PC to Program Start Address 0x80000000 Successfully downloaded /wrk/yocto_dev/sandeep/yocto/2025.1/yp-edf/images/kcu105-mb-v/zephyr-helloworld.elf xsdb% con Info: Hart #0 (target 5) Running xsdb% ta 1 xcku040 2 BSCAN JTAG at USER2 3 Legacy Debug Hub 4 RISC-V at USER2 5* Hart #0 (Running) xsdb% xsdb% exit exit
  3. On board UART0 see Zephyr OS boot messages as shown.

    image-20250618-230721.png

 

Yocto Zephyr Limitations

  1. Doesn’t deploy following files.

    1. MB-V bitstream files.

    2. DTB (Only required for Zephyr QEMU boot).

  2. Zephyr Board Extension is not yet supported.

  3. Yocto Zephyr QEMU for AMD boards is not yet supported.