Embedded Systems / F&S Boards

Build Embedded Linux with Yocto

Step 3 of 7

Assuming you successfully booted into your Fedora VM, perform these steps.

  1. Start Visual Studio Code
  2. Open Terminal. Click View → Terminal.
  3. Browse to folder with Yocto environment.

    cd cd /home/developer/fsimx8mp-Y2025.12/

  4. Prepare “build” folder.
    ./setup-yocto build

  5. When asked for GIT username, press <ENTER>.
  6. When asked for email, press <ENTER>.
  7. When asked whether to enable color display, press “y”, then <ENTER>.
  8. Update “build” folder.
    ./setup-yocto build -u

  9. Browse into “build” folder.
    cd build/yocto-fus

  10. Set environment variables and run setup script.
    DISTRO=fus-imx-xwayland MACHINE=fsimx8mp ./fus-setup-release.sh -b build-fsimx8mp-fus-imx-xwayland

  11. When asked to read EULA, press “q” key.
  12. Accept EULA (press “y”, <ENTER>).
  13. Make sure you’re in the “build” folder.
    cd /home/developer/fsimx8mp-Y2025.12/build/yocto-fus

  14. Load additional environment variables.
    DISTRO=fus-imx-xwayland MACHINE=fsimx8mp source setup-environment build-fsimx8mp-fus-imx-xwayland

  15. Install additional packages required for OS build:
    sudo dnf install chrpath diffstat lz4 patch zstd rpcgen perl-Archive-Zip

  16. Install further packages required for OS build:
    sudo dnf install perl perl-Thread-Queue perl-File-Compare perl-File-Copy \
    perl-FindBin perl-Text-ParseWords perl-Data-Dumper perl-bignum perl-locale

  17. Start OS build process. Take your time. The build process will likely last for several hours.

    bitbake fus-image-std

Note: The resulting OS image is stored in folder
/home/developer/fsimx8mp-Y2025.12/build/yocto-fus/
and in subfolder:
build-fsimx8mp-fus-imx-xwayland/tmp/deploy/images/fsimx8mp
Take a good note of this subfolder.

Warning: If you ever close and then re-open MATE terminal, then in order to run bitbake again, run this sequence of commands:
cd /home/developer/fsimx8mp-Y2025.12/build/yocto-fus
DISTRO=fus-imx-xwayland MACHINE=fsimx8mp source setup-environment build-fsimx8mp-fus-imx-xwayland

If you managed to successfully build the OS, it is now time to deploy it to your board and let the OS boot up. Browse into the build output folder, look for the sysimg file and follow instructions from previous article to boot into the OS.

Build Software Development Kit

Should you find yourself in a situation, that you would like to build custom software for your board, you may want to build SDK (Software Development Kit) for it first. The process is essentially the same as described above, however, instead of executing bitbake fus-image-std, execute

bitbake fus-image-std -c populate_sdk

The build may, again, take several hours. However, if you previously built the OS itself, the SDK build will take significantly less, as most of the artifacts will be built by then. Once the SDK is built, perform following steps.

  1. Open Visual Studio Code terminal.
  2. Browse into folder:
    cd /home/developer/fsimx8mp-Y2025.12/build/yocto-fus/
    cd build-fsimx8mp-fus-imx-xwayland/tmp/deploy/sdk
                    

  3. There will be a script (a filename, which ends with .sh). Most likely, the name will be: fus-imx-xwayland-glibc-x86_64-fus-image-std-cortexa53-fsimx8mp-toolchain-5.0.sh Note the name of that script file. Run it.
  4. The script will extract the SDK into directory specified by you. Take good note of the output directory. If you don’t specify any, then default will be used, which is: /opt/fus-imx-xwayland/5.0.
  5. Now run this command:
    source /[SDK DIRECTORY]/environment-setup-cortexa53-fslc-linux

    If you extracted SDK into your default folder, the command is:

    source /opt/fus-imx-xwayland/5.0/environment-setup-cortexa53-fslc-linux

    This command modifies environment variables in the current shell so subsequent build commands use the SDK.

  6. You should now be able build C/C++ projects with make command.

Build C/C++ projects

Now that you built the SDK, you can use your Fedora VM to compile and link C/C++ projects so that they can be run on your embedded board. Here’s a couple of things to try:

  1. Inspect some important environment variables with:
    source /[SDK DIRECTORY]/environment-setup-cortexa53-fslc-linux

    If you extracted SDK into your default folder, the command is:

    echo "$CC"
    echo "$CXX"
    echo "$SDKTARGETSYSROOT"
    echo "$OECORE_TARGET_SYSROOT"
    echo "$PKG_CONFIG_SYSROOT_DIR"

  2. Create a simplistic “Hello world” application:
    source /[SDK DIRECTORY]/environment-setup-cortexa53-fslc-linux

    If you extracted SDK into your default folder, the command is:

    cat > hello.c <<'EOF'
    #include 
    
    int main(void)
    {
        printf("Hello from the i.MX8MP application\n");
        return 0;
    }
    EOF

  3. Compile it:
    $CC hello.c -o hello

  4. If you try to run it:
    ./hello

    bash: ./hello: cannot execute binary file: Exec format error

    This is because the file cannot be run on a CPU architecture emulated by your Fedora VM.

  5. Try this command:
    file hello

    Expected output:
    hello: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=0a6602234b1c6555dfcda17fe582cae07fa992cd, for GNU/Linux 5.15.0, with debug_info, not stripped

  6. The ARM aarch64 means, the file can only be run on ARM 64 bit processor architecture. Check processor architecture of your Fedora VM with:

    uname -m

    Expected output:
    x86_64

  7. Try to copy the application to your board:
    scp hello root@fsimx8mp:/tmp

    If “fsimx8mp” hostname cannot be resolved, then type the IP address of your embedded board instead. Of course, for this to work, your embedded board must have the OS booted and it has to be connected to the same local are network as your Fedora VM.

  8. Once copied, use PuTTY to log into your embedded board. At this point, you may connect either over serial connection, or via ethernet (SSH protocol). Once logged in, do this:
    /tmp/hello

    Expected output:
    Hello from the i.MX8MP application

Documentation notice

Information may change over time

Created
Last technically reviewed

Technical details on this page may change as vendor tools, board support packages, operating system images, and runtime versions evolve.

This page was last technically reviewed on June 15, 2026. If your setup differs from the one described here, please contact us for help.