You are on page 1of 10

Advanced development and debugging of ARM-based devices

using Atollic TrueSTUDIO Pro development tools


As any builder, handyman, or software developer knows, the right tools make all the difference in
meeting deadlines, working efficiently and delivering a quality product. In embedded development the
quality of your tools often determines the length and difficulty of the project schedule, particularly
when it comes to debugging, test, and software optimization.

Most developers will acknowledge that writing In this paper we will show you how the right tools
code is the easy part. But a nasty bug—whether it can help you efficiently develop high quality
is a race condition, a seemingly random artifact or software on ARM-based microcontrollers using the
an unpredictable crash condition can leave a Atollic TrueSTUDIO Pro C/C++ IDE. Since most
developer ready to tear his hair out. This is due in development tools give you an editor, compiler,
large part to ever-increasing system complexity as linker and debugger, we are going to spend time in
competitive pressure and market opportunity this article on some of the advanced features that
introduces new features within already tight are not usually available in embedded tool chains.
delivery schedules. We will touch on tools to help you improve the
Your challenge as the developer is to find quality of your code and look at advanced
development tools you can trust: tools that are debugging capabilities using powerful software
easy and intuitive to use with powerful features visualization and analysis.
that can assist you in writing better code and in
resolving difficult problems or isolating hard-to-
find bugs; and a knowledgeable and responsive
tech support team to assist when you can’t figure
out how to use the tool in your situation.
Overview 1. The individual review phase where the
Atollic® TrueSTUDIO® Pro development are value- reviewers study the source code written by
added features that can be unlocked in the colleagues and make comments. Potential
TrueSTUDIO IDE. These are the kind of tools you problems detected can for example be logic
want on your desktop if you are serious about your errors, portability problems, coding standard
code and about keeping your project on track. violations, optimization problems, etc.
Each identified problem can then be assigned a
Some of these powerful features include project
proposed level of severity.
wizards, parallel compilation, build analyzer, and
support for CMSIS-PACK, plus RTOS-aware 2. The team review phase where reviewers discuss
debugging with a built-in crash analyzer, support what to do with each identified problem area
for multicore and multi-processor debug, event-, in a code review meeting, and possibly assign
data- and instruction tracing, peripheral register specific team members to rework the code.
viewers, and real-time variable watch. TrueSTUDIO The code review meeting may, for example,
Pro also includes team collaboration features, such decide a particular review comment is invalid,
as source code review, issue management, and is valid but shall not be fixed, or is valid and
version control system integration. must be corrected.
3. The rework/problem fixing phase where select
Source Code Reviews team members resolve the problems that have
Peer review can help you reduce bugs and defects been assigned to them. As each item is
early in the development. The principle is to have a corrected and ticked off, the project manager
formal process where developers each other’s and other team members can monitor which
code at various times during development, such as items have been corrected and which still need
before an alpha or beta release, or after attention.
implementing or rewriting a key feature of your
software.
Atollic TrueSTUDIO® Pro is one of the first
embedded systems IDEs to integrate features for
source code reviews and to run code review
meetings as a standard feature. Select the code for
review and assign a reviewer to comment on the
code, indicating the type of problem and the
severity. TrueSTUDIO then supports review
The Code Review Status Screen organizes problem
meeting activities and tracks the resolution of each
areas identified by internal reviewers and tracks the
comment.
resolution of each item
Many different categories of problems can be
detected including, logic errors, portability
problems, coding standard violations, optimization
problems, etc. Each identified problem can then be
assigned a proposed level of severity.
A source code review is typically performed in
three stages:

© 2016 Atollic AB -2- For more information contact sales@atollic.com


Project Wizard and CMSIS-PACK Atollic recognize developers are struggling to cope
Atollic TrueSTUDIO has an easy-to-use project with ever-increasing demands and less time to
wizard, and supports ARM’s standardized CMSIS- spend on each specific task.
PACK format for distribution of software TrueSTUDIO’s parallel compilation feature allows
components like example projects, board support, multiple files to be compiled simultaneously, taking
etc. advantage of today’s multicore host machines. This
can dramatically reduce build times, in particular
for large projects with many source code files.

Build Analyzer
The TrueSTUDIO Pro build analyzer provides
developers with an unprecedented view into the
generated build image file. This novel feature
presents information on memory regions and
memory details in a highly visual fashion. The data
is pulled automatically from the .elf file (and the
.map file, if available)
Use it to assist in code- or speed optimization
efforts and to quickly see memory utilization—
both on- and off-chip.
Future-proofing with support for CMSIS-PACK
Developers can also use the build analyzer to verify
With integrated CMSIS-PACK support, Atollic the location of various regions (e.g. bootloaders,
TrueSTUDIO users enjoy vendor-neutral access to interrupt vector tables, interrupt handlers, etc.) are
readymade software components from 3rd party set appropriately.
suppliers. You can even wrap your own software
components into CMSIS-PACK files and distribute
internally within your organization.

