Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in
DIOT Zynq Ultrascale-based System Board
DIOT Zynq Ultrascale-based System Board
  • Project
    • Project
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 12
    • Issues 12
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • image/svg+xml
    Discourse
    • Discourse
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Projects
  • DIOT Zynq Ultrascale-based System BoardDIOT Zynq Ultrascale-based System Board
  • Wiki
    • Software
  • Build system

Build system

Last edited by Adam Wujek Dec 09, 2021
Page history
  • Build system
  • Selection of HW version (new)
  • Required software
  • Partial build
  • Configuration update/change
  • Update bitstream/XSA file
  • Force rebuild
  • Example build

Build system

The used build system is based on make. To trigger a build, please go to the sw directory and type make followed with one of the targets:

  • all - build all the software. Produces many artifacts including BOOT.BIN and image.ub
  • bootbin - trigger a build of components required to build BOOT.BIN. This includes the build of boot loader of different stages (fsbl, pmufw, bl31 (atf), u-boot), device tree (dtb), tools like device-tree compiler (dtc) and a tool to create u-boot images (mkimage).
  • image_ub - trigger a build of components required to prepare a Linux image (kernel, rootfs and dtb)
  • clean - cleans up component's build (NOTE: it does not remove anything from artifacts directory)
  • distclean - similar to clean, but also removes the source code of components

It is advised to pass -j parameter to the make followed with the number of cores available in your system. This can significantly reduce the build time.

After the build, all built images are copied to the artifacts directory.

Selection of HW version (new)

The build system supports different versions of DIOT-SB hardware. Please note that after the change of HW version the DIOT software shall be rebuilt from scratch. To build for a specific version please define environment variable SB_VER in the shell. E.g:

export SB_VER=2

Required software

To build the software, the following is needed:

  • make
  • git
  • Compiler - build system was tested with Cross-Copiled GCC (provided by Petalinux or Vitis)
  • xsct - tool to extract information from the provided hardware description (XSA file). Provided by Petalinux or Vitis
  • bootgen - tool to generate BOOT.BIN file with all required boot loaders. Provided by Petalinux or Vitis
  • Petalinux 2019.2 - is used to generate rootfs; The build was not tested with other versions of the Petalinux.

Make sure that the mentioned software is available in your system and is in the PATH variable of your shell.

Partial build

It is possible to trigger the build of one component (with the needed dependencies):

  • atf - Arm Trusted Firmware, produces bl31.elf
  • dtb - Device-Tree Blob, produces system.dtb
  • dtc - Device-Tree Compiler, produces dtc program, needed to compile the DTB
  • fsbl - First Stage Boot Loader, produces fsbl.elf
  • gateware - Unpacks XSA file produced by Vivado from location gw/diot_sb_golden.xsa to pl_gateware.bit
  • linux - Linux Kernel, produces linux.bin
  • pmufw - Platform Management Unit (PMU) Firmware, produces pmufw.elf
  • rootfs - Root file system, produces rootfs.cpio.gz
  • uboot - U-boot boot loader, produces u-boot.elf

The build of any component is split into several stages. Depending on the component it can be:

  • artifacts - copies the output of a build to artifacts directory
  • build - does the build
  • compile - compiles software
  • config - configures the component, copies files from config directory to the build directory
  • generate - similar to compile
  • patch - applies patches from patches directory for a given component
  • prepare - downloads the source code of a component
  • unpack - unpack the XSA file
  • clean - cleans up component's build (NOTE: does not remove anything from artifacts directory)
  • distclean - similar to clean, but also removes the source code of components

Configuration update/change

If configuration files in the direcory sw/configs are changed then execution of make will trigger the build of required components.

Update bitstream/XSA file

The XSA files are stored in the gw_all directory. In the directory gw there is a soft link diot_sb_golden.xsa pointing to the version of XSA file which will be used during the build process.

To use the new version of XSA file, please copy it to gw_all and change the link gw/diot_sb_golden.xsa to point to the new file. Run make to build all the necessary components.

Force rebuild

To force the rebuild of some components call make with added _force to the component name. For example:

$ make linux_compile_force

The alternative way for the experienced users is to remove the corresponding file from the _done directory. Please, be careful with this method, it can lead to errors.

Example build

