ARM Technical Support Knowledge Articles

What is the difference between +TEXT and +RW and how are they used in scatterloading files?

Applies to: RealView Development Suite (RVDS)

Answer

+TEXT is a synonym for +RO so the question is now "what is the difference between +RO & +RW option?"

Looking at http://infocenter.arm.com/help/topic/com.arm.doc.dui0381a/CJAEBAHF.html, we can see that +TEXT (or +RO) will select both Read-Only Code and Read-Only Data. So, both instructions AND data, such as literal pools and veneers, are stored within code sections.

Where you use these attributes is entirely down to you and the constraints of your system. A typical, simple, memory map might have the code located down at 0x00000000 in ROM, with RAM at, say, 0x20000000. Within this RAM area one can place the RW and ZI data (variables and zero-initialised data). A scatterloading file example is shown here:

LOAD_ROM 0x00000000 0x8000
{
EXEC_ROM 0x00000000 0x8000
{
  *(+RO)
}

RAM 0x20000000 0x6000
{
  *(+RW,+ZI)
}
}

For a description of the components of this scatterloading file, see http://infocenter.arm.com/help/topic/com.arm.doc.dui0206i/Chdfgiaj.html.

Essentially, it will create an image which will be loaded at 0x00000000. This image will contain all the code and data. Once the code is running, the C library functions will be called to move the Read/Write (RW) and Zero-Initialised (ZI) data from ROM to RAM at address 0x20000000, with the Read-Only (RO) code and data left in ROM at 0x00000000.

These options will ensure that code and data are either placed (by creating two or more images with a more complex scatter file - see http://infocenter/help/topic/com.arm.doc.dui0206i/Chdbejhb.html) or copied by the C libraries, as in the above example, at the addresses specified in the scatter file.

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