ARM Technical Support Knowledge Articles

Debugging a non-RM enabled application using the rm.axf demo

Applies to: ARM Firmware Suite, RealMonitor

Answer

The following is a set of additional notes to accompany section 3.5.1 in the RMTarget Integration Guide (ARM DUI 0142A).

In section 3.5.1, Procedure for Running the RealMonitor application demonstration, there is an example of how to use the rm.axf program to run the dhryansi program. When loading two programs into memory simultaneously, you must ensure that they occupy completely separate memory ranges. This applies to the code, static data, heap, and stacks.

When the rm.axf image is running, the code, static data, and stacks occupy memory in the range 0x4000 to 0x7FFF (see Figure 1). There is no heap.

   +--------------+  <-- $top_of_memory
| |
+--------------+ <-- 0x8000
| rm.axf |
| +static data |
| +stacks |
+--------------+ <-- 0x4000
| |
+--------------+ <-- 0x0

Figure 1 Memory map after loading rm.axf.

To load the dhryansi.axf image using rm.axf, you must ensure that dhryansi.axf is loaded and run from address 0x8000, so that it does not conflict with rm.axf (see Figure 2).

   +--------------+  <-- $top_of_memory
| dhryansi |
| stacks |
+--------------+ <-- bottom of dhryansi stacks
| |
+--------------+ <-- top of dhryansi heap
| dhryansi |
| heap |
+--------------+ <-- top of dhryansi.axf
| dhryansi.axf |
| +static data |
+--------------+ <-- 0x8000
| rm.axf |
| +static data |
| +stacks |
+--------------+ <-- 0x4000
| |
+--------------+ <-- 0x0

Figure 2 Memory map after loading rm.axf and dhryansi.axf.

When the rm_uHAL.axf image is running, the code, static data, and heaps occupy memory in the range 0x4000 to 0xEFFF, and the stacks start at address ($top_of_memory - 1) and extend downwards in memory (see Figure 3). When building rm_uHAL.axf, you must remember to enable the build option CHAIN_VECTORS=TRUE to include support for the chaining library.

   +--------------+  <-- $top_of_memory
| rm_uHAL |
| stacks |
+--------------+ <-- bottom of rm_uHAL stacks
| |
+--------------+ <-- 0x10000
| rm_uHAL |
| heap |
+--------------+
| rm_uHAL.axf |
| +static data |
+--------------+ <-- 0x4000
| |
+--------------+ <-- 0x0

Figure 3 Memory map after loading rm_uHAL.axf.

To debug the dhryansi.axf image using rm_uHAL.axf, you must ensure that dhryansi.axf is loaded and run from address 0x10000, so that it does not conflict with rm_uHAL.axf (see Figure 4). The chaining library in rm_uHAL.axf sets $top_of_heap for the new program to the bottom of the rm_uHAL stacks, which ensures that the rm_uHAL stacks are preserved.

   +--------------+  <-- top of rm_uHAL stacks (old $top_of_memory)
| rm_uHAL |
| stacks |
+--------------+ <-- top of dhryansi stacks (new $top_of_memory)
| dhryansi |
| stacks |
+--------------+ <-- bottom of dhryansi stacks
| |
+--------------+ <-- top of dhryansi heap
| dhryansi |
| heap |
+--------------+ <-- top of dhryansi.axf
| dhryansi.axf |
| +static data |
+--------------+ <-- 0x10000
| rm_uHAL |
| heap |
+--------------+
| rm_uHAL.axf |
| +static data |
+--------------+ <-- 0x4000
| |
+--------------+ <-- 0x0

Figure 4 Memory map after loading rm_uHAL.axf and dhryansi.axf.

You can change the base address of the dhryansi program using the following steps:
1) Load the dhryansi project into CodeWarrior IDE.
2) Select standalone Settings from the Edit menu. The settings window opens.
3) Select the Output tab in the ARM Linker pane.
4) Modify the RO Base box to contain your chosen base address. For example, enter 0x8000 when using rm.axf.
5) Click Save and close the dialog box.
6) Rebuild dhryansi using your preferred method.

Note:
Some applications, particularly those in the ARM Firmware Suite, use scatter loading. In these applications, you must modify the scatter loading file, rather than the RO Base setting. Please refer to your ADS Linker documentation for a description of scatter loading.
(DE 42393)

Article last edited on: 2008-09-09 15:47:32

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential