6.17 About DS-5 Debugger support for overlays

Overlaying is a programming method that allows applications to share execution regions of memory between different pieces of code at runtime. A piece of code can be transferred to the overlay region to be executed when needed. This piece of code is replaced with another when needed.

Code does not need to be stored in memory and could reside in other storage such as off-chip flash memory. Embedded systems, especially systems without support for virtual memory addressing and systems with limited memory, sometimes use overlays.

An overlaid application consists of:

As a developer, you must decide which functions from your application are used in overlays. You must also decide which functions are used in the same overlay.

You can specify the functions to overlay by annotating the function declarations in your source code. The annotation indicates which overlay each function must be in.

During compilation, the linker assigns overlays to a particular region. When overlays are loaded, it can only be loaded into that region. The linker also detects direct calls between overlays, and between overlays and non-overlaid code. The linker then redirects the calls through veneers, which call the overlay manager to automatically load the target overlay.

DS-5 Debugger automatically enables overlay support on the presence of linker generated tables and functions as described by the following symbols:

After loading your overlay-enabled application in DS-5, you can work with overlays from both the command-line console and from the user interface:

See the overlay_manager example that is provided with DS-5 for a reference implementation of overlays.

Non-ConfidentialPDF file icon PDF versionARM DUI0446Z
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.