Software rarely works completely correctly the first time that you run it.
CoreSight technology from Arm provides solutions for debug and trace of complex SoC designs to let you investigate the operation of your code:
- Debug lets you single-step through instructions, inspecting the values of registers and memory during program execution. Or you can set breakpoints to pause execution at particular places in your code. Debug usually involves halting execution, so it may not be appropriate for investigating dynamic problems, such as timing issues.
- Trace provides continuous collection of system information for later analysis. Execution trace generation macrocells are optional debug components that you can integrate into your processor to produce trace output, software can be instrumented with dedicated trace generation, and some peripherals can generate performance monitoring trace streams. Because trace does not interrupt execution, it is useful for investigating dynamic problems.
Trace and debug are used together at all stages in the design flow from initial platform bringup, through software development and optimization, and even to in-field debug or failure analysis.
The following video shows how to use the trace functionality of Arm Cortex-M0 processors with Keil MDK:
Some tools are available to help you debug your software:
- Simulation models like Cycle Models, Fast Models, and Fixed Virtual Platforms let you develop software for Arm IP even when you don't have access to hardware.
- If you do have access to hardware, debug probes like DSTREAM and ULINK let you look inside the system that you are debugging. This means that you can collect trace information, inspect register values, and read memory locations.
- Arm Development Studio includes Arm Debugger. The Arm Debugger helps you get to the root of software bugs throughout your development process.
- For application development on Linux:
- GDB (the GNU Project Debugger) is a standard debugger used by the GNU software community.
- Arm Development Studio supports GDB-based application debugging via gdbserver for 32- and 64- bit applications.
- Arm DDT (part of Arm Allinea Studio) is a graphical debugger for C/C++/Fortran applications running on Arm servers or Arm systems. It supports all major 64-bit Linux distributions and includes sophisticated memory debugging and highly scalable multi-process debugging.
- For application development on Android, ADB (Android Debug Bridge) provides debug capabilities and is supported by Arm Development Studio.
Debug with simulation models
- The Debugging Hello World in C on a Fixed Virtual Platform tutorial shows how to debug software using a Cortex-A9 Fixed Virtual Platform (FVP).
- The New Model Connection video shows you the steps necessary to configure Arm Debugger for use with your virtual platform.
- The Application debug with Arm Debugger tutorial shows how to step through your code line-by-line, examining disassembly instructions and memory contents as you go.
- The Memory access within Arm Debugger video provides an introduction to accessing memory with the Arm Debugger.
Debug with hardware
Arm Development Studio ships with pre-loaded debug configurations and examples for many popular devices. However, if you are designing your own SoC or are developing software for a less popular ASIC, Arm Debugger and DSTREAM debug probe can help to create a new device configuration.
- This New Hardware Connection video shows you the steps that you need to follow to connect the Arm Debugger to any hardware target.
- This Debugging on bare-metal targets using DS-5 and GCC compiler tutorial shows you how to set up your project to use the GCC bare-metal compiler. The tutorial then guides you through creating a simple bare-metal Hello World application, and running it on an Altera Cyclone V SoC.
- This Vybrid Tower System Debug Session tutorial guides you through creating a debug session to the Cortex-A5 device on the Vybrid board.
- Tracing using DS-5 Debugger from the Command Line shows you how to drive DS-5 Debugger from the command line. This can help to save significant time if you are automating tests or carrying out repetitive tasks.
- This Using the CoreSight ELA-500 Embedded Logic Analyzer with Arm DS-5 tutorial shows how to debug a real-world deadlock scenario caused by a bus transaction hang, using a Cortex-A72-based system.
Linux and Android debug
For application development on Linux or Android, it is common to use GDB (the GNU Project Debugger) or ADB (Android Debug Bridge). These methods of debug do not make a connection into the lower level CoreSight architecture of a system and instead rely on a server to allow software debug. GDB is integrated into Arm Development Studio.
- The Debugging a Linux Symmetric Multi-Processing (SMP) Kernel tutorial shows how to use Arm Development Studio to debug a Linux SMP kernel.
- The Linux application debug on a development board tutorial shows how to use gdbserver to debug a Linux application.
- The Linux Application Debugging using an FVP simulation model tutorial takes you through the process of creating a simple "Hello World" Linux application and then loading the application on a Cortex-A9 Fixed Virtual Platform (FVP) model running Arm embedded Linux. The Cortex-A9 FVP model is provided with DS-5.
- The Debugging Android native C/C++ applications and libraries tutorial describes how to debug the hello-neon application provided with the Android Native Development Kit (NDK). It uses the Android SDK Platform 2.2 and the Android emulator as the target.
Arm DDT (part of Arm Allinea Studio) is a graphical debugger for C/C++/Fortran applications running on Arm servers or Arm systems. It supports all major 64-bit Linux distributions and includes sophisticated memory debugging and highly scalable multi-process debugging.