Техническая Спецификация для Atmel Evaluation Board using the SAM7SE Microcontroller AT91SAM7SE-EK AT91SAM7SE-EK

Модели
AT91SAM7SE-EK
Скачать
Страница из 24
8
6295A–ATARM–27-Mar-07
Application Note
The actual copy operation consists of loading these values and several registers, and looping
through the data:
_init_data:
ldr      r2, =_lp_data
ldmia    r2, {r1, r3, r4}
cmp      r1, r3
beq      _branch_main
1:
cmp      r3, r4
ldrcc    r2, [r1], #4
strcc    r2, [r3], #4
bcc      1b
In addition, it is both safer and more useful for debug purposes to initialize the BSS segment by
filling it with zeroes. Theoretically, this operation is unneeded; however, it can have several ben-
efits. For example, it makes it easier when debugging to see which memory regions have been
modified. This can be a valuable tool for spotting stack overflow and similar problems.
Initialization of the BSS and Data segments are similar, except register r2 is initialized at zero
after the ldmia instruction and never modified (c.f. the above code).
3.2.1.10
Remapping Exception Vectors and Handlers
Several microcontrollers of the AT91SAM family feature an External Bus Interface, enabling the
connection of external memories. Those can be used to store an application and run it from
there, instead of using internal flash or internal SRAM.
The ARM core always fetches exception vectors at address 0. However, this poses a problem
for other memories: the exceptions vectors of the application, located at the beginning of the
memory space, are never read by the core.
In addition, having exception vectors in SRAM benefits performance, even when running from
the internal Flash. Indeed, since the SRAM is accessed at processor speed, this reduces inter-
rupt latency. As such, a memory remap operation is performed in the software example
regardless of which memory model is used.
Placing exception vectors in SRAM can be done simply by putting them at the beginning of the
Data segment. Since it is itself located at the beginning of the SRAM, this means that exception
vectors is automatically copied during the segment initialization.
 show the memory mapping after loading an application in SDRAM,
and after the Data segment has been initialized and the remap command executed.