$ cd sw
$ make -j 10
20210817_024329 Fetching u-boot...
20210817_024329 Fetching device-tree...
20210817_024329 Fetching dtc...
20210817_024329 Prepare arm trusted firmware...
20210817_024329 Prepare gateware...
20210817_024329 Fetching bootfw...
20210817_024329 Fetching Linux Kernel...
20210817_024329 Prepare rootfs...
20210817_024329 Prepare gateware... done
20210817_024329 Unpack gateware...
20210817_024329 Unpack gateware... done
20210817_024329 Copy gateware's artifacts...
20210817_024329 Copy gateware's artifacts... done
20210817_024329 Fetching dtc... done
20210817_024329 Compiling dtc...
20210817_024330 Fetching device-tree... done
20210817_024331 Compiling dtc... done
20210817_024331 Copy dtc's artifacts...
20210817_024331 Copy dtc's artifacts... done
20210817_024331 Generate device-tree...
20210817_024332 Prepare arm trusted firmware... done
20210817_024332 Compiling arm trusted firmware...
20210817_024334 Compiling arm trusted firmware... done
20210817_024334 Copy arm trusted firmware's artifacts...
20210817_024334 Copy arm trusted firmware's artifacts... done
20210817_024400 Fetching bootfw... done
20210817_024400 Configuring fsbl...
20210817_024400 Configuring pmufw...
20210817_024408 Fetching u-boot... done
20210817_024408 Configuring u-boot...
20210817_024408 Configuring u-boot... done
20210817_024418 Generate device-tree... done
20210817_024418 Configuring device-tree...
20210817_024418 Configuring device-tree... done
20210817_024418 Compiling device-tree...
20210817_024419 Compiling device-tree... done
20210817_024419 Copy device-tree's artifacts...
20210817_024419 Copy device-tree's artifacts... done
20210817_024419 Compiling u-boot...
20210817_024419 Using DTB from artifacts:
20210817_024419     2021-08-17 02:44:19.234100040 +0200           32538 artifacts/system.dtb
20210817_024452 Configuring pmufw... done
20210817_024457 Compiling pmufw...
20210817_024458 Configuring fsbl... done
20210817_024504 Compiling fsbl...
20210817_024552 Compiling u-boot... done
20210817_024552 Copy u-boot's artifacts...
20210817_024552 Copy u-boot's artifacts... done
20210817_024605 Compiling pmufw... done
20210817_024605 Copy pmufw's artifacts...
20210817_024605 Copy pmufw's artifacts... done
20210817_024628 Compiling fsbl... done
20210817_024628 Copy fsbl's artifacts...
20210817_024628 Copy fsbl's artifacts... done
20210817_024628 Configuring boot.bin...
20210817_024628 Configuring boot.bin... done
20210817_024628 Building boot.bin...
20210817_024628 Copy and use artifacts:
20210817_024628     2021-08-17 02:43:34.605770405 +0200          151304 artifacts/bl31.elf
20210817_024628     2021-08-17 02:46:28.503111399 +0200          119808 artifacts/fsbl.elf
20210817_024628     2021-08-17 02:43:29.489733603 +0200        19311213 artifacts/pl_gateware.bit
20210817_024629     2021-08-17 02:46:05.818929889 +0200          157904 artifacts/pmufw.elf
20210817_024629     2021-08-17 02:45:52.262822047 +0200          788184 artifacts/u-boot.elf
20210817_024633 Building boot.bin... done
20210817_024633 Copy boot.bin's artifacts...
20210817_024633 Copy boot.bin's artifacts... done
20210817_025018 Prepare rootfs... done
20210817_025018 Building rootfs...
20210817_025041 Fetching Linux Kernel... done
20210817_025041 Patching Linux Kernel...
20210817_025045 Patching Linux Kernel... done
20210817_025045 Configuring Linux Kernel...
20210817_025045 Configuring Linux Kernel... done
20210817_025045 Compiling Linux Kernel...
20210817_025930 Building rootfs... done
20210817_025931 Copy rootfs's artifacts...
20210817_025932 Copy rootfs's artifacts... done
20210817_030246 Compiling Linux Kernel... done
20210817_030246 Copy Linux Kernel's artifacts...
20210817_030246 Copy Linux Kernel's artifacts... done
20210817_030246 Configuring image.ub's...
20210817_030246 Configuring image.ub's... done
20210817_030246 Building image.ub's...
20210817_030246 Using artifacts:
20210817_030246     2021-08-17 03:02:46.412073252 +0200        11780608 artifacts/linux.bin
20210817_030246     2021-08-17 02:59:32.230375709 +0200        34108141 artifacts/rootfs.cpio.gz
20210817_030246     2021-08-17 02:44:19.234100040 +0200           32538 artifacts/system.dtb
20210817_030248 Building image.ub's... done
20210817_030248 Copy image.ub's artifacts...
20210817_030248 Copy image.ub's artifacts... done
Clone repository
  • Backplane gth ibert analysis
  • Board specification
  • Software
  • Files
  • Home
  • Prototypes evaluation
  • PTS
    • Simple pts files
  • Software
    • Build system
    • Linux
    • Pts
    • Booting
    • Sensors for diagnostics
More Pages

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.