Board description
An SOC from Xilinx that combines an FPGA and ARM®-based processor. This project is based on the TE0715 Module from Trenz. The integration layer is not specific to Trenz however and so it is titled as Zynq-7000.
URL: https://www.xilinx.com/products/silicon-devices/soc/zynq-7000.html
URL: https://www.xilinx.com/products/boards-and-kits/1-672i0r.html
Wiki: TODO: wiki URL (if available)
Test results
The Yocto Project releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other Yocto Project releases:
1. Tested by single developer
2. Tested with Mender 1.7.1 and Mender 2.0.0
3. Tested with Mender 2.0.0
Build Means that the Yocto Project build using this Mender integration completes without errors and outputs images.
Runtime Means that Mender has been verified to work on the board. For U-Boot-based boards, the integration checklist has been verified.
Getting started
Prerequisites
-
Xilinx Petalinux 2018.3
- Petalinux 2018.3 corresponds with Rocko
-
Xilinx Petalinux 2019.1
- Petalinux 2019.1 corresponds with Thud
- hdf file (Likely generated by Xilinx Vivado)
- Google repo tool installed and in your
PATH
. - Google repo not supported yet
Build from example project (Only for 2018.3)
git clone https://github.com/reachBAM/Zynq-Petalinux-Example.git
cd Zynq-Petalinux-Example
git checkout MenderSupport
mkdir -p components/ext_source
cd components/ext_source
git clone https://github.com/reachBAM/meta-mender-zynq.git
cd meta-mender-zynq
git clone https://github.com/reachBAM/meta-mender.git
cd meta-mender
git checkout add_mender_dtb_name_force
cd ../../..
source <petalinux_install_directory>/2018.3/settings.sh
-
petalinux-config --get-hw-description
Exit
petalinux-build
Configuring the build from scratch
Setup Petalinux/Yocto environment
-
source <petalinux_install_directory>/<version>/settings.sh
- Where version is 2018.3 or 2019.1
petalinux-create -t project --template zynq -n <project_name>
cd <project_name>
Import Layers
- Create user layer directory
mkdir -p components/ext_source/
cd components/ext_source/
- Download meta-mender-zynq layer
git clone https://github.com/brymatPC/meta-mender-zynq.git
cd meta-mender-zynq
-
git checkout petalinux_2018.3
OR git checkout petalinux_2019.1
- Download mender layer
-
git clone https://github.com/mendersoftware/meta-mender.git
cd meta-mender
-
git checkout rocko
- For 2018.3 -
git checkout thud
- For 2019.1
- Patch Mender (2018.3)
git apply ../meta-mender-zynq/patches/Mender_No_Dtb_Fix.patch
- This patch provides a mechanism for avoiding a compile error because Zynq puts the dtb file inside a fitimage
- Recommendation taken from Mender Hub Page
- Patch Mender (2019.1)
git apply ../meta-mender-zynq/patches/Mender_No_Dtb_Fix.patch
- This patch provides a mechanism for avoiding a compile error because Zynq puts the dtb file inside a fitimage
git apply ../meta-mender-zynq/patches/Mender_Remove_Duplicate_UBoot_Patch.patch
- Xilinx uses their own u-boot branch and it contains a duplicate patch that causes the build to fail
-
Configure Petalinux
cd ../../..
- Copy in example hdf file
cp components/ext_source/meta-mender-zynq/templates/example.hdf .
- Run
petalinux-config
petalinux-config --get-hw-description
- Wait for config menu to display
- Add mender layers
- Yocto Settings —>
- User Layers —>
- ${PROOT}/components/ext_source/meta-mender/meta-mender-core
- ${PROOT}/components/ext_source/meta-mender-zynq
- Exit
- Exit
- Disable automatic u-boot environmental settings
- Subsystem AUTO Hardware Settings —>
- Advanced bootable images storage Settings —>
- u-boot env partition settings —>
- image storage media —>
- set to manual
- Exit
- Exit
- Exit
- Place root filesystem on sd card
- Image Packaging Configuration —>
- Root filesystem type —>
- set to SD card
- Exit
- Exit
Modify Petalinux Files
- Add mender to root filesystem
echo "CONFIG_mender=y" >> project-spec/configs/rootfs_config
- Add mender to install packages
echo "IMAGE_INSTALL_append = \" mender\"" >> project-spec/meta-user/recipes-core/images/petalinux-image-full.bbappend
- Overwrite project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
cp components/ext_source/meta-mender-zynq/templates/system-user.dtsi project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
- TODO: Provide example when not using device tree
- Add bootcount defines for u-boot (2018.3 Only)
echo "#define CONFIG_BOOTCOUNT_LIMIT" >> project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h
echo "#define CONFIG_BOOTCOUNT_ENV" >> project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h
- Import uEnv.txt for u-boot (2018.3 Only)
cp components/ext_source/meta-mender-zynq/templates/uEnv.txt project-spec/meta-user/recipes-bsp/u-boot/files/
cp components/ext_source/meta-mender-zynq/templates/u-boot-xlnx_%.bbappend project-spec/meta-user/recipes-bsp/u-boot/
- Add golang recipe
- Download golang recipe to
project-spec/meta-users/recipes-apps/go
- NOTE: Mender 2.0 requires Go 1.12
- Download golang recipe to
- Apply petalinuxbsp.conf.append
- Copy and paste file contents to bottom of project-spec/meta-user/conf/petalinuxbsp.conf
- Set path to hdf file in project-spec/meta-user/conf/petalinuxbsp.conf
- Needs to be full path to hdf file generated by Xilinx Vivado tools
HDF_PATH = "/home/<user>/.../<project_name>/example.hdf"
- Set artifact name in project-spec/meta-user/conf/petalinuxbsp.conf
MENDER_ARTIFACT_NAME="Example"
- Set SDCard Size in project-spec/meta-user/conf/petalinuxbsp.conf
MENDER_STORAGE_TOTAL_SIZE_MB="30436"
Building the image
petalinux-build
Using the build output
After a successful build, the images and build artifacts are placed in images/linux/
The disk image with .sdimg
is used to provision the device storage for devices without Mender running already. Please proceed to the official documentation on provisioning a new device for steps to do this.
On the other hand, if you already have Mender running on your device and want to deploy a rootfs update using this build, you should use the Mender Artifact files, which have .mender
suffix. You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client only in Standalone deployments.
References
TODO: Add any relevant references such as repository README.md files, etc.
- The official Mender documentation explains how Mender works. This is simply a board-specific complement to the official documentation.
- The reference layer readme
Known issues
- Default Petalinux build likely doesn’t have a golang recipe
- The interplay between bootargs in u-boot vs the device-tree isn’t well understood by me. Testing so far is only with the device-tree bootargs.
- The bootcount defines still need to be added manually to the platform-top.h file. This should be done in a bbappend.
- Issue is actually that the xlnx-uboot 2018.3 repo doesn’t have the correct kconfig for
CONFIG_BOOTCOUNT_LIMIT
, so the defines have to be added to the platform-top.h file. Patching this file doesn’t seem appropriate since it is a user file.
- Issue is actually that the xlnx-uboot 2018.3 repo doesn’t have the correct kconfig for
- Haven’t done any testing with a Mender server
- Shouldn’t need to manually patch mender.
- Pull request submitted
If this post was useful to you, please press like, or leave a thank you note to the contributor who put valuable time into this and made it available to you. It will be much appreciated!