MicroZed Chronicles: PetaLinux Edition — Build Elements & Configuration
Having demonstrated how to get create a PetaLinux build environment, we are now in position to be able to start creating embedded Linux solutions.
As such in this blog we are going to look at the different elements which are included in a PetaLinux build and which might need configuration.
As always we will start with the highest level element and its configuration.
System — The main PetaLinux element which enables us to configure the highest level of our embedded Linux solution.
Elements which we may configure at the system level include, location of the RootFS e.g. INITRAMFS or External such as SD, USB etc. Using the system configuration we can also use an external Linux kernel or out of build kernel if desired.
We can also configure the hardware elements such as stdin/stdout and baud rate.
In the PetaLinux build flow the sytem configuration dialog is opened following the petalinux-config get-hw-definition or using the command petalinux-config
Kernel —The operating system and as such it is heart of our embedded Linux solution
Elements we may need to configure in the kernel as part of our PetaLinux project are networking support, device drivers, libraries routines, file systems and memory management options. Within our PetaLinux project we can customize the kernel using the commands petalinux-config -c kernel
Root File System — The rootfile system provides the embedded Linux system with the capability to boot, restore, repair and recover the system.
Within the RootFS configuration we are able to ensure any custom applications we have created are included in our File System or not.
We are also able to configure any desired packages for our embedded Linux solution including OpenAMP, OpenCV, QT etc.
Device Tree — The Kernel needs to be able to understand its hardware configuration. Embedded Systems are often highly configurable at the hardware level. As such the Device Tree provides information to the kernel, including address, interrupt numbers, driver bindings etc.
In PetaLinux when we apply the hardware definition the PetaLinux creates the device tree structures which are needed. However we may also need to add in additional elements to the device tree. To do this we can edit the device tree DTSI (device tree source include) available under the <project>/project-spec/meta-user/recipes-bsp/device-tree/files
In the example below you can see the DSTI file updated to enable the use of SPIDEV with spi0.
These device tree source and include files are then compiled into a device tree blob which is included with the kernel image.
Having looked at the different elements of the PetaLinux build process and what we may need to configure in our next blog we will create our first embedded Linux solution.
See My FPGA / SoC Projects: Adam Taylor on Hackster.io
Get the Code: ATaylorCEngFIET (Adam Taylor)
Access the MicroZed Chronicles Archives with over 300 articles on the FPGA / Zynq / Zynq MpSoC updated weekly at MicroZed Chronicles.