dm36x: Copy vector table from initial 0x80000000 to required location on ARM, 0x00000000.

This commit is contained in:
Kelvin Lawson
2013-09-17 17:06:06 +01:00
parent 8f8eddf6fc
commit 5924485def
2 changed files with 9 additions and 3 deletions

View File

@@ -37,7 +37,7 @@
/** Imports required by C startup code */
extern unsigned long _end_text, _start_data, _end_data, _start_bss, _end_bss;
extern unsigned long _start_vectors, _end_vectors, _end_text, _start_data, _end_data, _start_bss, _end_bss;
extern int main(void);
@@ -61,9 +61,13 @@ extern void _mainCRTStartup (void) __attribute__((weak));
void _mainCRTStartup(void)
{
unsigned long *src;
#ifdef ROM
unsigned long *dst;
#endif
// Copy vector table from SRAM to IRAM0 (ARM vector table must be at 0x00000000)
src = &_start_vectors;
dst = (unsigned long *)0x00000000;
while(src < &_end_vectors)
*(dst++) = *(src++);
#ifdef ROM
// Running from ROM: copy data section to RAM

View File

@@ -24,7 +24,9 @@ SECTIONS
.text :
{
_start_vectors = .;
*(.vectors)
_end_vectors = .;
/* Startup assembly */
*(.startup)
*(.init)