Parallel Compilation

Ge

© 2016 Atollic AB -3- For more information contact sales@atollic.com


Advanced Debugging Tools
Any developer with sufficient experience knows
that some bugs can be incredibly difficult to find.
This can cripple a project release schedule or add
costly field upgrades. A modern debugger needs to
include sophisticated capabilities for powerful
system analysis and advanced debugging to help
you avoid these scenarios.
Gone are the days when simple single-step/run-to-
breakpoint/printf-style debugging was sufficient
for reasonably sized projects. Today’s debugger
needs to include features for event-, data- and
instruction tracing to capture execution history for
later analysis, crash analyzers to help you work out
why your software brought the CPU into a fault
state, RTOS-specific kernel aware debugger
features, etc. Multiple processors or multiple cores
adds even more to the list of debugger capabilities.
Crash Analyzer for Cortex-M cores
What do you do after a system crash? Diagnosing
the reasons behind a system crash without good
tool support can be a time-intensive and an
incredibly frustrating effort. The system may
occasionally crash for no apparent reason, often
very rarely and perhaps only after hours of
execution, for example due to a sensor sometimes The Hard Fault Analyzer for ARM Cortex-M can
sending out-of-range data. These types of show where and why the system crashed. The root
problems are very difficult to find. CPU faults occur cause and location of system crashes can be
due to the software bringing the CPU into an easily identified in seconds, rather than hours
invalid state, for example due to memory
management problems, executing illegal
instructions or program errors like division by zero
or pointer errors, or various types of bus faults
such as accessing a word on an unaligned address.
TrueSTUDIO Pro is the first embedded IDE to
include a crash analyzer, automatically telling you
what brought the system into a fault state. In
addition to visualizing where the system crashed,
the TrueSTUDIO Pro crash analyzer also tells you
why it happened and under what circumstances it
crashed.

© 2016 Atollic AB -4- For more information contact sales@atollic.com


Advanced System Analysis Atollic TrueSTUDIO Pro includes a state-of-the-art
It is now possible to have greater visibility into the implementation of SWV real-time tracing with
dynamics of complex real-time embedded powerful features for advanced system analysis,
applications than ever before. This visibility is including real-time graphical charts.
extremely useful not only in the increasingly  Real-time display of variable values or
complex applications typically found in today’s memory address value
products, but in applications that cannot be halted  History log with all reads or writes to a
for the debugging process. location, and what code line made them
 Interrupt and exception tracing with
Atollic TrueSTUDIO Pro provides advanced
execution time statistics
features for powerful debugging using
 Measuring execution time between two
event/data/software-tracing with the Serial Wire
independent locations in the code
Viewer (SWV), Serial Wire Output (SWO) and
Instrumentation Trace Macrocell (ITM)  Graphical real-time charts
technologies. These technologies combined allow  printf() redirection to 32 parallel and
various types of data from the running system to independent ITM ports
be output in real-time during full execution speed,  Software tracing using ITM
through the JTAG cable. instrumentation

Being able to visualize the time evolution of


specific variables and other events as the
application executes can give you valuable insights
into: Serial Wire Viewer technology gives
unique insight into the performance
 Whether or not control algorithms are of your running system.
functioning properly
 Whether or not memory
locations are being
corrupted inadvertently
 Whether or not pointers
are behaving as expected
 Locating sections of code
that require optimization
 Locating specific lines of
code that are causing
memory corruption
 Determining whether or
not interrupts are firing
as expected
 The internal behavior of
real-time operating
systems and other
middleware

© 2016 Atollic AB -5- For more information contact sales@atollic.com


For example, the data trace view visualize variable- recording the history of the execution flow for
or memory-values in real-time during full execution offline analysis.
speed non-intrusively, and it provides an accurate
history log of all reads- and writes- to a particular The instruction trace is particularly valuable in
location. A double-click on a particular read or systems where execution cannot be allowed to
write in the memory access history log brings you stop on a breakpoint, for example motor control
to the code line who made the read or write to applications. Using the instruction trace,
that variable or memory location. It is thus developers can anyhow understand the execution
incredibly easy to find out what code line flow when debugging the application. Due to the
inadvertently overwrites a variable value huge amount of data recorded (100MB binary
occasionally, for example. packed or 5-10GB for human readable format, for
each second of execution time on a Cortex-M4)
advanced start/stop triggers
or trace breakpoint triggers
typically control when trace
recording should be started
and stopped, to reduce the
massive amount of data that
is collected.

Developers can additionally True


