Getting Started with ARM DS-5 Development Studio

https://developer.arm.com/tools-and-software/embedded/legacy-tools/ds-5-development-studio/resources/tutorials/getting-started-with-ds-5-development-studio

Getting Started with DS-5 Development Studio

This tutorial takes you through the process of downloading and installing the evaluation version of Arm DS-5 Development Studio. It then guides you through creating a simple bare-metal "Hello World" application and finally running it on a debug configuration for a Cortex-A9 Fixed Virtual Platform (FVP) provided with DS- 5.

Getting Started with DS-5 Development Studio

This tutorial takes you through the process of downloading and installing the evaluation version of Arm DS-5 Development Studio. It then guides you through creating a bare-metal "Hello World" application and finally running it on a debug configuration for a Cortex-A9 Fixed Virtual Platform (FVP) provided with DS- 5.

Downloading and Installing DS-5

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

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

Note: During installation, you might receive warnings such as "Windows can't verify the publisher of this driver software" you can safely ignore these warnings and continue with the installation.

When installed, on Windows 10 platforms you can find DS-5 under Start menu > Arm DS-5 <version>

Starting DS-5 and Setting up your Workspace

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

 

      3. Select Use this as the default and do not ask again option and click OK
      4. If you are using DS-5 for the first time, then the No License Found dialog is displayed.
      5. Click Open License Manager to use the License Manager to add a license.

Obtaining a License

After installing DS-5, you have to obtain a license to use it. For this tutorial, we are going to use a 30-day evaluation license that allows you to use DS-5 Ultimate Edition for 30 days without any restrictions.

Note: You need to be connected to the internet and have an Arm developer (Silver) account to obtain a DS-5 evaluation license.

  1. In the No Licenses Found dialog, click Open License Manager.

  2. In the Arm License Manager dialog, click Add License.

  3. In the Add License dialog, select Generate a 30-day evaluation license for DS-5 Ultimate Edition option and click Next.

  4. In the Choose network interface dialog, select a network interface.

    Note: Arm recommends selecting a physical network interface. If a virtual interface is selected, the license stops working if the MAC address of the interface is changed.

     

  5. In the Developer account details dialog, enter your Arm developer (Silver) account details. If you do not have an account, create one.

     

  6. Click Finish.

    When the license is successfully registered, the 30-day evaluation license and the toolkit that is available to you are visible in the Arm License Manager.

     

  7. Close the Arm License Manager and in the Confirm Restart Eclipse dialog, click Restart Eclipse. This restarts Eclipse and brings up the DS-5 Welcome Page.
  8. Either close the Welcome page, or click Go to workbench to view the full DS-5 IDE.

 

You are now ready to use DS-5.

Creating a simple Hello World C program for a bare-metal target

After installing DS-5 and obtaining a license, this tutorial then takes you through creating, configuring, and building a simple bare-metal program.

To run your application when it is built, this tutorial then takes you through the steps of configuring a debug connection to a system model implemented in software. These models are called Fixed Virtual Platforms (FVP) and some are provided with DS-5. This tutorial uses the VE_Cortex_A9x1 FVP model which is based on the Cortex-A9 processor.

Creating a New 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 HelloWorld as the name of your project.
    2. Under Project type, select Executable > Hello World ANSI C Project.  
    3. Under Toolchains, select Arm Compiler 6.

       A screenshot of creating a DS-5 ANSI C Hello World project

      Learn more about the Arm Compiler toolchain.

    4. Click Finish to create a C project called Hello World.

      You can view the project in the Project Explorer view.

      Project Explorer - Hello World

Specifying a RAM Base Address

To load and execute the application on the target, before compiling the application, we need to tell the linker the target RAM base address. This ensures that the application is built correctly for the particular target.

The VE global model memory map contains the memory address details required for the VE FVP model used in this tutorial.

We can see that the memory address range for VE FVP models (4GB DRAM (in 32-bit address space)) is between 0x80000000 and 0xFFFFFFFF. This gives us the RAM base address as 0x80000000.

  1. In Project Explorer, right-click the project and select Properties.
  2. In the Properties dialog:
    1. Browse to C/C++ Build > Settings.
    2. Under the Tool Settings tab, browse to All Tools Settings > Target, and from the Target CPU drop down select Cortex-A9.
    3. Under the Tool Settings tab, browse to All Tools Settings > Target, and from the Target FPU drop down select No FPU.
    4. Under the Tool Settings tab, browse to Arm Linker 6 > Image Layout.
    5. In the RO base address (--ro_base) field, enter 0x80000000.

    1. Click OK to close the dialog and apply the changes.

Building the Project

In the Project Explorer view, right-click on the Hello World project and select Build Project.

You can view the output image HelloWorld.axf in the Debug folder under the HelloWorld project.

The .axf file contains both the object code and debug symbols that enable the debugger to perform source-level debugging.

Debug the application on a Fixed Virtual Platform (FVP)

When you have created the project and built the code, launch the debugger to run the application on one of the Fixed Virtual Platforms (FVP) provided with DS-5.

For this tutorial, we use a Cortex-A9 Fixed Virtual Platform (FVP) which is provided with DS-5.

Create a DS-5 Debug Configuration and Connecting to an FVP

  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.

       

      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, HelloWorld_FVP.
    2. In the Connection tab, under Select Target, browse and select Arm FVP (Installed with DS-5) > VE_Cortex_A9x1 > Bare Metal Debug > Debug Cortex-A9.

       

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

       

      The Workspace contains the HelloWorld.axf application file you created when you built the Hello World project.

      Note: Ensure that the Load symbols option is selected.

    4. Select HelloWorld.axf.

       

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

       

    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.

      Hello world code editor view

    8. ClickContinue Button to continue running the application.

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

      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.

        Commands view

      • C/C++ Editor view shows the active C, C++, or Makefile. The view is updated as you edit these files.

        Hello world code editor view

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

        Disassembly view

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

      • Memory view shows how the code is represented in the target memory.

        For example, to view how the string Hello World from the application is represented in memory:

        1. Open the Memory view.
        2. In the Address field, enter 0x80000000 and press Enter on your keyboard. The view displays contents of the target's memory.
        3. Select and highlight the words Hello World.

        Memory view

        In the above example, the Memory view displays the hexadecimal values for the code, and also the ASCII character equivalent of the memory values which enable you to drill down into the details of the code.

Step Through the Application

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

 

Continue Button - Click to continue executing code.

Pause Button - Click to interrupt or pause executing 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.

Disconnect from the Debug Connection

To disconnect from a debug connection, you can:

  • Right-click the connection and select Disconnect from Target,
  • or select the connection and in the Debug Control view toolbar click Disconnect button,
  • or double-click on the selected connection.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章