This blog post explains use of virtual environments when using GNU Radio to develop for Nutaq’s Zynq-based ZeptoSDR platform.
When developing for a specific platform, it’s often useful to simulate it in a virtual environment. Cross-compiling is very convenient but it can quickly become a nightmare when compiling complex software that has many dependencies, like the GNU Radio Toolkit. Another advantage of using a virtual environment is that you can write code even if you don’t have the physical board with you. You can also automate your test coverage and build systems.
Let’s look at how to build a Ubuntu-based development environment for ZedBoard using QEMU and Linaro. QEMU, which stands for Quick EMUlator, is an open-source software application that emulates CPUs. In our case, we want to emulate the ARM Cortex-A. It’s the processor core used by the Zynq-7020 SoC on the ZedBoard.
Xilinx actively supports the ARM Cortex-A under QEMU. For a guide on installing QEMU, see http://www.wiki.xilinx.com/QEMU. To speed up development, Xilinx is also releasing PetaLinux, a complete embedded Linux distribution that target the Zynq-7000 SoC series. You can download the latest version at http://www.wiki.xilinx.com/Zynq+Releases. This package contains, amongst other things, a Linux kernel (uImage), an initramfs (uramdisk.image.gz), and a device tree (devicetree.dtb). These files are required to boot PetaLinux from QEMU.
Booting PetaLinux from QEMU brings up the BusyBox-based file system. BusyBox provides a basic set of tools for embedded Linux systems with limited resources. In our case, we want a Ubuntu-based file system. The reason for this is that we want access to an Ubuntu development environment and all the associated software and libraries. For those already familiar with Ubuntu, don’t worry! We are not going to install a full-blown Ubuntu system. Instead, we will use a nano-sized version provided by Linaro.
As described on their website, Linaro is a not-for-profit engineering organization that consolidates and optimizes open-source software and tools for the ARM architecture. They are involved with the GCC toolchain, the Linux kernel, and ARM power management. Linaro also provides Ubuntu-based file systems targeted to the ARM architecture. This is what interests us here.
The image version we use is Linaro nano 12.11. You can download it from http://releases.linaro.org/12.11/ubuntu/precise-images. Important note: Do not confuse the Linaro version number with the Ubuntu version number. For example, Linaro version 12.11 uses Ubuntu version 12.04 “precise”.
To boot the Linaro file system, we first need to create a virtual file system from an ordinary file (the ordinary file contains the Linaro file system). We do this because we want QEMU to use the file as a USB storage device that we will mount later on. Linux allows us to switch from the current root directory to another one using chroot(8). This is how we pivot from the BusyBox file system to the Linaro file system.
It’s important to make sure that we run the same file system version on both the ZedBoard and QEMU. To configure the Linaro file system on the ZedBoard, see the documentation provided by Digilent: http://digilentinc.com/Data/Products/EMBEDDED-LINUX/ZedBoard_GSwEL_Guide.pdf
With the Linaro file system in place, it becomes a lot easier to build, package, and distribute complex software that can then be installed on Zynq-based hardware such as Nutaq’s ZeptoSDR.
The latest software release for the Nutaq ZeptoSDR includes a ready-to-run version of GNU Radio embedded in the Zynq SoC and the GNU Radio plugins required to access the Radio420S RF data. This gives you the freedom to play around and tinker with scripts and commands.
Stay tuned for our next blog post where we showcase a GNU Radio application running on the Nutaq ZeptoSDR embedded Zynq SoC device.