Skip to content

Commit 2ae17de

Browse files
committed
cc3200: Clean up linker scripts and startup file.
1 parent 09721e2 commit 2ae17de

File tree

4 files changed

+39
-53
lines changed

4 files changed

+39
-53
lines changed

cc3200/application.lds

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ SECTIONS
4646
. = ALIGN(8);
4747
} > SRAMB
4848

49-
_ertos_heap = ORIGIN(SRAMB) + LENGTH(SRAMB);
50-
5149
.text :
5250
{
5351
_text = .;
@@ -65,13 +63,8 @@ SECTIONS
6563
__exidx_end = .;
6664
_etext = .;
6765
} > SRAM
68-
69-
__init_data = .;
70-
71-
/* used by the start-up to initialize data */
72-
_sidata = LOADADDR(.data);
7366

74-
.data : AT(__init_data)
67+
.data :
7568
{
7669
. = ALIGN(8);
7770
_data = .;

cc3200/bootmgr/bootmgr.lds

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
__stack_size__ = 1024;
27+
__stack_size__ = 1024;
2828

2929
MEMORY
3030
{
@@ -53,9 +53,7 @@ SECTIONS
5353
_etext = .;
5454
} > SRAM
5555

56-
__init_data = .;
57-
58-
.data : AT(__init_data)
56+
.data :
5957
{
6058
_data = .;
6159
*(.data*)

cc3200/hal/startup_gcc.c

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ extern uint32_t _edata;
5353
extern uint32_t _bss;
5454
extern uint32_t _ebss;
5555
extern uint32_t _estack;
56-
extern uint32_t __init_data;
5756

5857
//*****************************************************************************
5958
//
6059
// Forward declaration of the default fault handlers.
6160
//
6261
//*****************************************************************************
62+
#ifndef BOOTLOADER
6363
__attribute__ ((section (".boot")))
64+
#endif
6465
void ResetISR(void);
6566
#ifdef DEBUG
6667
static void NmiSR(void) __attribute__( ( naked ) );
@@ -213,45 +214,38 @@ void (* const g_pfnVectors[256])(void) =
213214
void ResetISR(void)
214215
{
215216
#if defined(DEBUG) && !defined(BOOTLOADER)
216-
//
217-
// Fill the main stack with a known value so that
218-
// we can measure the main stack high water mark
219-
//
220-
__asm volatile
221-
(
222-
"ldr r0, =_stack \n"
223-
"ldr r1, =_estack \n"
224-
"mov r2, #0x55555555 \n"
225-
".thumb_func \n"
226-
"fill_loop: \n"
227-
"cmp r0, r1 \n"
228-
"it lt \n"
229-
"strlt r2, [r0], #4 \n"
230-
"blt fill_loop \n"
231-
);
232-
#endif
233-
234-
// Get the initial stack pointer location from the vector table
235-
// and write this value to the msp register
236-
__asm volatile
237-
(
238-
"ldr r0, =_text \n"
239-
"ldr r0, [r0] \n"
240-
"msr msp, r0 \n"
241-
);
242-
243217
{
244-
uint32_t *pui32Src, *pui32Dest;
245-
246218
//
247-
// Copy the data segment initializers
219+
// Fill the main stack with a known value so that
220+
// we can measure the main stack high water mark
248221
//
249-
pui32Src = &__init_data;
250-
for(pui32Dest = &_data; pui32Dest < &_edata; )
251-
{
252-
*pui32Dest++ = *pui32Src++;
253-
}
222+
__asm volatile
223+
(
224+
"ldr r0, =_stack \n"
225+
"ldr r1, =_estack \n"
226+
"mov r2, #0x55555555 \n"
227+
".thumb_func \n"
228+
"fill_loop: \n"
229+
"cmp r0, r1 \n"
230+
"it lt \n"
231+
"strlt r2, [r0], #4 \n"
232+
"blt fill_loop \n"
233+
);
234+
}
235+
#endif
254236

237+
{
238+
// Get the initial stack pointer location from the vector table
239+
// and write this value to the msp register
240+
__asm volatile
241+
(
242+
"ldr r0, =_text \n"
243+
"ldr r0, [r0] \n"
244+
"msr msp, r0 \n"
245+
);
246+
}
247+
248+
{
255249
//
256250
// Zero fill the bss segment.
257251
//
@@ -269,10 +263,12 @@ void ResetISR(void)
269263
);
270264
}
271265

272-
//
273-
// Call the application's entry point.
274-
//
275-
main();
266+
{
267+
//
268+
// Call the application's entry point.
269+
//
270+
main();
271+
}
276272
}
277273

278274
#ifdef DEBUG

cc3200/util/gccollect.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
// variables defining memory layout
2929
extern uint32_t _etext;
30-
extern uint32_t _sidata;
3130
extern uint32_t _data;
3231
extern uint32_t _edata;
3332
extern uint32_t _boot;

0 commit comments

Comments
 (0)