“zoom” in- and out- to get
various levels of details, such
as function trace, C trace,
Mixed mode trace or
Assembly only trace.
The real-time event logs can be used to study how
PC Compiler and Debugger
interrupts fire, or their nesting. For execution time In addition to the ARM cross compiler and
measurement and optimization, statistical profiling debugger, Atollic TrueSTUDIO also includes an x86
and execution time measurement capabilities are Windows PC compiler and debugger for host PC
included; for example, by providing bar charts of development. Using the integrated PC tools,
the execution time of various C functions, developers can easily develop PC command line
measuring the execution time between two utilities that connect to the target board, for
independent parts of the software, or to study example for target configuration or log uploading.
interrupt handler min/max/average execution Another popular use of the integrated PC tools is
times, etc. TrueSTUDIO also includes support for to recompile parts of the embedded ARM
software tracing using the ITM interface that is application into a Windows PC command line
part of SWV, enabling redirection of printf() output application.
to a debugger console over the JTAG cable, for
example. This can be of great use when you develop and test
sensor algorithms. A Windows PC-build of the
In addition to the SWV event- and data- tracing, a embedded algorithm can be tested with well-
modern debugger of today needs to support known data from a pre-created data file; as
ETM/ETB/MTB instruction tracing too, thus algorithm testing can be difficult with unknown
live sensor data in the target.

© 2016 Atollic AB -6- For more information contact sales@atollic.com


Atollic TrueSTUDIO fully supports dual-core and RTOS-Aware Debugging
multi-processor debugging; also across ARM and Because commercial development tools are not
PC boundaries. Developers can, for example, usually developed for use with a specific RTOS, the
debug both sides of a communications protocol at debugger views are generic and are unable to
the same time, and it doesn’t matter if it is an ARM- display kernel-specific data structures in any
ARM or an ARM-PC scenario. meaningful way.
With kernel-aware debugging capability when the
debugger hits a breakpoint you can view the state
of RTOS objects such as tasks, semaphores,
mutexes and timers in much greater detail. When
you combine Kernel-aware debugging and Serial
Wire Viewer event- and data- tracing, you can get
even more insights because you do not have to
stop the system to gather meaningful data.

© 2016 Atollic AB -7- For more information contact sales@atollic.com


Integrated Version Control System Whether you are a single developer or you have a
client large, geographically dispersed team, version
control offers significant benefits.
As complexity and code size grow for each year, so
Atollic TrueSTUDIO integrates code management
does the problem of managing software and
features right into the C/C++ development
development efforts. As the development
environment and provides a deeply integrated GUI
progresses over time, it is typical for thousands of
client for version control tools like Subversion and
code changes to be made.
GIT.
If version control methodology is not used, it very
Because you never have to leave the IDE you can
quickly becomes unclear who made what changes,
benefit from substantial productivity increases
when and why. As time goes on valuable
over a separate, external version control system
information about what the original code base
client. You can easily track changes over time,
looked like can be lost forever, making it
revert back to older code implementations,
impossible to revert to a previous code state of
compare different versions or branch- and merge
known working code.
code bases developed in parallel.

TrueSTUDIO version control view showing Subversion (SVN) integration

© 2016 Atollic AB -8- For more information contact sales@atollic.com


Integrated Bug Tracking and Issue A colleague can then for example see what your
Management client debugger state looked like when you found the
bug. Atollic TrueSTUDIO also brings context
Atollic TrueSTUDIO is the first embedded IDE to
awareness to the bug report or feature request. If
integrate GUI clients that connect to popular bug
you work on say 3 files when solving a bug, those 3
database-, feature request- and issue management
files will be automatically opened and the cursor
systems like Trac, Bugzilla or Mantis.
placed on the same places like last time, if the
Using one of the integrated issue database clients, same bug report is opened weeks or months later.
you can easily add new bug reports or feature
The issue management tracking system is a perfect
requests, change status of them or query the
vehicle for planning and organizing the work in
database for issues or feature requests with
software development teams, and many
various filters, such as all resolved bugs in a specific
development teams browse the issue
software release, all work tasks planned for an
management system in their weekly team
upcoming release or all feature requests assigned
meetings to discuss new bug reports, and prioritize
to myself for implementation.
to-do items like bug reports or feature requests in
It is even possible to add screenshots (that can be their weekly work planning.
cropped and annotated with arrows and text) as a
file attachment filed with bug reports.

TrueSTUDIO features an integrated bug tracking client

© 2016 Atollic AB -9- For more information contact sales@atollic.com


Summary that can add to the stress of your job and
Many factors conspire together to make jeopardized the success of your project.
embedded development challenging. More We all know that good tools can make a dramatic
complex application demands, more peripherals, difference in developing code, especially in debug
geographically dispersed teams or reduced team and test. Affordable professional tools such as
size, shorter development schedules, and Atollic TrueSTUDIO Pro can help you write and
demanding bosses are just some of the variables maintain higher quality code and dramatically
reduce the time and frustration of debugging.

TRADEMARK
Atollic, Atollic TrueSTUDIO and the Atollic logotype are trademarks or registered trademarks owned by Atollic. ECLIPSE™ is a registered trademark of
the Eclipse foundation. All other product names are trademarks or registered trademarks of their respective owners.

© 2016 Atollic AB - 10 - For more information contact sales@atollic.com

You might also like