DS-5 Sample Code

Arm DS-5 Development Studio provides a large number of examples, including startup code for supported Cortex-A, R and M processors, bare-metal application debug examples, and Linux application debug and Linux kernel model debug examples. There are also examples that demonstrate Streamline and compiler optimization, Jython scripting in the debugger, Debug and Trace Services Layer (DTSL) and the CoreSight Access Library.  You'll also find bare-metal Hello World examples for a range of development boards which will run from the on-chip RAM. In this section, you can find the list of various categories of examples and the description of some of the individual examples.

DS-5 examples are part of the DS-5 installation and are located in one or more archive files inside <ds-5 installation directory>/examples directory. The Importing DS-5 examples tutorial shows how to import and run these sample code projects.


Bare-Metal Startup Code

DS-5 provides bare-metal (no operating system) startup code examples for Cortex-A, Cortex-R and Cortex-M family of processors. The examples typically include a vector table, exception handlers, cache/MMU or TCM/MPU initialization, and FPU/NEON initialization code, together with a simple application.  The examples can be compiled with Arm Compiler 5 and Arm Compiler 6.  Examples for Armv7 processors are located in the archive file Bare-metal_examples_ARMv7.zip, and for Armv8 processors are located in Bare-metal_examples_ARMv8.zip.

Cortex-A Processors

  • Cortex-A5MPCore Startup Code
  • Cortex-A7 Startup Code
  • Cortex-A8 Startup Code
  • Cortex-A9 Startup Code
  • Cortex-A9MPCore Startup Code
  • Cortex-A15 Startup Code
  • Cortex-A15MPCore Startup Code
  • Cortex-A17MPCore Startup Code
  • Cortex-A32 Startup Code
  • Startup Code for Armv8-A AArch64, including Cortex-A35, Cortex-A53, Cortex-A57, Cortex-A72, Cortex-A73
  • Startup Code for Armv8-A AArch64 with an AArch32 application
  • Startup Code for Cortex-A55 and Cortex-A75

Cortex-R Processors

  • Cortex-R4(F) Startup Code
  • Cortex-R5(F) Startup Code
  • Cortex-R7 Startup Code
  • Cortex-R8 Startup Code
  • Cortex-R52 Startup Code

Cortex-M Processors

  • Cortex-M0 Startup Code
  • Cortex-M0+ Startup Code
  • Cortex-M1 Startup Code
  • Cortex-M3 Startup Code
  • Cortex-M4 Startup Code
  • Cortex-M7 Startup Code
  • Cortex-M23 Startup Code (with Security Extensions)
  • Cortex-M33 Startup Code (with Security Extensions)

Bare-Metal Application Debug

These examples show you how to use DS-5 to debug complex bare-metal applications, running on one or more cores. They use either Fireworks or Prime Numbers as an example application. Fireworks application produces a graphical simulated fireworks display and shows a banner on the screen. Prime Numbers is a bare-metal, semihosted example written in C and assembler that uses multiple cores to find prime numbers, using shared memory and mutexes to arrange co-operation between the cores.  The examples can be compiled with Arm Compiler 5 and Arm Compiler 6.  Examples for Armv7 processors are located in the archive file Bare-metal_examples_ARMv7.zip, and for Armv8 processors are located in Bare-metal_examples_ARMv8.zip.

  • Fireworks Bare-metal Example for BeagleBoard, PandaBoard and ST-E Snowball
  • Fireworks Bare-metal Example for VE-Cortex-A9x1 FVP model or VE-Cortex-A9x4 FVP model
  • Fireworks Bare-metal Example for Armv8-A
  • Prime Numbers Example for Cortex-A15MPCore
  • Prime Numbers Example for VE-Cortex-A9x4 FVP model
  • Prime Numbers Example for Versatile Express Cortex-A9x4 and PandaBoard
  • ITM and Event Viewer Example for Versatile Express Cortex-A9x4
  • ITM and Event Viewer Example for Cortex-M4 on MPS2

Linux Kernel and Application Debug

DS-5 comes with examples to illustrate debugging of Linux kernel modules and applications. The code for these examples is located in the archive file Linux_examples.zip.

Kernel Debug

  • Debugging Kernel Modules
    This example uses a simple character device driver to illustrate the support for debug of Linux kernel modules.

Linux Application Debug

DS-5 provides tools that support Arm Linux application development and debug. The below examples illustrate such support.

  • "Hello World" console application for Arm Linux
    This is a simple "Hello World" example that illustrates building a console application for Arm Linux.
  • Arm Linux Application Development and Debug
    This example, based on the "Gnometris" game, illustrates support for debug of a complex application.
  • Debugging Multi-Threaded Arm Linux Applications
    Threads example to illustrate support for debug of multi-threaded Arm Linux applications.

Streamline

The below examples illustrate how to use Streamline to analyze system performance. The code for these examples is located in the archive file Linux_examples.zip.

  • Performance analysis of Arm Linux Applications using Streamline
    This example illustrates Streamline performance analysis, including annotation, using the example "Xaos" application.
  • Streamline Cache Test example
    This example illustrates the use of Streamline to reveal cache efficiency by way of simple instrumented C code.
  • Streamline Annotations example
    This example illustrates the use of Streamline annotations by way of simple instrumented C code.

Compiler Optimization

DS-5 has two examples showing different code optimization techniques using Arm Compiler 5.

  • Optimization 1 - Basics
    This example introduces some basic code size and performance optimization and measurement techniques for application software using Arm Compiler 5, and is illustrated by a simple bare-metal semihosted "sorts" example application.
  • Optimization 2 - Additional Techniques
    This example introduces some additional optimization techniques for application software using the Arm Compiler 5, including multi-file optimization, linker feedback, floating point and NEON auto-vectorization. It also describes some ways to estimate and reduce Stack and Heap usage.

