06.02.2013 Views

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8.23 Placing a key in flash memory using __at<br />

8.23.1 See also<br />

<strong>Using</strong> scatter files<br />

Some flash devices require a key to be written to an address to activate certain features. An __at<br />

section provides a simple method of writing a value to a specific address.<br />

Assuming a device has flash memory from 0x8000 to 0x10000 and a key is required in address<br />

0x8000. To do this with an __at section, you must declare a variable so that <strong>the</strong> compiler can<br />

generate a section called .<strong>ARM</strong>.__at_0x8000.<br />

The following example shows a scatter file with manual placement of <strong>the</strong> flash execution<br />

region:<br />

ER_FLASH 0x8000 0x2000<br />

{<br />

*(+RO)<br />

*(.<strong>ARM</strong>.__at_0x8000) ; key<br />

}<br />

Example 8-13 Manual placement of flash execution regions<br />

Use <strong>the</strong> linker command-line option --no_autoat to enable manual placement.<br />

The following example shows a scatter file with automatic placement of <strong>the</strong> flash execution<br />

region. Use <strong>the</strong> linker command-line option --autoat to enable automatic placement.<br />

Example 8-14 Automatic placement of flash execution regions<br />

ER_FLASH 0x8000 0x2000<br />

{<br />

*(+RO) ; o<strong>the</strong>r code and read-only data, <strong>the</strong><br />

; __at section is automatically selected<br />

}<br />

Tasks<br />

• Placing sections with FIRST and LAST attributes on page 4-21<br />

• <strong>Using</strong> __at sections to place sections at a specific address on page 8-37.<br />

Concepts<br />

• Automatic placement of __at sections on page 8-39<br />

• Manual placement of __at sections on page 8-41.<br />

<strong>Linker</strong> Reference:<br />

• About execution region descriptions on page 4-8.<br />

Reference<br />

<strong>Linker</strong> Reference:<br />

• --autoat, --no_autoat on page 2-17.<br />

<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 8-42<br />

ID080411 Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!