Compiling and Running Applications on an ARM Processor
A first step in application development is to cross-compile your application code to run on the target platform. Every platform included in the SDSoC environment includes a pre-built SD card image from which you can boot and run cross-compiled application code. When you do not select any functions for hardware in your project, this pre-built image is used.
When you make code changes, including changes to hardware functions, it is valuable to rerun a software-only compile to verify 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/software debugging.
arm-linux-gnueabihf
- for developing Linux applicationsarm-none-eabi
- for developing standalone ("bare-metal") and FreeRTOS applications
aarch64-linux-gnu
- for developing Linux applicationsaarch64-none-elf
- for developing standalone ("bare-metal") applications
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.
- 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, copy the contents of sd_card directory onto an SD card and insert into the target board. Open a serial terminal connection to the target and power up the board (for more information see Introduction). 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.
For standalone applications, the ELF, bitstream, and board support package (BSP) are contained within BOOT.BIN, which automatically runs the application after the system boots.