From 3ba8234cecde90467fb75d72055fa0c226ed16df Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka <gniibe@fsij.org> Date: Mon, 13 Jul 2015 16:45:32 +0900 Subject: sys_board and stm32 primer2 --- example-led/sample.ld | 5 +++-- example-led/sys.c | 8 +++----- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'example-led') diff --git a/example-led/sample.ld b/example-led/sample.ld index 07761e0..6934b9f 100644 --- a/example-led/sample.ld +++ b/example-led/sample.ld @@ -29,12 +29,13 @@ SECTIONS { . = 0; - .sys : ALIGN(16) SUBALIGN(16) + .sys : ALIGN(16) SUBALIGN(8) { _sys = .; KEEP(*(.vectors)) . = ALIGN(16); - *(.sys.version) + KEEP(*(.sys.version)) + KEEP(*(.sys.board)) build/sys.o(.text) build/sys.o(.text.*) build/sys.o(.rodata) diff --git a/example-led/sys.c b/example-led/sys.c index f8bfa58..06af0c6 100644 --- a/example-led/sys.c +++ b/example-led/sys.c @@ -363,8 +363,6 @@ nvic_system_reset (void) static void __attribute__ ((naked)) reset (void) { - extern const unsigned long *FT0, *FT1, *FT2; - /* * This code may not be at the start of flash ROM, because of DFU. * So, we take the address from PC. @@ -391,6 +389,7 @@ reset (void) "1: .word 0x20000000" : /* no output */ : /* no input */ : "memory"); #else + extern const unsigned long *FT0, *FT1, *FT2; asm volatile ("cpsid i\n\t" /* Mask all interrupts. */ "ldr r0, 1f\n\t" /* r0 = SCR */ "mov r1, pc\n\t" /* r1 = (PC + 0x1000) & ~0x0fff */ @@ -406,12 +405,11 @@ reset (void) ".align 2\n" "1: .word 0xe000ed00" : /* no output */ : /* no input */ : "memory"); -#endif - - /* Never reach here. */ /* Artificial entry to refer FT0, FT1, and FT2. */ asm volatile ("" : : "r" (FT0), "r" (FT1), "r" (FT2)); +#endif + /* Never reach here. */ } typedef void (*handler)(void); -- cgit v1.2.3