File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 2626 */
2727#define FULL_FPU_ACCESS (0x00f00000)
2828
29+ /**
30+ * Interrupt vector base address, defined by the linker
31+ */
32+ extern const void * _isr_vectors ;
33+
2934void cortexm_init (void )
3035{
3136 /* initialize the FPU on Cortex-M4F CPUs */
@@ -37,7 +42,7 @@ void cortexm_init(void)
3742 /* configure the vector table location to internal flash */
3843#if defined(CPU_ARCH_CORTEX_M3 ) || defined(CPU_ARCH_CORTEX_M4 ) || \
3944 defined(CPU_ARCH_CORTEX_M4F )
40- SCB -> VTOR = CPU_FLASH_BASE ;
45+ SCB -> VTOR = ( uint32_t ) & _isr_vectors ;
4146#endif
4247
4348 /* initialize the interrupt priorities */
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ SECTIONS
4141 {
4242 . = ALIGN (4 );
4343 _sfixed = .;
44+ _isr_vectors = DEFINED (_isr_vectors) ? _isr_vectors : . ;
4445 KEEP (*(.vectors .vectors .*))
4546 *(.text .text .* .gnu .linkonce .t .*)
4647 *(.glue_7t ) *(.glue_7 )
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ SECTIONS
2525 /* Interrupt vectors 0x00-0x3ff. */
2626 .vector_table :
2727 {
28- _vector_rom = .;
28+ _isr_vectors = .;
2929 KEEP (*(.vector_table ))
3030 } > vectors
3131 ASSERT (SIZEOF (.vector_table ) == 0x400 , " Interrupt vector table of invalid size." )
You can’t perform that action at this time.
0 commit comments