Compiling and Running Applications
This appendix contains the following topics:
- Compiling and Running Applications on a MicroBlaze Processor
- Compiling and Running Applications on an Arm Processor
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-elf
for 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
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:
- Copy the contents ofsd_carddirectory onto an SD card and insert into the target board.
- 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.elf .