Debugger Scripting With Jython

These examples show how to use Jython to script DS-5 Debugger. The code for these examples is located in the archive file Jython_examples.zip.

  • Jython MD5 Hash Example
  • Jython Performance Monitor Unit (PMU) Example
  • Jython Progress Monitor Example
  • Jython State Display Example
  • Jython Translation Table Decoder Example

DTSL Usage

These examples demonstrate software development for DS-5 Debugger's Debug and Trace Services Layer (DTSL). The code is located in the archive file DTSL_examples.zip.

  • DTSL Example Configdb Example
  • DTSL Java Example
  • DTSL Jython Example
  • DTSL Jython JTAG SVF Example
  • DTSL Jython Show Registers Example
  • DTSL Probe Vcc Example
  • DTSL STM Decode Example
  • DTSL STM File Decode Example
  • DTSL Trace Dump Example
  • DTSL Trace Stats Example

TrustZone

This example demonstrates the support for TrustZone in DS-5 Debugger, targeted at Versatile Express Cortex-A9x4 and VE-Cortex-A9x1 FVP model. The code for the example is located in the archive file Bare-metal_examples_ARMv7.zip.

  • TrustZone Example for Versatile Express Cortex-A9x4 and VE-Cortex-A9x1 FVP model

CoreSight Access Library

This example demonstrates CoreSight Access Library. The CoreSight Access Library API enables directly programmable access with CoreSight devices on your target. This allows, for example, program execution trace to be captured in a production system without the need to have an external debugger connected. The saved trace can be retrieved later and loaded into DS-5 Debugger for analysis.The library supports a number of different CoreSight components on several target boards as described in the readme.md file (part of the example). An example Linux application ("tracedemo") that exercises the library is provided. As it runs, tracedemo creates several files on the target, including the captured trace. Ready-made example capture files are provided that can be loaded into DS-5 Debugger. The code for the example is located in the archive file CoreSight_Access_Library.zip.


Scalable Vector Extension (SVE)

These examples demonstrate the use of the Scalable Vector Extension (SVE) for Armv8-A. The code for the example is located in the archive file SVE_examples.zip.


Development Board Debug in Bare-metal mode

Bare-metal software development examples illustrate compilation with the Arm Compiler 5 and bare-metal debug connection to supported boards. The code is located in the archive file Bare-metal_boards_examples.zip. These examples show basic connection and debug illustrated by a simple bare-metal semihosted "hello world" example application loaded into on-chip RAM.

  • Altera Arria 10 SoC RAM-based Hello World Example
  • Altera Cyclone V SoC RAM-based Hello World Example
  • Atmel AT91SAM9G15-EK RAM-based Hello World Example
  • Atmel AT91SAM9G20-EK RAM-based Hello World Example
  • Atmel AT91SAM9G45-EK-ES RAM-based Hello World Example
  • Atmel AT91SAM9M10-G45-EK RAM-based Hello World Example
  • Atmel AT91SAM9X25-EK RAM-based Hello World Example
  • Atmel ATSAMA5D35-EK RAM-based Hello World Example
  • BeagleBoard RAM-based Hello World Example
  • BeagleBoard-xM RAM-based Hello World Example
  • Freescale Vybrid VF6xx (Cortex-A5) RAM-based Hello World Example
  • Freescale Vybrid VF6xx (Cortex-M4) RAM-based Hello World Example
  • Freescale i.MX28 EVK RAM-based Hello World Example
  • Freescale i.MX50 EVK RAM-based Hello World Example
  • Freescale i.MX51 PDK RAM-based Hello World Example
  • Freescale i.MX53 Quick Start Board RAM-based Hello World Example
  • Freescale i.MX6Q RAM-based Hello World Example
  • Icytecture i.MX35 Starter Board RAM-based Hello World Example
  • LOGIC PD OMAPL138 eXperimenter Kit RAM-based Hello World Example
  • LOGIC PD ZOOM AM1808 EVM RAM-based Hello World Example
  • LOGIC PD ZOOM AM3517 eXperimenter Kit RAM-based Hello World Example
  • LOGIC PD ZOOM i.MX27 LITEKIT RAM-based Hello World Example
  • LOGIC PD ZOOM i.MX31 LITEKIT RAM-based Hello World Example
  • LOGIC ZOOM OMAP34x-II MDP RAM-based Hello World Example
  • Mistral OMAP AM37x EVM RAM-based Hello World Example
  • NXP FDI LPC3250 RAM-based Hello World Example
  • PandaBoard RAM-based Hello World Example
  • ST SPEAr300 RAM-based Hello World Example
  • ST SPEAr310 RAM-based Hello World Example
  • ST SPEAr320 RAM-based Hello World Example
  • ST SPEAr600 RAM-based Hello World Example
  • Samsung Exynos 4210 RAM-based Hello World Example
  • Samsung S5PC100 SMDK RAM-based Hello World Example
  • Samsung S5PC110 SMDK RAM-based Hello World Example
  • Samsung S5PV210 SMDK RAM-based Hello World Example
  • Silica Phytec i.MX35 RAM-based Hello World Example
  • Spansion Traveo RAM-based Hello World Example
  • Spectrum Digital AM1707 EVM RAM-based Hello World Example
  • Xilinx Zynq 7000 RAM-based Hello World Example
  • nVidia Tegra 250 developer kit RAM-based Hello World Example