Compiling and Running Applications on an ARM Processor

When you make code changes, including changes to hardware functions, it is valuable to rerun a software-only compile to verify that your changes did not adversely change your program. A software-only compile is much faster than a full-system compile, and software-only debugging is a much quicker way to detect logical program errors than hardware and software debugging.

The SDSoC™ Environment includes two distinct toolchains for the ARM®Cortex™-A9 CPU within Zynq®-7000 SoCs.
  1. arm-linux-gnueabihf - for developing Linux applications
  2. arm-none-eabi - for developing standalone ("bare-metal") and FreeRTOS applications
For ARM® Cortex™-A53 CPUs within the Zynq® UltraScale+™ MPSoCs, the SDSoC Environment includes two toolchains:
  • aarch64-linux-gnu - for developing Linux applications
  • aarch64-none-elf - for developing standalone ("bare-metal") applications
For the ARM Cortex-R5 CPU provided in the Zynq UltraScale+ MPSoCs, the following toolchain is include in the SDSoC environment:
  • armr5-none-eabi - for developing standalone ("bare-metal") applications

The underlying GNU toolchain is defined when you select the operating system during project creation. The SDSoC system compilers (sdscc/sds++) automatically invoke the corresponding toolchain when compiling code for the CPUs, including all source files not involved with hardware functions.

The SDSoC system compilers generate an SD card image by default in a project subdirectory named sd_card. For Linux applications, this directory includes the following files:
  • README.TXT- contains brief instructions on how to run the application
  • BOOT.BIN - the boot image contains first stage boot loader (FSBL), boot program (U-Boot), and the FPGA bitstream
  • image.ub - contains the Linux boot image (platforms can be created that include uImage, devicetree.dtb, and uramdisk.image.gz files)
  • <app>.elf- the application binary executable
To run the application:
  1. Copy the contents of sd_card directory onto an SD card and insert into the target board.
  2. Open a serial terminal connection to the target and power up the board.

    Linux boots, automatically logs you in as root, and enters a bash shell. The SD card is mounted at /mnt, and from that directory you can run <app>.elf.