diff options
| author | danicampora | 2015-03-14 09:51:46 +0100 |
|---|---|---|
| committer | danicampora | 2015-03-14 10:08:45 +0100 |
| commit | 2ae17def5293452efe255df2b104e0bf2b04f56f (patch) | |
| tree | 432408710481e07fb2a17ce06b8f69621cb49464 /cc3200/hal | |
| parent | 09721e23146643890a5157a82359a14990cf559b (diff) | |
cc3200: Clean up linker scripts and startup file.
Diffstat (limited to 'cc3200/hal')
| -rw-r--r-- | cc3200/hal/startup_gcc.c | 76 |
1 files changed, 36 insertions, 40 deletions
diff --git a/cc3200/hal/startup_gcc.c b/cc3200/hal/startup_gcc.c index 5dff9ffda..e173e8fda 100644 --- a/cc3200/hal/startup_gcc.c +++ b/cc3200/hal/startup_gcc.c @@ -53,14 +53,15 @@ extern uint32_t _edata; extern uint32_t _bss; extern uint32_t _ebss; extern uint32_t _estack; -extern uint32_t __init_data; //***************************************************************************** // // Forward declaration of the default fault handlers. // //***************************************************************************** +#ifndef BOOTLOADER __attribute__ ((section (".boot"))) +#endif void ResetISR(void); #ifdef DEBUG static void NmiSR(void) __attribute__( ( naked ) ); @@ -213,45 +214,38 @@ void (* const g_pfnVectors[256])(void) = void ResetISR(void) { #if defined(DEBUG) && !defined(BOOTLOADER) - // - // Fill the main stack with a known value so that - // we can measure the main stack high water mark - // - __asm volatile - ( - "ldr r0, =_stack \n" - "ldr r1, =_estack \n" - "mov r2, #0x55555555 \n" - ".thumb_func \n" - "fill_loop: \n" - "cmp r0, r1 \n" - "it lt \n" - "strlt r2, [r0], #4 \n" - "blt fill_loop \n" - ); -#endif - - // Get the initial stack pointer location from the vector table - // and write this value to the msp register - __asm volatile - ( - "ldr r0, =_text \n" - "ldr r0, [r0] \n" - "msr msp, r0 \n" - ); - { - uint32_t *pui32Src, *pui32Dest; - // - // Copy the data segment initializers + // Fill the main stack with a known value so that + // we can measure the main stack high water mark // - pui32Src = &__init_data; - for(pui32Dest = &_data; pui32Dest < &_edata; ) - { - *pui32Dest++ = *pui32Src++; - } + __asm volatile + ( + "ldr r0, =_stack \n" + "ldr r1, =_estack \n" + "mov r2, #0x55555555 \n" + ".thumb_func \n" + "fill_loop: \n" + "cmp r0, r1 \n" + "it lt \n" + "strlt r2, [r0], #4 \n" + "blt fill_loop \n" + ); + } +#endif + { + // Get the initial stack pointer location from the vector table + // and write this value to the msp register + __asm volatile + ( + "ldr r0, =_text \n" + "ldr r0, [r0] \n" + "msr msp, r0 \n" + ); + } + + { // // Zero fill the bss segment. // @@ -269,10 +263,12 @@ void ResetISR(void) ); } - // - // Call the application's entry point. - // - main(); + { + // + // Call the application's entry point. + // + main(); + } } #ifdef DEBUG |
