Guest
#2961062
Hi,
I am currently programming an ADuC7026 (ARM7) with the GNU toolchain and
have a problem with my linker script.
Here the code:
LINKER_SCRIPT:
. = 0x00010000;
RAM_START = . ;
FLASH_RAM_EXCEPT_START = TEXT_END;
ram_except_vecs : AT (FLASH_RAM_EXCEPT_START) {
* (ram_except_vecs);
. = ALIGN(0x4);
} >ram
. = ALIGN(0x4);
RAM_EXCEPT_VECS_LENGTH = . - RAM_START;
ASSEMBLY:
.section "ram_except_vecs"
ram_reset: LDR PC, [PC,#0x18]
ram_undef: LDR PC, [PC,#0x18]
ram_swi: LDR PC, [PC,#0x18]
ram_pref: LDR PC, [PC,#0x18]
ram_data: LDR PC, [PC,#0x18]
LDR PC, [PC,#0x18]
ram_irq: LDR PC, [PC,#0x18]
ram_fiq: LDR PC, [PC,#0x18]
.word 0x00080020
.word 0x00010004
.word 0x00010008
.word 0x0001000C
.word 0x00010010
.word 0x00010014
.word 0x00010018
.word 0x0001001C
At runtime the code is copied from ROM to RAM with the following:
LDR R0, =_FLASH_RAM_EXCEPT_START_
LDR R1, =_RAM_START_
LDR R2, =_RAM_EXCEPT_VECS_LENGTH_
CMP R2, #0
BEQ endCopyVectors
vectorLoop:
LDR R3, [R0], #4
STR R3, [R1], #4
SUBS R2, R2, #4
BNE vectorLoop
endCopyVectors:
The Problem I have is that according to my emulator (KEIL uVision) the
section is correctly located in ROM (right after the .text section), is
also linked to the correct address in RAM and when copying copies the
correct amount (16 orders). However instead of the expected code, there
are only zeros in ROM (and of course in RAM as well).
I have no idea what I am doing wrong! Please help!
Thanks a lot in advance!