Getting Started with Arm DS-5 CE and Armv8-A Foundation Platform

This tutorial takes you through the process of creating a simple bare-metal "Hello World" application and finally running it on the Armv8-A Foundation Platform.

Start DS-5 and set up your Workspace

  1. To start DS-5 select Eclipse for DS-5 CE from the installation folder.
  2. In the Workspace Launcher dialog, accept the default workspace, or click Browse and select a folder. For example, C:\DS-5_Workspace.

    Workspace Launcher dialog

  3. Select Use this as the default and do not ask again option and click OK.
  4. Either close the Welcome page, or click Go to workbench to view the C\C++ Perspective.
    ds-5 welcome screen

Import a bare-metal compiler

In order to build a project, setup a compilation toolchain in the DS-5 preferences. For the purpose of this tutorial we'll use a bare metal compiler (AArch64) from Linaro. This tutorial uses GCC version 5.3.1, which is available here:

The most recent version of the GCC compiler is available here: This tutorial has been confirmed to work with GCC 7.2.1, however Arm cannot guarantee that this tutorial will always work with the latest version of the GCC compiler.

  1. In DS-5, click Window > Preferences and expand DS-5 
  2. Select Toolchains and click Add... in the Add/Remove toolchains section and Browse to your toolchain folder

  3. Select Next to run autodetection

  4. Select Finish to complete adding the Toolchain.

Eclipse will automatically restart.

Create a new Hello World C project

  1. From the DS-5 main menu, select File > New > C Project to display the C Project dialog.
  2. In the C Project dialog:
    1. In Project name field, enter Hello World as the name of your project.
    2. Under Project type, select Executable > Hello World ANSI C Project.
    3. Under Toolchains, select the compiler you imported in the previous section. For example GCC 5.3.1 [aarch64-elf] 

    4. Click Finish to create a C project called Hello World. You can view the project in the Project Explorer view.

Modify project build settings and build the application

Before building the example specify the project build settings. 

  1. Locate your Hello World project in the Project Explorer view, Right click it and select Properties
  2. In the Properties dialog
    1. Navigate to C/C++ Build > Settings
    2. Select All configurations in the Configurations list
    3. Select GCC C Linker  > Miscellaneous and in the Other flags field enter:  --specs=aem-ve.specs

    4. Click OK to apply and close the Properties dialog
  3. Locate your Hello World project in the Project Explorer view, right click it and select Build Project
  4. You can view the build output console by selecting Window > Show view > Console.
If the build succeeded you should see the binary file "Hello World.axf" in the Debug folder. You can inspect the header, sections, disassembly, and symbol table by double-clicking on the file to open it with Elf content editor. 

Create a DS-5 debug configuration

  1. From the DS-5 main menu, select Run > Debug Configurations.
  2. In the Debug Configurations dialog:
    1. Select DS-5 Debugger.
    2. Click the New launch configuration button.

      Debug configurations - New

      This creates a new DS-5 debug configuration and displays the various tabs required to specify settings for loading your application on the target.

      Debug configurations - Tabs

  3. In the Debug Configurations dialog:
    1. Give a name to the debug configuration. For example, Hello World.
    2. In the Connection tab, under Select Target, browse and select Arm Model > Armv8-Ax1 Foundation Platform > Bare Metal Debug > Debug Armv8-A.

    3. Select the Files tab, and under Target Configuration in the Application on host to download field, click Workspace.

      Debug configurations - Files Tab

      The workspace folder Hello World > Debug contains the Hello World.axf application file you created when you built the Hello World project. 

    4. Select Hello World.axf, click OK

      Open Hello World

      Note: Ensure that the Load symbols option is selected in the Files tab.

    5. Select the Debugger tab, and ensure the Debug from symbol option is selected and set to main.

      Debug configurations - Debugger Tab

    6. Click Debug to load the application on the target, and load the debug information into the debugger.
    7. In the Confirm Perspective Switch dialog that appears, click Yes.

      DS-5 connects to the model and displays the connection status in the Debug Control view.

      The application is loaded on the target, and has stopped at the main() function, ready to run.

    8. ClickContinue Button to continue running the application.

      You can view the application output in the Target Console view.

      Other views display information relevant to the debug connection

      • Commands view displays messages output by the debugger. Also use this view to enter DS-5 commands.

      • Disassembly view shows the loaded program in memory as addresses and assembler instructions.

        At line Indicates the location in the code where your program is stopped. In this case, it is at the main() function.

Step through the application

Use the controls provided in the Debug Control view to step through the application.

Continue Button - Click to continue processing code.

Pause Button - Click to interrupt or pause processing code.

Step Through button - Click to step through the code.

Step Over button - Click to step over source line.

Step Out button - Click to step out.

Step instruction - This is a toggle. Select this if you want the above controls to step through instructions.

  - Debug from main()

Disconnect from the debug connection

To disconnect from a debug connection, you can either right-click the connection and select Disconnect from Target or select the connection and in the Debug Control view toolbar click Disconnect button