- Created by Thomas Dück, last modified on 29 06, 2022
Some of the reference designs from Trenz Electronics include a preconfigured Yocto BSP layer. This is a short description of how to use the BSP layer to create a Linux image with the Yocto project for the Board.
Prepare Yocto Project
The Yocto BSP layer will be generated with the quartus project in the <project name>/os/yocto/meta-<module> folder. The generated layers depends on the meta-altera layer (for more information see: Yocto KICKstart#Used source files).
- Download a reference design that includes a Yocto BSP layer
- Generate the Quartus project as described in the wiki description of the downloaded reference design or in Project Delivery - Intel devices#Quick Start
- Copy the generated meta-<module> folder from <project name>/os/yocto/meta-<module> to the path/to/yocto/poky/ directory
- Follow the steps from Yocto KICKstart#Create a project for an Intel FPGA device without running the 'bitbake' command
Add the generated BSP layer meta-<machine> to /yocto/poky/build/conf/bblayers.conf with:
bitbake-layers add-layer ../meta-<module>
Generate linux image
There are two options to generate an image with the provided Yocto BSP layer:
- Generate an image with a minimal RAM-based root filesystem, which is bundled inside the kernel image.
- Generate an image with a root filesystem on sd card with its own partition.
For the reference design, the generation of an image with an init RAM filesystem is preferred.
Image with initial RAM filesystem
- Redefine the variable MACHINE with '<module>-<Board-Part-Short-Name>' in path/to/yocto/poky/build/conf/local.conf
- A list with the correct MACHINE names can be found in the wiki description of the reference design: Overview→Requirements→Hardware
e.g. for the board TEI0022-03 see TEI0022 Test Board#Hardware → here the MACHINE name is tei0022-a5-c8-2gb.
run following commands to redefine 'MACHINE':
sed -i '/^MACHINE/s/MACHINE/#MACHINE/g' conf/local.conf echo -e '\nMACHINE = "<module>-<Board-Part-Short-Name>"' >> conf/local.conf
- A list with the correct MACHINE names can be found in the wiki description of the reference design: Overview→Requirements→Hardware
Define the variables INITRAMFS_IMAGE_BUNDLE and INITRAMFS_IMAGE to create an image with initial RAM filesystem
echo -e '\nINITRAMFS_IMAGE_BUNDLE = "1"' >> conf/local.conf echo -e 'INITRAMFS_IMAGE = "te-initramfs"' >> conf/local.conf
Build the image with following command (the image recipes are located in meta-<module>/recipes-core/images/):
bitbake te-image-minimal
Image with root filesystem on SD card
- Redefine the variable MACHINE with '<module>-<Board-Part-Short-Name>' in path/to/yocto/poky/build/conf/local.conf
- A list with the correct MACHINE names can be found in the wiki description of the reference design: Overview→Requirements→Hardware
e.g. for the board TEI0022-03 see TEI0022 Test Board#Hardware → here the MACHINE name is tei0022-a5-c8-2gb.
run following commands to redefine 'MACHINE':
sed -i '/^MACHINE/s/MACHINE/#MACHINE/g' conf/local.conf echo -e '\nMACHINE = "<module>-<Board-Part-Short-Name>"' >> conf/local.conf
- A list with the correct MACHINE names can be found in the wiki description of the reference design: Overview→Requirements→Hardware
Build the image with following command (the image recipes are located in meta-<module>/recipes-core/images/):
bitbake te-image-minimal
Copy .wic file to SD card
Yocto generates a .wic file which contains all needed files like u-boot, zImage and so on. This file is stored in path/to/yocto/poky/build/tmp/deploy/images/<machine>/<image_name>.wic. If you generate the linux yocto project yourself, using the .wic file is a very simple way to prepare the SD card for booting linux.
Do following steps to copy the .wic file to the SD card:
- Insert the SD card into a SD card reader connected to the computer
Run following command to get the device name of the SD card (e.g. /dev/sdx):
lsblk
Copy the generated *.wic image to the SD card (replace 'sdx' in 'of=/dev/sdx' with the correct sd card device name:
sudo dd if=path/to/yocto/poky/build/tmp/deploy/images/<machine>/<image_name>.wic of=/dev/sdx bs=1M seek=0
Insert the SD card into your board, set boot mode to sd card (if the setting is available) and boot it.
Serial Console
- Open Serial Console (e.g. PuTTY)
select COM Port
Win OS: see device manager
Linux OS: see dmesg | grep tty (UART is *USB1)
- Speed: 115200
- Press reset button on the board
- Linux Console:
Login data:
Note: Wait until Linux boot finished
Username: root Password: root
You can use Linux shell now.
i2cdetect -y -r 1 (check I2C 1 Bus, if available) dmesg | grep rtc (RTC check, if available) udhcpc (ETH0 check, if available) lsusb (USB check, if available)
Table of contents
- No labels