Getting Started with ARM DS-5 CE and ARMv8 Foundation Platform

This tutorial takes you through the process of downloading and installing ARM DS-5 Community Edition (CE). It then guides you through the process of creating a simple bare-metal "Hello World" application and finally running it on the ARMv8 Foundation Model provided with DS- 5 CE.

Getting started with ARM DS-5 CE and ARMv8 Foundation Platform

This tutorial takes you through the process of downloading and installing ARM DS-5 Community Edition (CE). It then guides you through the process of creating a simple bare-metal "Hello World" application and finally running it on the ARMv8 Foundation Model provided with DS- 5 CE.

Download and install DS-5 CE

DS-5 is available for both Windows and Linux hosts. See DS-5 System Requirements for a list of supported hosts.

Download the appropriate DS-5 installer for your host (either Windows or Linux).

Download DS-5 Community Edition

Extract the files from the downloaded .zip file and run setup.exe. Then follow the simple on-screen installation instructions.

Once installed, on Windows 7 platforms, you can find DS-5 under Start menu > All Programs > ARM DS-5 Community Edition 

Extract the installer from the downloaded archive file, run (not source) install.sh and follow the on-screen instructions. The installer unpacks DS-5 into your chosen directory, and optionally installs device drivers and desktop shortcuts.

Note: The installer includes device drivers that require you to run with root privileges.

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.

    Close Welcome Page

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 little-endian) from Linaro. To download it see: linaro.org/downloads.

  1. In DS-5, click Window > Preferences and expand the 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.

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.spec.

    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 Wolrd.axf" in the Debug folder. You can inspect the header, sections, disassembly, 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