From 696d7f6fa01d40e8fe7e6c22e911f72b4a8e20e7 Mon Sep 17 00:00:00 2001 From: wuyangyong Date: Fri, 23 Dec 2011 04:31:47 +0000 Subject: [PATCH] fixed scons + gcc compiling error for lm4f232. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1871 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/lm4f232/Libraries/SConscript | 5 +- bsp/lm4f232/Libraries/startup/gcc/start_gcc.c | 11 ++- bsp/lm4f232/lm4f_rom.ld | 73 +++++++++++++++++++ 3 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 bsp/lm4f232/lm4f_rom.ld diff --git a/bsp/lm4f232/Libraries/SConscript b/bsp/lm4f232/Libraries/SConscript index 784d61658a..1b6d3c0a23 100644 --- a/bsp/lm4f232/Libraries/SConscript +++ b/bsp/lm4f232/Libraries/SConscript @@ -12,7 +12,7 @@ if rtconfig.PART_TYPE.startswith('PART_LM4F') != True: # add for startup script if rtconfig.CROSS_TOOL == 'gcc': - src += ['startup/gcc/start_gcc.s'] + src += ['startup/gcc/start_gcc.c'] elif rtconfig.CROSS_TOOL == 'keil': src += ['startup/arm/start_rvds.S'] elif rtconfig.CROSS_TOOL == 'iar': @@ -21,6 +21,9 @@ elif rtconfig.CROSS_TOOL == 'iar': CPPPATH = [cwd] CPPDEFINES = [rtconfig.PART_TYPE] +if rtconfig.CROSS_TOOL == 'gcc': + CPPDEFINES += ['gcc']; + group = DefineGroup('Libraries', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES) Return('group') diff --git a/bsp/lm4f232/Libraries/startup/gcc/start_gcc.c b/bsp/lm4f232/Libraries/startup/gcc/start_gcc.c index 0cfa44c624..cca7508b50 100644 --- a/bsp/lm4f232/Libraries/startup/gcc/start_gcc.c +++ b/bsp/lm4f232/Libraries/startup/gcc/start_gcc.c @@ -32,6 +32,11 @@ static void NmiSR(void); static void FaultISR(void); static void IntDefaultHandler(void); +/* RT-Thread interface */ +static void HardFault_Handler(void); +static void PendSV_Handler(void); +static void rt_hw_timer_handler(void); + //***************************************************************************** // // The entry point for the application. @@ -59,7 +64,7 @@ void (* const g_pfnVectors[])(void) = // The initial stack pointer ResetISR, // The reset handler NmiSR, // The NMI handler - FaultISR, // The hard fault handler + HardFault_Handler, // The hard fault handler IntDefaultHandler, // The MPU fault handler IntDefaultHandler, // The bus fault handler IntDefaultHandler, // The usage fault handler @@ -70,8 +75,8 @@ void (* const g_pfnVectors[])(void) = IntDefaultHandler, // SVCall handler IntDefaultHandler, // Debug monitor handler 0, // Reserved - IntDefaultHandler, // The PendSV handler - IntDefaultHandler, // The SysTick handler + PendSV_Handler, // The PendSV handler + rt_hw_timer_handler, // The SysTick handler IntDefaultHandler, // GPIO Port A IntDefaultHandler, // GPIO Port B IntDefaultHandler, // GPIO Port C diff --git a/bsp/lm4f232/lm4f_rom.ld b/bsp/lm4f232/lm4f_rom.ld new file mode 100644 index 0000000000..2f9cc1d962 --- /dev/null +++ b/bsp/lm4f232/lm4f_rom.ld @@ -0,0 +1,73 @@ +/****************************************************************************** + * + * lm4f_rom.ld - Linker configuration file for project. + * + * Copyright (c) 2011 Texas Instruments Incorporated. All rights reserved. + * Software License Agreement + * + * Texas Instruments (TI) is supplying this software for use solely and + * exclusively on TI's microcontroller products. The software is owned by + * TI and/or its suppliers, and is protected under applicable copyright + * laws. You may not combine this software with "viral" open-source + * software in order to form a larger program. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS. + * NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT + * NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY + * CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL + * DAMAGES, FOR ANY REASON WHATSOEVER. + * + * This is part of revision 8264 of the EK-LM4F232 Firmware Package. + * + *****************************************************************************/ + +/* Program Entry, set to mark it as "used" and avoid gc */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 + SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +SECTIONS +{ + .text : + { + _text = .; + KEEP(*(.isr_vector)) + *(.text*) + *(.rodata*) + _etext = .; + + /* section information for finsh shell */ + . = ALIGN(4); + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; + . = ALIGN(4); + + } > FLASH + + .data : AT(ADDR(.text) + SIZEOF(.text)) + { + _data = .; + *(vtable) + *(.data*) + _edata = .; + } > SRAM + + .bss : + { + _bss = .; + *(.bss*) + *(COMMON) + _ebss = .; + } > SRAM + + __bss_end = .; + +}