Cyclone V SoC
Introduction
Hardware
Software
SoC FPGA Embedded Design Suite
GNU ARM Embedded Toolchain
CrossWorks for ARM
Download
 

Introduction

For our Bare Metal software development we need the following components:

  • A hardware platform,
  • the corresponding FPGA design,
  • an ARM Compiler
  • and a Debugger

An Altera DE1-SoC Board is used for the hardware platform. But before we can start with the software development the associated FPGA design must be loaded. Make sure that the design from the "Golden Hardware Reference Design" tutorial is installed and running. If the design is not already installed, take a look here to program the FPGA.

Hardware

Here an Altera DE1-SoC Board was used:

Unfortunately the DE1-SoC board is not equipped with a 20pin JTAG connector. Therefore we need an adapter. More information about the selfmade adapter can be find here.

Software

At the time of creating this tutorial, the following software was installed:

SoC FPGA Embedded Design Suite

The SoC FPGA Embedded Development Suite (EDS) is a comprehensive tool suite for embedded software development on Intel SoC FPGA devices, including development tools, utility programs, run-time software, and application examples.

With IntelŪ's SoC FPGA Embedded Design Suite (SoC EDS), you get all the tools you need to work more productively, improve software quality, and ultimately get to market faster. (Source: Intel / Altera)

Sorry, here I does not have any experience with the SoC FPGA Embedded Development Suite (EDS).
I have only used the GNU ARM Embedded Toolchain and CrossWorks for ARM.

GNU ARM Embedded Toolchain

The GNU ARM Embedded toolchains are integrated and validated packages featuring the ARM Embedded GCC compiler, libraries and other GNU tools necessary for bare-metal software development on devices based on the ARM Cortex-M and Cortex-R processors. The toolchains are available for cross-compilation on Microsoft Windows, Linux and Mac OS X host operating systems. (Source: ARM Developer)

It is not mentioned here, but the toolchain support the ARM Cortex-A processors too.

Make sure that you have installed the compiler and the build tools.

Now we want to make a short test if these tools are all available. Therefore open a command
prompt and type:

C:\>make --version

The result should look like:

GNU Make 4.1
Built for x86_64-w64-mingw32
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

If there is no answer, probably the "build tools" was not installed or are not in your PATH.

Now we want to make a short test if the compiler is available. Therefore open a command
prompt and type:

C:\>arm-none-eabi-gcc --version

The result should look like:

arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 6.2.1 20161205 (releas
e) [ARM/embedded-6-branch revision 243739]
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If there is no answer, probably the toolchain was not installed or is not in your PATH.

Now I will show you, how to compile your first program. Therefore I have created a small example for it. Download the "c5blinky" example and expand the zip file in your working directory.

C:\temp\c5blinky

This directory is only an example, choose what is the best for you. For the next steps I will use this directory.

Open a command prompt and change in the "C:\temp\c5blinky" directory. First you must clean the project, therefore type:

C:\temp\c5blinky>make clean

The result should look like:

rm -f ./src/main.c.bak
rm -f ./src/c5_startup.s.bak
rm -fR debug
rm -fR .dep

All object files are deleted, now we want to compile the program, type:

C:\temp\c5blinky>make all

The output should look like:

mkdir debug arm-none-eabi-gcc -mcpu=cortex-a9 -march=armv7-a -mfloat-abi=soft -D__NO_FPU -O0
-gdwarf-2 -Wall -Wstrict-prototypes -fverbose-asm -ffunction-sections -fdata-
sections -DGNU -Dsoc_cv_av -MD -MP -MF .dep/main.o.d -I . -I./inc -c ./src/main
.c -o debug/main.o
arm-none-eabi-gcc -x assembler-with-cpp -mcpu=cortex-a9 -march=armv7-a -mfloat-a
bi=soft -D__NO_FPU -O0 -g -gdwarf-2 -DGNU -Dsoc_cv_av -c ./src/c5_startup.s -o
debug/c5_startup.o
arm-none-eabi-gcc debug/main.o debug/c5_startup.o -mcpu=cortex-a9 -march=armv7
-a -mfloat-abi=soft -D__NO_FPU -nostartfiles -T./prj/gcc.ld -Wl,-Map=debug/c5bli
nky.map,--cref,--gc-sections,--no-warn-mismatch -o debug/c5blinky.elf
arm-none-eabi-objcopy -O ihex debug/c5blinky.elf debug/c5blinky.hex

A file "c5blinky.elf" should now be created in the "debug" directory. If you could find it, congratulations, you have compiled your first ARM program with the new toolchain.

The file "c5blinky.jdebug" can be used for debugging your "c5blinky.elf" program with Ozone. A detailed description for how to debug with Ozone can be find here.

CrossWorks for ARM

CrossWorks for ARM is a complete C/C++ and assembly language development system for Cortex-M, Cortex-A, Cortex-R, ARM7, ARM9, ARM11, and XScale microcontrollers.
(Source: Rowley Associates)

Unfortunately, the Cyclone V SoC is currently not directly supported by Rowley. Therefore I have created my own CPU Support Packages for the Cyclone V SoC. You can download this packages from the download section.

Note: This is not an official CrossWorks for ARM package. Therefore, do not blame Rowley Associates if it does not work for you.

The package must manually installed. After this you can compile the "cw-c5blinky" example from the download section. Debugging an application with CrossWorks is not supported for the moment.

The file "cw-c5blinky.jdebug" can be used for debugging your program with Ozone. A detailed description for how to debug with Ozone can be find here.

Download

c5blinky v20161229, for use with the GNU ARM Embedded Toolchain (518 KB)

cw-c5blinky v20161229, for use with CrossWorks for ARM (518 KB)

CrossWorks for ARM, Altera Cyclone V SoC CPU Support Package v0.9 (5 KB)