cc3200: Clean up linker scripts and startup file.

This commit is contained in:
danicampora 2015-03-14 09:51:46 +01:00
parent 09721e2314
commit 2ae17def52
4 changed files with 39 additions and 53 deletions

View File

@ -46,8 +46,6 @@ SECTIONS
. = ALIGN(8);
} > SRAMB
_ertos_heap = ORIGIN(SRAMB) + LENGTH(SRAMB);
.text :
{
_text = .;
@ -65,13 +63,8 @@ SECTIONS
__exidx_end = .;
_etext = .;
} > SRAM
__init_data = .;
/* used by the start-up to initialize data */
_sidata = LOADADDR(.data);
.data : AT(__init_data)
.data :
{
. = ALIGN(8);
_data = .;

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
__stack_size__ = 1024;
__stack_size__ = 1024;
MEMORY
{
@ -53,9 +53,7 @@ SECTIONS
_etext = .;
} > SRAM
__init_data = .;
.data : AT(__init_data)
.data :
{
_data = .;
*(.data*)

View File

@ -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"
);
{
//
// 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"
);
{
// 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
//
pui32Src = &__init_data;
for(pui32Dest = &_data; pui32Dest < &_edata; )
{
*pui32Dest++ = *pui32Src++;
}
//
// 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

View File

@ -27,7 +27,6 @@
// variables defining memory layout
extern uint32_t _etext;
extern uint32_t _sidata;
extern uint32_t _data;
extern uint32_t _edata;
extern uint32_t _boot;