Build Custom Linux Image for HDL Coder IP Core
This example shows how to build a custom Linux® image for an HDL Coder IP core by using the MathWorks® build system for the Digilent Zybo Z7-10 Zynq® board. The example also demonstrates how to set up the build environment and create a Linux image for the Digilent Zybo Z7-10 Zynq board. You can use the same process to create Linux image for other Zynq platforms.
The MathWorks build system is a tool that generates custom Linux images through cross-compilation. The MathWorks build system wraps the buildroot in pre- and post-processing scripts to automate the generation of system images for various platforms. The build system uses scripts that take the target board, platform, or image description file as an input and output a complete system image, including the boot loaders, kernel, and user space. Requirements
For Altera Board Related workflow see the comment below (summarized here)
- Install the Debian-9 OS using link and complete the machine setup
- Download and Install the Intel SoC EDS to /opt/intelFPGA/17.0 path in your machine
- To avoid any compatibiliy issues and to install additional packages, run the commands: sudo dpkg --add-architecture i386, sudo apt-get update, sudo apt-get install libc6:i386 libstdc++6:i386 zlib1g:i386
- Whenever required, you may also need to install addidtional buildroot packages.
- Clone the buildroot repo and checkout the mathworks_buildroot branch.
- If it is a custom design (other than MathWorks supported design), you may need to copy bitstream files (.rbf) to buildroot/board/mathworks/socfpga/boards/<board_name>/boot folder. If required, copy the generated emif.xml, hps.xml hand-off files to the buildroot/board/mathworks/socfpga/boards/<board_name>/handoff/handoff folder. Based on your design, you should also modify the DTS files as well present in your buildroot directory
- Run the build command: ./build.py -p socfpga -b <board_name> --brconfig BR2_TOOLCHAIN_EXTERNAL_PATH='/opt/intelFPGA/17.0/embedded/ds-5/sw/gcc/' --brconfig BR2_PACKAGE_UBOOT_ALTERA_EDS_INSTALLATION='/opt/intelFPGA/17.0/embedded'
Once the build is successful, you can see the Linux image generated as a ZIP file <board_name>_sdcard_linux_<build_date>.zip under the /buildroot/output/<board_name>_linux_linaro/images folder. Extract the ZIP file to see .img file and use Win32DiskImager or balenaEtcher to flash the SD card with .img file.