Compiling and Running Applications

This appendix contains the following topics:

Note: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.

Compiling and Running Applications on a MicroBlaze Processor

AMicroBlaze™platform in theSDSoC™environment is a standardMicroBlazeprocessor system built using theVivado®tools andSDKthat must be a self-contained system with a local memory bus (LMB) memory,MicroBlazeDebug Module (MDM), UART, and AXI timer.

TheSDSoCenvironment includes the standardSDKtoolchain forMicroBlazeprocessors, includingmicroblaze-xilinx-elffor developing standalone ("bare-metal") and FreeRTOS applications.

By default, theSDSoCsystem compilers do not generate an SD card image for projects targeting aMicroBlazeplatform. You can package the bitstream and corresponding ELF executable as needed for your application.

To run an application, the bitstream must be programmed onto the device before the ELF can be downloaded to theMicroBlazecore. TheSDSoCenvironment includesVivadotools andSDKfacilities to create MCS files, insert an ELF file into the bitstream, and boot the system from an SD card.

Compiling and Running Applications on an Arm Processor

Note: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.

TheSDSoCenvironment includes two distinct toolchains for theArm®Cortex™-A9 CPU withinZynq®-7000 SoC.

arm-linux-gnueabihf
For developing Linux applications
arm-none-eabi
For developing standalone ( bare-metal) and FreeRTOS applications

ForArmCortex-A53 CPUs within theZynqdevices, theSDSoCenvironment includes two toolchains:

aarch64-linux-gnu
For developing Linux applications
aarch64-none-elf
For developing standalone ( bare-metal) applications

For theArmCortex-R5 CPU provided in theZynqUltraScale+™MPSoC, the toolchain included in theSDSoCenvironment is thearmr5-none-eabi. This develops standalone (bare-metal) applications.

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

TheSDSoCsystem compilers generate an SD card image by default in a project sub-directory namedsd_card. For Linux applications, this directory includes the following files:

README.TXT
Contains brief instructions on how to run the application
BOOT.BIN
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 the following:
  • uImage
  • devicetree.dtb
  • uramdisk.image.gzfiles
.elf
Application binary executable

To run the application:

  1. Copy the contents ofsd_carddirectory 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 asroot, and enters a bash shell. The SD card is mounted at/mnt, and from that directory you can run.elf.