Skip to content

Commit 28e925c

Browse files
committed
[BSP] fix the compiling issue
1 parent 8a92319 commit 28e925c

File tree

6 files changed

+242
-58
lines changed

6 files changed

+242
-58
lines changed

bsp/lm3s8962/Libraries/SConscript

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from building import *
44

55
# The set of source files associated with this SConscript file.
66
cwd = GetCurrentDir()
7-
src = Glob('driverlib/*.c')
7+
src = Glob('driverlib/*.c')
88

99
# cortex-m3 no FPU.
1010
if rtconfig.PART_TYPE.startswith('PART_LM4F') != True:
@@ -18,9 +18,9 @@ elif rtconfig.CROSS_TOOL == 'keil':
1818
elif rtconfig.CROSS_TOOL == 'iar':
1919
src += ['startup/iar/start_iar.S']
2020

21-
CPPPATH = [cwd]
22-
21+
CPPPATH = [cwd]
2322
CPPDEFINES = [rtconfig.PART_TYPE]
23+
2424
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
2525

2626
Return('group')

bsp/lm3s8962/SConstruct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Export('RTT_ROOT')
2323
Export('rtconfig')
2424

2525
# prepare building environment
26-
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
26+
objs = PrepareBuilding(env, RTT_ROOT)
2727

2828
# make a building
2929
DoBuilding(TARGET, objs)

