fixed bsp/frdm-k64f gcc compile

This commit is contained in:
geniusgogo 2014-07-03 22:08:29 +08:00
parent 857ac7e6e6
commit 1546274d89
4 changed files with 26 additions and 11 deletions

View File

@ -77,6 +77,19 @@ SECTIONS
*(.dtors) *(.dtors)
*(.rodata*) *(.rodata*)
/* section information for finsh shell */
. = ALIGN(4);
__fsymtab_start = .;
KEEP(*(FSymTab))
__fsymtab_end = .;
. = ALIGN(4);
__vsymtab_start = .;
KEEP(*(VSymTab))
__vsymtab_end = .;
. = ALIGN(4);
. = ALIGN(4);
_etext = .;
KEEP(*(.eh_frame*)) KEEP(*(.eh_frame*))
} > FLASH } > FLASH
@ -127,7 +140,7 @@ SECTIONS
__data_end__ = .; __data_end__ = .;
} > RAM } > RAM
__bss_start = .;
.bss : .bss :
{ {
__bss_start__ = .; __bss_start__ = .;
@ -135,7 +148,7 @@ SECTIONS
*(COMMON) *(COMMON)
__bss_end__ = .; __bss_end__ = .;
} > RAM } > RAM
__bss_end = .;
.heap : .heap :
{ {
__end__ = .; __end__ = .;

View File

@ -5,18 +5,18 @@ from building import *
# get current directory # get current directory
cwd = GetCurrentDir() cwd = GetCurrentDir()
path = [cwd, cwd + '/MK64F12']
src = Glob('MK64F12/*.c') src = Glob('MK64F12/*.c')
#add for startup script #add for startup script
if rtconfig.CROSS_TOOL == 'gcc': if rtconfig.CROSS_TOOL == 'gcc':
src = src + ['TOOLCHAIN_GCC_ARM/startup_MK64F12.S'] src = src + ['TOOLCHAIN_GCC_ARM/startup_MK64F12.S']
src = src + ['TOOLCHAIN_GCC_ARM/startup.c']
path += [cwd + 'TOOLCHAIN_GCC_ARM']
elif rtconfig.CROSS_TOOL == 'keil': elif rtconfig.CROSS_TOOL == 'keil':
src = src + ['TOOLCHAIN_ARM_STD/startup_MK64F12.s'] src = src + ['TOOLCHAIN_ARM_STD/startup_MK64F12.s']
# elif rtconfig.CROSS_TOOL == 'iar': # elif rtconfig.CROSS_TOOL == 'iar':
path = [cwd, cwd + '/MK64F12']
#CPPDEFINES = [''] #CPPDEFINES = ['']
group = DefineGroup('Device', src, depend = [''], CPPPATH = path) group = DefineGroup('Device', src, depend = [''], CPPPATH = path)
#CPPDEFINES = CPPDEFINES) #CPPDEFINES = CPPDEFINES)

View File

@ -229,7 +229,9 @@ disable_watchdog:
ldr r0, =SystemInit ldr r0, =SystemInit
blx r0 blx r0
ldr r0, =_start ldr r0, =init_data_bss
blx r0
ldr r0, =main
bx r0 bx r0
.pool .pool
.size Reset_Handler, . - Reset_Handler .size Reset_Handler, . - Reset_Handler

View File

@ -12,10 +12,10 @@ if os.getenv('RTT_CC'):
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
if CROSS_TOOL == 'gcc': if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc' PLATFORM = 'gcc'
EXEC_PATH = 'C:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin' EXEC_PATH = r'C:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin'
elif CROSS_TOOL == 'keil': elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc' PLATFORM = 'armcc'
EXEC_PATH = 'C:/Keil' EXEC_PATH = r'C:/Keil'
elif CROSS_TOOL == 'iar': elif CROSS_TOOL == 'iar':
print '================ERROR============================' print '================ERROR============================'
print 'Not support iar yet!' print 'Not support iar yet!'
@ -40,9 +40,9 @@ if PLATFORM == 'gcc':
OBJCPY = PREFIX + 'objcopy' OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections' DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -g -Wall ' CFLAGS = DEVICE + ' -g -Wall -D__ASSEMBLY__ -D__FPU_USED'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -lm -lgcc -lc' + ' -Wl,--gc-sections,-Map=rtthread-k64f.map,-cref,-u,Reset_Handler -T K64FN1M0xxx12.ld' LFLAGS = DEVICE + ' -lm -lgcc -lc' + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread-k64f.map,-cref,-u,Reset_Handler -T K64FN1M0xxx12.ld'
CPATH = '' CPATH = ''
LPATH = '' LPATH = ''