DS-5 Sample Code

ARM DS-5 Development Studio provides several examples for Linux, including XaoS, threads, hello world and Gnometris, along with startup code for supported processors and demonstration code for TrustZone. 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-R family of processors. The examples usually contain a simple semi-hosted sorting example application along with necessary start up code including vector table, exception handlers and initialization code for different peripherals. The ARMv8 code is located in the archive file Bare-metal_examples_ARMv8.zip whereas the rest of the code is located in Bare-metal_examples_ARMv7.zip.

Cortex-A Processors

  • Cortex-A5MPCore Startup Example Code
  • Cortex-A7 Startup Example Code
  • Cortex-A8 Startup Example Code
  • Cortex-A9 Startup Example Code
  • Cortex-A9MPCore Startup Example Code
  • Cortex-A15 Startup Example Code
  • Cortex-A15MPCore Startup Example Code
  • Cortex-A17MPCore Startup Example Code
  • Startup Code Example for ARMv8 AArch64
  • Startup Code Example for ARMv8 AArch64 with an AArch32 application
  • Startup Code Example for Cortex-A53 and Cortex-A57

Cortex-R Processors

Note that bare-metal startup code includes vector table, exception handlers and the code to initialize MPU, cache, TCM and FPU.

  • Cortex-R4(F) Startup Example Code
  • Cortex-R5(F) Startup Example Code
  • Cortex-R7 Startup Example Code

Cortex-M Processors

Note that all the startup code is written in C and is linked with the small-footprint "microlib" library instead of the default C library.

  • Cortex-M0 Startup Example Code
  • Cortex-M0+ Startup Example Code
  • Cortex-M1 Startup Example Code
  • Cortex-M3 Startup Example Code
  • Cortex-M4 Startup Example Code
  • Cortex-M7 Startup Example Code

Bare-Metal Application Debug

These examples show you how to use DS-5 to debug complex bare-metal application, 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 up to four cores to find prime numbers, using shared memory and mutexes to arrange co-operation between the cores. The ARMv8 code is located in the archive file Bare-metal_examples_ARMv8.zip whereas the rest of the code is located in Bare-metal_examples_ARMv7.zip.

  • Fireworks Bare-metal Example for BeagleBoard
  • Fireworks Bare-metal Example for PandaBoard
  • Fireworks Bare-metal Example for ST-E Snowball
  • Fireworks Bare-metal Example for VE-Cortex-A9x1 FVP model or VE-Cortex-A9x4 FVP model using ARM Compiler 5 and ARM Compiler 6
  • Fireworks Bare-metal Example for ARMv8
  • Prime Numbers Example for Cortex-A15MPCore
  • Prime Numbers Example for VE-Cortex-A9x4 FVP model using ARM Compiler 5 and ARM Compiler 6
  • Prime Numbers Example for Versatile Express Cortex-A9x4 and PandaBoard 

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.
  • Application Rewind Example 1 for ARM Linux
    A simple C example to illustrate the use of Application Rewind to debug an ARM Linux application.
  • Application Rewind Example 2 for ARM Linux
    Another C example to illustrate the use of Application Rewind to debug an ARM Linux application, this time using watchpoints.
  • 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 the ARM Compiler 5.

  • Optimization 1 - Basics
    This example introduces some basic code size and performance optimization and measurement techniques for application software using the 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 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

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.

  • CoreSight Access Library

ITM

This example is intended to illustrate the use of ITM and DS-5 Debugger Event Viewer. The code for the example is located in the archive file Bare-metal_examples_ARMv7.zip.

  • ITM and Event Viewer Example for Versatile Express Cortex-A9x4

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