bsp/lm4f232/Libraries/startup/gcc/start_gcc.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// Forward declaration of the default fault handlers.
3131
//
3232
//*****************************************************************************
33-
void ResetISR(void);
33+
void Reset_Handler(void);
3434
static void NmiSR(void);
3535
static void FaultISR(void);
3636
static void IntDefaultHandler(void);
@@ -70,9 +70,9 @@ void (* const g_pfnVectors[])(void) =
7070
{
7171
(void (*)(void))((unsigned long)pulStack + sizeof(pulStack)),
7272
// The initial stack pointer
73-
ResetISR, // The reset handler
73+
Reset_Handler, // The reset handler
7474
NmiSR, // The NMI handler
75-
HardFault_Handler, // The hard fault handler
75+
HardFault_Handler, // The hard fault handler
7676
IntDefaultHandler, // The MPU fault handler
7777
IntDefaultHandler, // The bus fault handler
7878
IntDefaultHandler, // The usage fault handler
@@ -233,10 +233,10 @@ void (* const g_pfnVectors[])(void) =
233233
// for the "data" segment resides immediately following the "text" segment.
234234
//
235235
//*****************************************************************************
236-
extern unsigned long _etext;
237-
extern unsigned long _data;
236+
extern unsigned long _sidata;
237+
extern unsigned long _sdata;
238238
extern unsigned long _edata;
239-
extern unsigned long _bss;
239+
extern unsigned long _sbss;
240240
extern unsigned long _ebss;
241241

242242
//*****************************************************************************
@@ -250,23 +250,23 @@ extern unsigned long _ebss;
250250
//
251251
//*****************************************************************************
252252
void
253-
ResetISR(void)
253+
Reset_Handler(void)
254254
{
255255
unsigned long *pulSrc, *pulDest;
256256

257257
//
258258
// Copy the data segment initializers from flash to SRAM.
259259
//
260-
pulSrc = &_etext;
261-
for(pulDest = &_data; pulDest < &_edata; )
260+
pulSrc = &_sidata;
261+
for(pulDest = &_sdata; pulDest < &_edata; )
262262
{
263263
*pulDest++ = *pulSrc++;
264264
}
265265

266266
//
267267
// Zero fill the bss segment.
268268
//
269-
__asm(" ldr r0, =_bss\n"
269+
__asm(" ldr r0, =_sbss\n"
270270
" ldr r1, =_ebss\n"
271271
" mov r2, #0\n"
272272
" .thumb_func\n"

bsp/lm4f232/lm4f_rom.ld

Lines changed: 108 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,26 @@
2525
/* Program Entry, set to mark it as "used" and avoid gc */
2626
MEMORY
2727
{
28-
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
29-
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
28+
CODE (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
29+
DATA (rw) : ORIGIN = 0x10000000, LENGTH = 0x00008000
3030
}
31+
ENTRY(Reset_Handler)
32+
_system_stack_size = 0x200;
3133

3234
SECTIONS
3335
{
3436
.text :
3537
{
36-
_text = .;
37-
KEEP(*(.isr_vector))
38-
*(.text*)
38+
. = ALIGN(4);
39+
KEEP(*(.isr_vector)) /* Startup code */
40+
. = ALIGN(4);
41+
*(.text) /* remaining code */
42+
*(.text.*) /* remaining code */
43+
*(.rodata) /* read-only data (constants) */
3944
*(.rodata*)
40-
_etext = .;
45+
*(.glue_7)
46+
*(.glue_7t)
47+
*(.gnu.linkonce.t*)
4148

4249
/* section information for finsh shell */
4350
. = ALIGN(4);
@@ -56,24 +63,108 @@ SECTIONS
5663
__rt_init_end = .;
5764
. = ALIGN(4);
5865

59-
} > FLASH
66+
PROVIDE(__ctors_start__ = .);
67+
/* old GCC version uses .ctors */
68+
KEEP(*(SORT(.ctors.*)))
69+
KEEP(*(.ctors))
70+
/* new GCC version uses .init_array */
71+
KEEP (*(SORT(.init_array.*)))
72+
KEEP (*(.init_array))
73+
PROVIDE(__ctors_end__ = .);
74+
75+
. = ALIGN(4);
76+
_etext = .;
77+
} > CODE = 0
78+
79+
.ARM.extab :
80+
{
81+
*(.ARM.extab*)
82+
83+
. = ALIGN(4);
84+
/* This is used by the startup in order to initialize the .data secion */
85+
_sidata = .;
86+
} > CODE
87+
88+
/* .data section which is used for initialized data */
89+
.data : AT (_sidata)
90+
{
91+
. = ALIGN(4);
92+
PROVIDE(__dtors_start__ = .);
93+
KEEP(*(SORT(.dtors.*)))
94+
KEEP(*(.dtors))
95+
PROVIDE(__dtors_end__ = .);
96+
97+
. = ALIGN(4);
98+
/* This is used by the startup in order to initialize the .data secion */
99+
_sdata = . ;
100+
101+
*(.data)
102+
*(.data.*)
103+
*(.gnu.linkonce.d*)
104+
105+
. = ALIGN(4);
106+
/* This is used by the startup in order to initialize the .data secion */
107+
_edata = . ;
108+
} > DATA
60109

61-
.data : AT(ADDR(.text) + SIZEOF(.text))
110+
.stack :
62111
{
63-
_data = .;
64-
*(vtable)
65-
*(.data*)
66-
_edata = .;
67-
} > SRAM
112+
. = . + _system_stack_size;
113+
. = ALIGN(4);
114+
_estack = .;
115+
} >DATA
68116

117+
__bss_start = .;
69118
.bss :
70119
{
71-
_bss = .;
72-
*(.bss*)
120+
. = ALIGN(4);
121+
/* This is used by the startup in order to initialize the .bss secion */
122+
_sbss = .;
123+
124+
*(.bss)
125+
*(.bss.*)
73126
*(COMMON)
74-
_ebss = .;
75-
} > SRAM
76127

128+
. = ALIGN(4);
129+
/* This is used by the startup in order to initialize the .bss secion */
130+
_ebss = . ;
131+
*(.bss.init)
132+
} > DATA
77133
__bss_end = .;
78134

135+
_end = .;
136+
137+
/* Stabs debugging sections. */
138+
.stab 0 : { *(.stab) }
139+
.stabstr 0 : { *(.stabstr) }
140+
.stab.excl 0 : { *(.stab.excl) }
141+
.stab.exclstr 0 : { *(.stab.exclstr) }
142+
.stab.index 0 : { *(.stab.index) }
143+
.stab.indexstr 0 : { *(.stab.indexstr) }
144+
.comment 0 : { *(.comment) }
145+
/* DWARF debug sections.
146+
* Symbols in the DWARF debugging sections are relative to the beginning
147+
* of the section so we begin them at 0. */
148+
/* DWARF 1 */
149+
.debug 0 : { *(.debug) }
150+
.line 0 : { *(.line) }
151+
/* GNU DWARF 1 extensions */
152+
.debug_srcinfo 0 : { *(.debug_srcinfo) }
153+
.debug_sfnames 0 : { *(.debug_sfnames) }
154+
/* DWARF 1.1 and DWARF 2 */
155+
.debug_aranges 0 : { *(.debug_aranges) }
156+
.debug_pubnames 0 : { *(.debug_pubnames) }
157+
/* DWARF 2 */
158+
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
159+
.debug_abbrev 0 : { *(.debug_abbrev) }
160+
.debug_line 0 : { *(.debug_line) }
161+
.debug_frame 0 : { *(.debug_frame) }
162+
.debug_str 0 : { *(.debug_str) }
163+
.debug_loc 0 : { *(.debug_loc) }
164+
.debug_macinfo 0 : { *(.debug_macinfo) }
165+
/* SGI/MIPS DWARF 2 extensions */
166+
.debug_weaknames 0 : { *(.debug_weaknames) }
167+
.debug_funcnames 0 : { *(.debug_funcnames) }
168+
.debug_typenames 0 : { *(.debug_typenames) }
169+
.debug_varnames 0 : { *(.debug_varnames) }
79170
}

bsp/tm4c129x/libraries/startup/startup_gcc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ void (* const g_pfnVectors[])(void) =
201201
// for the "data" segment resides immediately following the "text" segment.
202202
//
203203
//*****************************************************************************
204-
extern uint32_t _ldata;
205-
extern uint32_t _data;
204+
extern uint32_t _sidata;
205+
extern uint32_t _sdata;
206206
extern uint32_t _edata;
207-
extern uint32_t _bss;
207+
extern uint32_t _sbss;
208208
extern uint32_t _ebss;
209209

210210
//*****************************************************************************
@@ -225,16 +225,16 @@ ResetISR(void)
225225
//
226226
// Copy the data segment initializers from flash to SRAM.
227227
//
228-
pui32Src = &_ldata;
229-
for(pui32Dest = &_data; pui32Dest < &_edata; )
228+
pui32Src = &_sidata;
229+
for(pui32Dest = &_sdata; pui32Dest < &_edata; )
230230
{
231231
*pui32Dest++ = *pui32Src++;
232232
}
233233

234234
//
235235
// Zero fill the bss segment.
236236
//
237-
__asm(" ldr r0, =_bss\n"
237+
__asm(" ldr r0, =_sbss\n"
238238
" ldr r1, =_ebss\n"
239239
" mov r2, #0\n"
240240
" .thumb_func\n"

0 commit comments

Comments
 (0)