Back | Next | Contents
Appendix
This page lists all the steps to build a Yocto based distro for de10-nano-soc. Yocto is a complete build system i.e. it generates everything needed for a fully functioning Linux system for your DE10-Nano and this includes the bootloader (U-Boot), kernel and the rootFS.
Please Note - The steps listed on this page are from my experiments with Yocto. I've abandoned it in favour of Debian and keeping it here just for reference. The main problem when using Yocto is that the build process takes a very long time (4-5 hours on my virtualbox) and a lot of space (~50-100GB). The rest of the guide assumes that you are using Debian and not Yocto.
-
Create a working directory:
mkdir yocto
-
Get the Yocto sources:
git clone git://git.yoctoproject.org/poky.git
-
Get the
meta-alterarecipes for Yocto:git clone git://github.com/kraj/meta-altera.git
-
Visit the Yocto releases page and choose which release you wish to use. For this guide, we will choose
dunfellas its the latest with long term support. Switch the branch in thepokyrepository todunfellcd poky git checkout dunfell cd ..
-
Prepare for the configuration and the build:
source poky/oe-init-build-env ./buildThis creates the
buildfolder andcds into it. It also sets various environment variables, config files etc.
Now we update the config files for our requirements. The steps followed here are not exhaustive, but they are meant to give a minimum console based Linux distro which can be used for most FPGA-HPS projects. For more information, look into the links in the appendix.
-
Add the
meta-alterarecipe to the Yocto build:vim conf/bblayers.conf
Add the following line which points to the
meta-alterarecipe to theBBLAYERSvariable, one line above the closing quotation mark.${TOPDIR}/../meta-altera \So your file should now look like this:
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf # changes incompatibly POKY_BBLAYERS_CONF_VERSION = "2" BBPATH = "${TOPDIR}" BBFILES ?= "" BBLAYERS ?= " \ /home/myuser/yocto/poky/meta \ /home/myuser/yocto/poky/meta-poky \ /home/myuser/yocto/poky/meta-yocto-bsp \ ${TOPDIR}/../meta-altera \ " -
Yocto uses
conf/local.conffor the vast majority of it's configuration options. We will use the following options for this particular build. Copy paste all these options and paste them at the end of the file:MACHINE = "cyclone5" PACKAGE_CLASSES = "package_deb" EXTRA_IMAGE_FEATURES = "debug-tweaks tools-sdk tools-debug package-management" PREFERRED_PROVIDER_virtual/kernel = "linux-altera" PREFERRED_VERSION_linux-altera = "5.7%" UBOOT_CONFIG = "de10-nano-soc" UBOOT_EXTLINUX_FDT_default = "../soc_system.dtb" IMAGE_INSTALL_append += " apt dpkg " PACKAGE_FEED_URIS = "http://mirror.0x.sg/debian/" PACKAGE_FEED_BASE_PATHS = "rpm" PACKAGE_FEED_ARCHS = "all armhf"Let's go through these in detail:
-
The de10-Nano uses a cyclone5 chip. So we have to specify that as the machine:
MACHINE = "cyclone5" -
We want this to be a debian based distro. So we want to use the deb package classes:
PACKAGE_CLASSES = "package_deb" -
tools-sdkandtools-debugare necessary to havegccandmakeand other build essential utilities available. We're also includingpackage-managementbecause we want it to have a package manager.EXTRA_IMAGE_FEATURES = "debug-tweaks tools-sdk tools-debug package-management" -
Use the
linux-alteraconfiguration for the kernel.PREFERRED_PROVIDER_virtual/kernel = "linux-altera" -
Which version of the kernel to use? Assuming you are in the
builddirectory, the following command lists all the available kernel options to use:ls ../meta-altera/recipes-kernel/linux/In our case, we want to use 5.7, so we use the following:
PREFERRED_VERSION_linux-altera = "5.7%" -
TODO: Explain the remaining parameters in the config.
-
Now we build the linux image. Run the following commands to start the build process:
-
Build the bootloader and rootfs:
bitbake virtual/bootloader
-
Build the kernel:
bitbake virtual/kernel
-
Build the SD card image:
bitbake core-image-minimal
All the resources that were used in putting together this guide:
Rocketboards Yocto build guide
Yocto official tips and tricks
Next | SSH Without Password
Back | FPGA-SDRAM Communication - Avalon MM Host/Master - 3
Appendix | Table of Contents