From 09fdbf9a37c19bb5d9a60385a7c44e32843ef2ff Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 2 Sep 2013 09:33:20 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6240 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/rt/ARMCM0-STM32F051-DISCOVERY/Makefile | 4 +- demos/rt/ARMCM4-STM32F303-DISCOVERY/Makefile | 4 +- demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/Makefile | 4 +- demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/chconf.h | 2 +- demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/halconf.h | 8 +- demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/main.c | 15 +- demos/rt/ARMCM4-STM32F407-DISCOVERY/Makefile | 4 +- os/common/ports/ARMCMx/compilers/GCC/crt0.c | 354 +++++++++++ .../ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld | 153 +++++ .../ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld | 154 +++++ .../ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld | 153 +++++ .../ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld | 162 +++++ .../ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld | 162 +++++ .../ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld | 183 ++++++ os/common/ports/ARMCMx/compilers/GCC/rules.mk | 220 +++++++ os/common/ports/ARMCMx/compilers/GCC/vectors.c | 658 +++++++++++++++++++++ .../ports/ARMCMx/devices/STM32F0xx/cmparams.h | 83 +++ .../ports/ARMCMx/devices/STM32F30x/cmparams.h | 87 +++ .../ports/ARMCMx/devices/STM32F4xx/cmparams.h | 87 +++ os/readme.txt | 29 + os/rt/ports/ARMCMx/compilers/GCC/crt0.c | 354 ----------- os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld | 153 ----- os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld | 154 ----- os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld | 153 ----- os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld | 162 ----- os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld | 162 ----- .../ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld | 183 ------ .../ARMCMx/compilers/GCC/mk/port_stm32f0xx.mk | 15 + .../ARMCMx/compilers/GCC/mk/port_stm32f30x.mk | 15 + .../ARMCMx/compilers/GCC/mk/port_stm32f4xx.mk | 15 + os/rt/ports/ARMCMx/compilers/GCC/rules.mk | 220 ------- os/rt/ports/ARMCMx/compilers/GCC/vectors.c | 658 --------------------- os/rt/ports/ARMCMx/devices/STM32F0xx/port.mk | 15 - os/rt/ports/ARMCMx/devices/STM32F30x/port.mk | 15 - os/rt/ports/ARMCMx/devices/STM32F4xx/port.mk | 15 - 35 files changed, 2550 insertions(+), 2265 deletions(-) create mode 100644 os/common/ports/ARMCMx/compilers/GCC/crt0.c create mode 100644 os/common/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld create mode 100644 os/common/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld create mode 100644 os/common/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld create mode 100644 os/common/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld create mode 100644 os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld create mode 100644 os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld create mode 100644 os/common/ports/ARMCMx/compilers/GCC/rules.mk create mode 100644 os/common/ports/ARMCMx/compilers/GCC/vectors.c create mode 100644 os/common/ports/ARMCMx/devices/STM32F0xx/cmparams.h create mode 100644 os/common/ports/ARMCMx/devices/STM32F30x/cmparams.h create mode 100644 os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h create mode 100644 os/readme.txt delete mode 100644 os/rt/ports/ARMCMx/compilers/GCC/crt0.c delete mode 100644 os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld delete mode 100644 os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld delete mode 100644 os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld delete mode 100644 os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld delete mode 100644 os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld delete mode 100644 os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld create mode 100644 os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f0xx.mk create mode 100644 os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f30x.mk create mode 100644 os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f4xx.mk delete mode 100644 os/rt/ports/ARMCMx/compilers/GCC/rules.mk delete mode 100644 os/rt/ports/ARMCMx/compilers/GCC/vectors.c delete mode 100644 os/rt/ports/ARMCMx/devices/STM32F0xx/port.mk delete mode 100644 os/rt/ports/ARMCMx/devices/STM32F30x/port.mk delete mode 100644 os/rt/ports/ARMCMx/devices/STM32F4xx/port.mk diff --git a/demos/rt/ARMCM0-STM32F051-DISCOVERY/Makefile b/demos/rt/ARMCM0-STM32F051-DISCOVERY/Makefile index b0afd0421..fa4567fb4 100644 --- a/demos/rt/ARMCM0-STM32F051-DISCOVERY/Makefile +++ b/demos/rt/ARMCM0-STM32F051-DISCOVERY/Makefile @@ -64,7 +64,7 @@ include $(CHIBIOS)/os/hal/osal/chibios/osal.mk include $(CHIBIOS)/os/hal/boards/ST_STM32F0_DISCOVERY/board.mk include $(CHIBIOS)/os/hal/platforms/STM32F0xx/platform.mk include $(CHIBIOS)/os/rt/rt.mk -include $(CHIBIOS)/os/rt/ports/ARMCMx/devices/STM32F0xx/port.mk +include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f0xx.mk include $(CHIBIOS)/test/test.mk # Define linker script file here @@ -206,4 +206,4 @@ ifeq ($(USE_FWLIB),yes) USE_OPT += -DUSE_STDPERIPH_DRIVER endif -include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/rules.mk +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/rules.mk diff --git a/demos/rt/ARMCM4-STM32F303-DISCOVERY/Makefile b/demos/rt/ARMCM4-STM32F303-DISCOVERY/Makefile index 3b9345b6e..d6676f786 100644 --- a/demos/rt/ARMCM4-STM32F303-DISCOVERY/Makefile +++ b/demos/rt/ARMCM4-STM32F303-DISCOVERY/Makefile @@ -70,7 +70,7 @@ include $(CHIBIOS)/os/hal/osal/chibios/osal.mk include $(CHIBIOS)/os/hal/boards/ST_STM32F3_DISCOVERY/board.mk include $(CHIBIOS)/os/hal/platforms/STM32F30x/platform.mk include $(CHIBIOS)/os/rt/rt.mk -include $(CHIBIOS)/os/rt/ports/ARMCMx/devices/STM32F30x/port.mk +include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f30x.mk include $(CHIBIOS)/test/test.mk # Define linker script file here @@ -222,4 +222,4 @@ ifeq ($(USE_FWLIB),yes) USE_OPT += -DUSE_STDPERIPH_DRIVER endif -include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/rules.mk +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/rules.mk diff --git a/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/Makefile b/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/Makefile index 3968459dc..2e7dbeeea 100644 --- a/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/Makefile +++ b/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/Makefile @@ -70,7 +70,7 @@ include $(CHIBIOS)/os/hal/osal/chibios/osal.mk include $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY/board.mk include $(CHIBIOS)/os/hal/platforms/STM32F4xx/platform.mk include $(CHIBIOS)/os/rt/rt.mk -include $(CHIBIOS)/os/rt/ports/ARMCMx/devices/STM32F4xx/port.mk +include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f4xx.mk include $(CHIBIOS)/test/test.mk # Define linker script file here @@ -223,4 +223,4 @@ ifeq ($(USE_FWLIB),yes) USE_OPT += -DUSE_STDPERIPH_DRIVER endif -include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/rules.mk +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/rules.mk diff --git a/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/chconf.h b/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/chconf.h index 2efd81b54..2d9e90365 100644 --- a/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/chconf.h +++ b/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/chconf.h @@ -50,7 +50,7 @@ * measurements. */ #if !defined(CH_CFG_RTC_FREQUENCY) || defined(__DOXYGEN__) -#define CH_CFG_RTC_FREQUENCY 72000000 +#define CH_CFG_RTC_FREQUENCY 168000000 #endif /** diff --git a/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/halconf.h b/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/halconf.h index d63d30523..d80a549b9 100644 --- a/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/halconf.h +++ b/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/halconf.h @@ -97,7 +97,7 @@ * @brief Enables the PWM subsystem. */ #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE +#define HAL_USE_PWM TRUE #endif /** @@ -125,14 +125,14 @@ * @brief Enables the SERIAL over USB subsystem. */ #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE +#define HAL_USE_SERIAL_USB TRUE #endif /** * @brief Enables the SPI subsystem. */ #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE +#define HAL_USE_SPI TRUE #endif /** @@ -146,7 +146,7 @@ * @brief Enables the USB subsystem. */ #if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE +#define HAL_USE_USB TRUE #endif /*===========================================================================*/ diff --git a/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/main.c b/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/main.c index e05505cd2..c71f2f1ee 100644 --- a/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/main.c +++ b/demos/rt/ARMCM4-STM32F407-DISCOVERY-MEMS/main.c @@ -50,33 +50,32 @@ static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) { static void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[]) { static const char *states[] = {CH_THD_STATE_NAMES}; - Thread *tp; + thread_t *tp; (void)argv; if (argc > 0) { chprintf(chp, "Usage: threads\r\n"); return; } - chprintf(chp, " addr stack prio refs state time\r\n"); + chprintf(chp, " addr stack prio refs state\r\n"); tp = chRegFirstThread(); do { - chprintf(chp, "%.8lx %.8lx %4lu %4lu %9s %lu\r\n", + chprintf(chp, "%.8lx %.8lx %4lu %4lu %9s\r\n", (uint32_t)tp, (uint32_t)tp->p_ctx.r13, - (uint32_t)tp->p_prio, (uint32_t)(tp->p_refs - 1), - states[tp->p_state], (uint32_t)tp->p_time); + (uint32_t)tp->p_prio, (uint32_t)(tp->p_refs - 1)); tp = chRegNextThread(tp); } while (tp != NULL); } static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[]) { - Thread *tp; + thread_t *tp; (void)argv; if (argc > 0) { chprintf(chp, "Usage: test\r\n"); return; } - tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriority(), + tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriorityX(), TestThread, chp); if (tp == NULL) { chprintf(chp, "out of memory\r\n"); @@ -223,7 +222,7 @@ static msg_t Thread1(void *arg) { * Application entry point. */ int main(void) { - Thread *shelltp = NULL; + thread_t *shelltp = NULL; /* * System initializations. diff --git a/demos/rt/ARMCM4-STM32F407-DISCOVERY/Makefile b/demos/rt/ARMCM4-STM32F407-DISCOVERY/Makefile index 50f0a6188..6c63f1a5b 100644 --- a/demos/rt/ARMCM4-STM32F407-DISCOVERY/Makefile +++ b/demos/rt/ARMCM4-STM32F407-DISCOVERY/Makefile @@ -70,7 +70,7 @@ include $(CHIBIOS)/os/hal/osal/chibios/osal.mk include $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY/board.mk include $(CHIBIOS)/os/hal/platforms/STM32F4xx/platform.mk include $(CHIBIOS)/os/rt/rt.mk -include $(CHIBIOS)/os/rt/ports/ARMCMx/devices/STM32F4xx/port.mk +include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f4xx.mk include $(CHIBIOS)/test/test.mk # Define linker script file here @@ -222,4 +222,4 @@ ifeq ($(USE_FWLIB),yes) USE_OPT += -DUSE_STDPERIPH_DRIVER endif -include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/rules.mk +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/rules.mk diff --git a/os/common/ports/ARMCMx/compilers/GCC/crt0.c b/os/common/ports/ARMCMx/compilers/GCC/crt0.c new file mode 100644 index 000000000..a9b58820e --- /dev/null +++ b/os/common/ports/ARMCMx/compilers/GCC/crt0.c @@ -0,0 +1,354 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file GCC/crt0.c + * @brief Generic GCC ARMvx-M (Cortex-M0/M1/M3/M4) startup file. + * + * @addtogroup ARMCMx_GCC_STARTUP + * @{ + */ + +#include + +#if !defined(FALSE) +#define FALSE 0 +#endif + +#if !defined(TRUE) +#define TRUE (!FALSE) +#endif + +#define SCB_CPACR *((uint32_t *)0xE000ED88U) +#define SCB_FPCCR *((uint32_t *)0xE000EF34U) +#define SCB_FPDSCR *((uint32_t *)0xE000EF3CU) +#define FPCCR_ASPEN (0x1U << 31) +#define FPCCR_LSPEN (0x1U << 30) + +typedef void (*funcp_t)(void); +typedef funcp_t * funcpp_t; + +#define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) + +/* + * Area fill code, it is a macro because here functions cannot be called + * until stacks are initialized. + */ +#define fill32(start, end, filler) { \ + uint32_t *p1 = start; \ + uint32_t *p2 = end; \ + while (p1 < p2) \ + *p1++ = filler; \ +} + +/*===========================================================================*/ +/** + * @name Startup settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Control special register initialization value. + * @details The system is setup to run in privileged mode using the PSP + * stack (dual stack mode). + */ +#if !defined(CRT0_CONTROL_INIT) || defined(__DOXYGEN__) +#define CRT0_CONTROL_INIT 0x00000002 +#endif + +/** + * @brief Stack segments initialization switch. + */ +#if !defined(CRT0_STACKS_FILL_PATTERN) || defined(__DOXYGEN__) +#define CRT0_STACKS_FILL_PATTERN 0x55555555 +#endif + +/** + * @brief Stack segments initialization switch. + */ +#if !defined(CRT0_INIT_STACKS) || defined(__DOXYGEN__) +#define CRT0_INIT_STACKS TRUE +#endif + +/** + * @brief DATA segment initialization switch. + */ +#if !defined(CRT0_INIT_DATA) || defined(__DOXYGEN__) +#define CRT0_INIT_DATA TRUE +#endif + +/** + * @brief BSS segment initialization switch. + */ +#if !defined(CRT0_INIT_BSS) || defined(__DOXYGEN__) +#define CRT0_INIT_BSS TRUE +#endif + +/** + * @brief Constructors invocation switch. + */ +#if !defined(CRT0_CALL_CONSTRUCTORS) || defined(__DOXYGEN__) +#define CRT0_CALL_CONSTRUCTORS TRUE +#endif + +/** + * @brief Destructors invocation switch. + */ +#if !defined(CRT0_CALL_DESTRUCTORS) || defined(__DOXYGEN__) +#define CRT0_CALL_DESTRUCTORS TRUE +#endif + +/** @} */ + +/*===========================================================================*/ +/** + * @name Symbols from the scatter file + */ +/*===========================================================================*/ + +/** + * @brief Main stack lower boundary. + * @details This symbol must be exported by the linker script and represents + * the main stack lower boundary. + */ +extern uint32_t __main_stack_base__; + +/** + * + * @brief Main stack initial position. + * @details This symbol must be exported by the linker script and represents + * the main stack initial position. + */ +extern uint32_t __main_stack_end__; + +/** + * @brief Process stack lower boundary. + * @details This symbol must be exported by the linker script and represents + * the process stack lower boundary. + */ +extern uint32_t __process_stack_base__; + +/** + * @brief Process stack initial position. + * @details This symbol must be exported by the linker script and represents + * the process stack initial position. + */ +extern uint32_t __process_stack_end__; + +/** + * @brief ROM image of the data segment start. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern uint32_t _textdata; + +/** + * @brief Data segment start. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern uint32_t _data; + +/** + * @brief Data segment end. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern uint32_t _edata; + +/** + * @brief BSS segment start. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern uint32_t _bss_start; + +/** + * @brief BSS segment end. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern uint32_t _bss_end; + +/** + * @brief Constructors table start. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern funcp_t __init_array_start; + +/** + * @brief Constructors table end. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern funcp_t __init_array_end; + +/** + * @brief Destructors table start. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern funcp_t __fini_array_start; + +/** + * @brief Destructors table end. + * @pre The symbol must be aligned to a 32 bits boundary. + */ +extern funcp_t __fini_array_end; + +/** @} */ + +/** + * @brief Application @p main() function. + */ +extern void main(void); + +/** + * @brief Early initialization. + * @details This hook is invoked immediately after the stack initialization + * and before the DATA and BSS segments initialization. The + * default behavior is to do nothing. + * @note This function is a weak symbol. + */ +#if !defined(__DOXYGEN__) +__attribute__((weak)) +#endif +void __early_init(void) {} + +/** + * @brief Late initialization. + * @details This hook is invoked after the DATA and BSS segments + * initialization and before any static constructor. The + * default behavior is to do nothing. + * @note This function is a weak symbol. + */ +#if !defined(__DOXYGEN__) +__attribute__((weak)) +#endif +void __late_init(void) {} + +/** + * @brief Default @p main() function exit handler. + * @details This handler is invoked or the @p main() function exit. The + * default behavior is to enter an infinite loop. + * @note This function is a weak symbol. + */ +#if !defined(__DOXYGEN__) +__attribute__((weak, naked)) +#endif +void _default_exit(void) { + while (1) + ; +} + +/** + * @brief Reset vector. + */ +#if !defined(__DOXYGEN__) +__attribute__((naked)) +#endif +void Reset_Handler(void) { + uint32_t psp, reg; + + /* Process Stack initialization, it is allocated starting from the + symbol __process_stack_end__ and its lower limit is the symbol + __process_stack_base__.*/ + asm volatile ("cpsid i"); + psp = SYMVAL(__process_stack_end__); + asm volatile ("msr PSP, %0" : : "r" (psp)); + +#if CORTEX_USE_FPU + /* Initializing the FPU context save in lazy mode.*/ + SCB_FPCCR = FPCCR_ASPEN | FPCCR_LSPEN; + + /* CP10 and CP11 set to full access.*/ + SCB_CPACR |= 0x00F00000; + + /* FPSCR and FPDSCR initially zero.*/ + reg = 0; + asm volatile ("vmsr FPSCR, %0" : : "r" (reg) : "memory"); + SCB_FPDSCR = reg; + + /* CPU mode initialization, enforced FPCA bit.*/ + reg = CRT0_CONTROL_INIT | 4; +#else + /* CPU mode initialization.*/ + reg = CRT0_CONTROL_INIT; +#endif + asm volatile ("msr CONTROL, %0" : : "r" (reg)); + asm volatile ("isb"); + +#if CRT0_INIT_STACKS + /* Main and Process stacks initialization.*/ + fill32(&__main_stack_base__, + &__main_stack_end__, + CRT0_STACKS_FILL_PATTERN); + fill32(&__process_stack_base__, + &__process_stack_end__, + CRT0_STACKS_FILL_PATTERN); +#endif + + /* Early initialization hook invocation.*/ + __early_init(); + +#if CRT0_INIT_DATA + /* DATA segment initialization.*/ + { + uint32_t *tp, *dp; + + tp = &_textdata; + dp = &_data; + while (dp < &_edata) + *dp++ = *tp++; + } +#endif + +#if CRT0_INIT_BSS + /* BSS segment initialization.*/ + fill32(&_bss_start, &_bss_end, 0); +#endif + + /* Late initialization hook invocation.*/ + __late_init(); + +#if CRT0_CALL_CONSTRUCTORS + /* Constructors invocation.*/ + { + funcpp_t fpp = &__init_array_start; + while (fpp < &__init_array_end) { + (*fpp)(); + fpp++; + } + } +#endif + + /* Invoking application main() function.*/ + main(); + +#if CRT0_CALL_DESTRUCTORS + /* Destructors invocation.*/ + { + funcpp_t fpp = &__fini_array_start; + while (fpp < &__fini_array_end) { + (*fpp)(); + fpp++; + } + } +#endif + + /* Invoking the exit handler.*/ + _default_exit(); +} + +/** @} */ diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld new file mode 100644 index 000000000..c9e4e9cd3 --- /dev/null +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld @@ -0,0 +1,153 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F051x8 memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; + +MEMORY +{ + flash : org = 0x08000000, len = 64k + ram : org = 0x20000000, len = 8k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +ENTRY(Reset_Handler) + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + .textalign : ONLY_IF_RO + { + . = ALIGN(8); + } > flash + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .stacks : + { + . = ALIGN(8); + __main_stack_base__ = .; + . += __main_stack_size__; + . = ALIGN(8); + __main_stack_end__ = .; + __process_stack_base__ = .; + __main_thread_stack_base__ = .; + . += __process_stack_size__; + . = ALIGN(8); + __process_stack_end__ = .; + __main_thread_stack_end__ = .; + } > ram + + .data : + { + . = ALIGN(4); + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + . = ALIGN(4); + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__; diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld new file mode 100644 index 000000000..861bdd21d --- /dev/null +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld @@ -0,0 +1,154 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F303xC memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; + +MEMORY +{ + flash : org = 0x08000000, len = 256k + ram : org = 0x20000000, len = 40k + ccmram : org = 0x10000000, len = 8k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +ENTRY(Reset_Handler) + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + .textalign : ONLY_IF_RO + { + . = ALIGN(8); + } > flash + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .stacks : + { + . = ALIGN(8); + __main_stack_base__ = .; + . += __main_stack_size__; + . = ALIGN(8); + __main_stack_end__ = .; + __process_stack_base__ = .; + __main_thread_stack_base__ = .; + . += __process_stack_size__; + . = ALIGN(8); + __process_stack_end__ = .; + __main_thread_stack_end__ = .; + } > ram + + .data : + { + . = ALIGN(4); + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + . = ALIGN(4); + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__; diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld new file mode 100644 index 000000000..6d14877bc --- /dev/null +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld @@ -0,0 +1,153 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F373xC memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; + +MEMORY +{ + flash : org = 0x08000000, len = 256k + ram : org = 0x20000000, len = 32k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +ENTRY(Reset_Handler) + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + .textalign : ONLY_IF_RO + { + . = ALIGN(8); + } > flash + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .stacks : + { + . = ALIGN(8); + __main_stack_base__ = .; + . += __main_stack_size__; + . = ALIGN(8); + __main_stack_end__ = .; + __process_stack_base__ = .; + __main_thread_stack_base__ = .; + . += __process_stack_size__; + . = ALIGN(8); + __process_stack_end__ = .; + __main_thread_stack_end__ = .; + } > ram + + .data : + { + . = ALIGN(4); + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + . = ALIGN(4); + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__; diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld new file mode 100644 index 000000000..6c8effd11 --- /dev/null +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld @@ -0,0 +1,162 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + --- + + A special exception to the GPL can be applied should you wish to distribute + a combined work that includes ChibiOS/RT, without being obliged to provide + the source code for any proprietary components. See the file exception.txt + for full details of how and when the exception can be applied. +*/ + +/* + * ST32F405xG memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; + +MEMORY +{ + flash : org = 0x08000000, len = 1M + ram : org = 0x20000000, len = 112k + ethram : org = 0x2001C000, len = 16k + ccmram : org = 0x10000000, len = 64k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +ENTRY(ResetHandler) + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + .textalign : ONLY_IF_RO + { + . = ALIGN(8); + } > flash + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .stacks : + { + . = ALIGN(8); + __main_stack_base__ = .; + . += __main_stack_size__; + . = ALIGN(8); + __main_stack_end__ = .; + __process_stack_base__ = .; + __main_thread_stack_base__ = .; + . += __process_stack_size__; + . = ALIGN(8); + __process_stack_end__ = .; + __main_thread_stack_end__ = .; + } > ram + + .data : + { + . = ALIGN(4); + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + . = ALIGN(4); + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__; diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld new file mode 100644 index 000000000..623b35c77 --- /dev/null +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld @@ -0,0 +1,162 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + --- + + A special exception to the GPL can be applied should you wish to distribute + a combined work that includes ChibiOS/RT, without being obliged to provide + the source code for any proprietary components. See the file exception.txt + for full details of how and when the exception can be applied. +*/ + +/* + * ST32F407xG memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; + +MEMORY +{ + flash : org = 0x08000000, len = 1M + ram : org = 0x20000000, len = 112k + ethram : org = 0x2001C000, len = 16k + ccmram : org = 0x10000000, len = 64k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +ENTRY(Reset_Handler) + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + .textalign : ONLY_IF_RO + { + . = ALIGN(8); + } > flash + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .stacks : + { + . = ALIGN(8); + __main_stack_base__ = .; + . += __main_stack_size__; + . = ALIGN(8); + __main_stack_end__ = .; + __process_stack_base__ = .; + __main_thread_stack_base__ = .; + . += __process_stack_size__; + . = ALIGN(8); + __process_stack_end__ = .; + __main_thread_stack_end__ = .; + } > ram + + .data : + { + . = ALIGN(4); + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + . = ALIGN(4); + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__; diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld new file mode 100644 index 000000000..39a7defcc --- /dev/null +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld @@ -0,0 +1,183 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + --- + + A special exception to the GPL can be applied should you wish to distribute + a combined work that includes ChibiOS/RT, without being obliged to provide + the source code for any proprietary components. See the file exception.txt + for full details of how and when the exception can be applied. +*/ + +/* + * ST32F407xG memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; + +MEMORY +{ + flash : org = 0x08000000, len = 1M + ram : org = 0x20000000, len = 112k + ethram : org = 0x2001C000, len = 16k + ccmram : org = 0x10000000, len = 64k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +ENTRY(Reset_Handler) + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + .textalign : ONLY_IF_RO + { + . = ALIGN(8); + } > flash + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .stacks : + { + . = ALIGN(8); + __main_stack_base__ = .; + . += __main_stack_size__; + . = ALIGN(8); + __main_stack_end__ = .; + __process_stack_base__ = .; + __main_thread_stack_base__ = .; + . += __process_stack_size__; + . = ALIGN(8); + __process_stack_end__ = .; + __main_thread_stack_end__ = .; + } > ccmram + + .ccm : + { + PROVIDE(_cmm_start = .); + . = ALIGN(4); + *(.bss.mainthread.*) + . = ALIGN(4); + *(.bss._idle_thread_wa) + . = ALIGN(4); + *(.bss.rlist) + . = ALIGN(4); + *(.bss.vtlist) + . = ALIGN(4); + *(.bss.endmem) + . = ALIGN(4); + *(.bss.nextmem) + . = ALIGN(4); + *(.bss.default_heap) + . = ALIGN(4); + PROVIDE(_cmm_end = .); + } > ccmram + + .data : + { + . = ALIGN(4); + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + . = ALIGN(4); + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__; diff --git a/os/common/ports/ARMCMx/compilers/GCC/rules.mk b/os/common/ports/ARMCMx/compilers/GCC/rules.mk new file mode 100644 index 000000000..33531d201 --- /dev/null +++ b/os/common/ports/ARMCMx/compilers/GCC/rules.mk @@ -0,0 +1,220 @@ +# ARM Cortex-Mx common makefile scripts and rules. + +# Output directory and files +ifeq ($(BUILDDIR),) + BUILDDIR = build +endif +ifeq ($(BUILDDIR),.) + BUILDDIR = build +endif +OUTFILES = $(BUILDDIR)/$(PROJECT).elf $(BUILDDIR)/$(PROJECT).hex \ + $(BUILDDIR)/$(PROJECT).bin $(BUILDDIR)/$(PROJECT).dmp + +# Automatic compiler options +OPT = $(USE_OPT) +COPT = $(USE_COPT) +CPPOPT = $(USE_CPPOPT) +ifeq ($(USE_LINK_GC),yes) + OPT += -ffunction-sections -fdata-sections -fno-common +endif + +# Source files groups and paths +ifeq ($(USE_THUMB),yes) + TCSRC += $(CSRC) + TCPPSRC += $(CPPSRC) +else + ACSRC += $(CSRC) + ACPPSRC += $(CPPSRC) +endif +ASRC = $(ACSRC)$(ACPPSRC) +TSRC = $(TCSRC)$(TCPPSRC) +SRCPATHS = $(sort $(dir $(ASMXSRC)) $(dir $(ASMSRC)) $(dir $(ASRC)) $(dir $(TSRC))) + +# Various directories +OBJDIR = $(BUILDDIR)/obj +LSTDIR = $(BUILDDIR)/lst + +# Object files groups +ACOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ACSRC:.c=.o))) +ACPPOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ACPPSRC:.cpp=.o))) +TCOBJS = $(addprefix $(OBJDIR)/, $(notdir $(TCSRC:.c=.o))) +TCPPOBJS = $(addprefix $(OBJDIR)/, $(notdir $(TCPPSRC:.cpp=.o))) +ASMOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMSRC:.s=.o))) +ASMXOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMXSRC:.S=.o))) +OBJS = $(ASMXOBJS) $(ASMOBJS) $(ACOBJS) $(TCOBJS) $(ACPPOBJS) $(TCPPOBJS) + +# Paths +IINCDIR = $(patsubst %,-I%,$(INCDIR) $(DINCDIR) $(UINCDIR)) +LLIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR)) + +# Macros +DEFS = $(DDEFS) $(UDEFS) +ADEFS = $(DADEFS) $(UADEFS) + +# Libs +LIBS = $(DLIBS) $(ULIBS) + +# Various settings +MCFLAGS = -mcpu=$(MCU) +ODFLAGS = -x --syms +ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS) +ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS) +CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS) +CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS) +ifeq ($(USE_LINK_GC),yes) + LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR) +else + LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch $(LLIBDIR) +endif + +# Thumb interwork enabled only if needed because it kills performance. +ifneq ($(TSRC),) + CFLAGS += -DTHUMB_PRESENT + CPPFLAGS += -DTHUMB_PRESENT + ASFLAGS += -DTHUMB_PRESENT + ifneq ($(ASRC),) + # Mixed ARM and THUMB mode. + CFLAGS += -mthumb-interwork + CPPFLAGS += -mthumb-interwork + ASFLAGS += -mthumb-interwork + LDFLAGS += -mthumb-interwork + else + # Pure THUMB mode, THUMB C code cannot be called by ARM asm code directly. + CFLAGS += -mno-thumb-interwork -DTHUMB_NO_INTERWORKING + CPPFLAGS += -mno-thumb-interwork -DTHUMB_NO_INTERWORKING + ASFLAGS += -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb + LDFLAGS += -mno-thumb-interwork -mthumb + endif +else + # Pure ARM mode + CFLAGS += -mno-thumb-interwork + CPPFLAGS += -mno-thumb-interwork + ASFLAGS += -mno-thumb-interwork + LDFLAGS += -mno-thumb-interwork +endif + +# Generate dependency information +CFLAGS += -MD -MP -MF .dep/$(@F).d +CPPFLAGS += -MD -MP -MF .dep/$(@F).d + +# Paths where to search for sources +VPATH = $(SRCPATHS) + +# +# Makefile rules +# + +all: $(OBJS) $(OUTFILES) MAKE_ALL_RULE_HOOK + +MAKE_ALL_RULE_HOOK: + +$(OBJS): | $(BUILDDIR) + +$(BUILDDIR) $(OBJDIR) $(LSTDIR): +ifneq ($(USE_VERBOSE_COMPILE),yes) + @echo Compiler Options + @echo $(CC) -c $(CFLAGS) -I. $(IINCDIR) main.c -o main.o + @echo +endif + mkdir -p $(OBJDIR) + mkdir -p $(LSTDIR) + +$(ACPPOBJS) : $(OBJDIR)/%.o : %.cpp Makefile +ifeq ($(USE_VERBOSE_COMPILE),yes) + @echo + $(CPPC) -c $(CPPFLAGS) $(AOPT) -I. $(IINCDIR) $< -o $@ +else + @echo Compiling $( $@ +else + @echo Creating $@ + @$(OD) $(ODFLAGS) $< > $@ + @echo Done +endif + +clean: + @echo Cleaning + -rm -fR .dep $(BUILDDIR) + @echo Done + +# +# Include the dependency files, should be the last of the makefile +# +-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) + +# *** EOF *** diff --git a/os/common/ports/ARMCMx/compilers/GCC/vectors.c b/os/common/ports/ARMCMx/compilers/GCC/vectors.c new file mode 100644 index 000000000..707f8b7b1 --- /dev/null +++ b/os/common/ports/ARMCMx/compilers/GCC/vectors.c @@ -0,0 +1,658 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file GCC/ARMCMx/STM32F4xx/vectors.c + * @brief Interrupt vectors for the STM32F4xx family. + * + * @defgroup ARMCMx_STM32F4xx_VECTORS STM32F4xx Interrupt Vectors + * @ingroup ARMCMx_SPECIFIC + * @details Interrupt vectors for the STM32F4xx family. + * @{ + */ + +#include +#include + +#include "cmparams.h" + +#if (CORTEX_NUM_VECTORS & 7) != 0 +#error "the constant CORTEX_NUM_VECTORS must be a multiple of 8" +#endif + +#if (CORTEX_NUM_VECTORS < 8) || (CORTEX_NUM_VECTORS > 240) +#error "the constant CORTEX_NUM_VECTORS must be between 8 and 240 inclusive" +#endif + +/** + * @brief Type of an IRQ vector. + */ +typedef void (*irq_vector_t)(void); + +/** + * @brief Type of a structure representing the whole vectors table. + */ +typedef struct { + uint32_t *init_stack; + irq_vector_t reset_handler; + irq_vector_t nmi_handler; + irq_vector_t hardfault_handler; + irq_vector_t memmanage_handler; + irq_vector_t busfault_handler; + irq_vector_t usagefault_handler; + irq_vector_t vector1c; + irq_vector_t vector20; + irq_vector_t vector24; + irq_vector_t vector28; + irq_vector_t svc_handler; + irq_vector_t debugmonitor_handler; + irq_vector_t vector34; + irq_vector_t pendsv_handler; + irq_vector_t systick_handler; + irq_vector_t vectors[CORTEX_NUM_VECTORS]; +} vectors_t; + +/** + * @brief Unhandled exceptions handler. + * @details Any undefined exception vector points to this function by default. + * This function simply stops the system into an infinite loop. + * + * @notapi + */ +#if !defined(__DOXYGEN__) +__attribute__ ((naked)) +#endif +void _unhandled_exception(void) { + + while (true) + ; +} + +#if !defined(__DOXYGEN__) +extern uint32_t __main_stack_end__; +void Reset_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); +void NMI_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); +void HardFault_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); +void MemManage_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); +void BusFault_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); +void UsageFault_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1C(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector20(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector24(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector28(void) __attribute__((weak, alias("_unhandled_exception"))); +void SVC_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); +void DebugMon_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector34(void) __attribute__((weak, alias("_unhandled_exception"))); +void PendSV_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); +void SysTick_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector40(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector44(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector48(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector4C(void) __attribute__((weak, alias("_unhandled_exception"))); +#if CORTEX_NUM_VECTORS > 4 +void Vector50(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector54(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector58(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector5C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 8 +void Vector60(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector64(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector68(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector6C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 12 +void Vector70(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector74(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector78(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector7C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 16 +void Vector80(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector84(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector88(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector8C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 20 +void Vector90(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector94(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector98(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector9C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 24 +void VectorA0(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorA4(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorA8(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorAC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 28 +void VectorB0(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorB4(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorB8(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorBC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 32 +void VectorC0(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorC4(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorC8(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorCC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 36 +void VectorD0(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorD4(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorD8(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorDC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 40 +void VectorE0(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorE4(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorE8(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorEC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 44 +void VectorF0(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorF4(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorF8(void) __attribute__((weak, alias("_unhandled_exception"))); +void VectorFC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 48 +void Vector100(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector104(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector108(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector10C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 52 +void Vector110(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector114(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector118(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector11C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 56 +void Vector120(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector124(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector128(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector12C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 60 +void Vector130(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector134(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector138(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector13C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 64 +void Vector140(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector144(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector148(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector14C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 68 +void Vector150(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector154(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector158(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector15C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 72 +void Vector160(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector164(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector168(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector16C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 76 +void Vector170(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector174(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector178(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector17C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 80 +void Vector180(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector184(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector188(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector18C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 84 +void Vector190(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector194(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector198(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector19C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 88 +void Vector1A0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1A4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1A8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1AC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 92 +void Vector1B0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1B4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1B8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1BC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 96 +void Vector1C0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1C4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1C8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1CC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 100 +void Vector1D0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1D4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1D8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1DC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 104 +void Vector1E0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1E4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1E8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1EC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 108 +void Vector1F0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1F4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1F8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector1FC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 112 +void Vector200(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector204(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector208(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector20C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 116 +void Vector210(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector214(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector218(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector21C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 120 +void Vector220(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector224(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector228(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector22C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 124 +void Vector230(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector234(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector238(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector23C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 128 +void Vector240(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector244(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector248(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector24C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 132 +void Vector250(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector254(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector258(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector25C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 136 +void Vector260(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector264(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector268(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector26C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 140 +void Vector270(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector274(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector278(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector27C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 144 +void Vector280(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector284(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector288(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector28C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 148 +void Vector290(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector294(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector298(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector29C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 152 +void Vector2A0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2A4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2A8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2AC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 156 +void Vector2B0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2B4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2B8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2BC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 160 +void Vector2C0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2C4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2C8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2CC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 164 +void Vector2D0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2D4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2D8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2DC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 168 +void Vector2E0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2E4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2E8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2EC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 172 +void Vector2F0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2F4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2F8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector2FC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 176 +void Vector300(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector304(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector308(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector30C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 180 +void Vector310(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector314(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector318(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector31C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 184 +void Vector320(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector324(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector328(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector32C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 188 +void Vector330(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector334(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector338(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector33C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 192 +void Vector340(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector344(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector348(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector34C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 196 +void Vector350(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector354(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector358(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector35C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 200 +void Vector360(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector364(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector368(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector36C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 204 +void Vector370(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector374(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector378(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector37C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 208 +void Vector380(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector384(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector388(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector38C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 212 +void Vector390(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector394(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector398(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector39C(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 216 +void Vector3A0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3A4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3A8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3AC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 220 +void Vector3B0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3B4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3B8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3BC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 224 +void Vector3C0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3C4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3C8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3CC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 228 +void Vector3D0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3D4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3D8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3DC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 232 +void Vector3E0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3E4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3E8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3EC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#if CORTEX_NUM_VECTORS > 236 +void Vector3F0(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3F4(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3F8(void) __attribute__((weak, alias("_unhandled_exception"))); +void Vector3FC(void) __attribute__((weak, alias("_unhandled_exception"))); +#endif +#endif /* !defined(__DOXYGEN__) */ + +/** + * @brief STM32 vectors table. + */ +#if !defined(__DOXYGEN__) +__attribute__ ((section("vectors"))) +#endif +vectors_t _vectors = { + &__main_stack_end__,Reset_Handler, NMI_Handler, HardFault_Handler, + MemManage_Handler, BusFault_Handler, UsageFault_Handler, Vector1C, + Vector20, Vector24, Vector28, SVC_Handler, + DebugMon_Handler, Vector34, PendSV_Handler, SysTick_Handler, + { + Vector40, Vector44, Vector48, Vector4C, +#if CORTEX_NUM_VECTORS > 4 + Vector50, Vector54, Vector58, Vector5C, +#endif +#if CORTEX_NUM_VECTORS > 8 + Vector60, Vector64, Vector68, Vector6C, +#endif +#if CORTEX_NUM_VECTORS > 12 + Vector70, Vector74, Vector78, Vector7C, +#endif +#if CORTEX_NUM_VECTORS > 16 + Vector80, Vector84, Vector88, Vector8C, +#endif +#if CORTEX_NUM_VECTORS > 20 + Vector90, Vector94, Vector98, Vector9C, +#endif +#if CORTEX_NUM_VECTORS > 24 + VectorA0, VectorA4, VectorA8, VectorAC, +#endif +#if CORTEX_NUM_VECTORS > 28 + VectorB0, VectorB4, VectorB8, VectorBC, +#endif +#if CORTEX_NUM_VECTORS > 32 + VectorC0, VectorC4, VectorC8, VectorCC, +#endif +#if CORTEX_NUM_VECTORS > 36 + VectorD0, VectorD4, VectorD8, VectorDC, +#endif +#if CORTEX_NUM_VECTORS > 40 + VectorE0, VectorE4, VectorE8, VectorEC, +#endif +#if CORTEX_NUM_VECTORS > 44 + VectorF0, VectorF4, VectorF8, VectorFC, +#endif +#if CORTEX_NUM_VECTORS > 48 + Vector100, Vector104, Vector108, Vector10C, +#endif +#if CORTEX_NUM_VECTORS > 52 + Vector110, Vector114, Vector118, Vector11C, +#endif +#if CORTEX_NUM_VECTORS > 56 + Vector120, Vector124, Vector128, Vector12C, +#endif +#if CORTEX_NUM_VECTORS > 60 + Vector130, Vector134, Vector138, Vector13C, +#endif +#if CORTEX_NUM_VECTORS > 64 + Vector140, Vector144, Vector148, Vector14C, +#endif +#if CORTEX_NUM_VECTORS > 68 + Vector150, Vector154, Vector158, Vector15C, +#endif +#if CORTEX_NUM_VECTORS > 72 + Vector160, Vector164, Vector168, Vector16C, +#endif +#if CORTEX_NUM_VECTORS > 76 + Vector170, Vector174, Vector178, Vector17C, +#endif +#if CORTEX_NUM_VECTORS > 80 + Vector180, Vector184, Vector188, Vector17C, +#endif +#if CORTEX_NUM_VECTORS > 84 + Vector190, Vector194, Vector198, Vector19C, +#endif +#if CORTEX_NUM_VECTORS > 88 + Vector1A0, Vector1A4, Vector1A8, Vector1AC, +#endif +#if CORTEX_NUM_VECTORS > 92 + Vector1B0, Vector1B4, Vector1B8, Vector1BC, +#endif +#if CORTEX_NUM_VECTORS > 96 + Vector1C0, Vector1C4, Vector1C8, Vector1CC, +#endif +#if CORTEX_NUM_VECTORS > 100 + Vector1D0, Vector1D4, Vector1D8, Vector1DC, +#endif +#if CORTEX_NUM_VECTORS > 104 + Vector1E0, Vector1E4, Vector1E8, Vector1EC, +#endif +#if CORTEX_NUM_VECTORS > 108 + Vector1F0, Vector1F4, Vector1F8, Vector1FC, +#endif +#if CORTEX_NUM_VECTORS > 112 + Vector200, Vector204, Vector208, Vector20C, +#endif +#if CORTEX_NUM_VECTORS > 116 + Vector210, Vector214, Vector218, Vector21C, +#endif +#if CORTEX_NUM_VECTORS > 120 + Vector220, Vector224, Vector228, Vector22C, +#endif +#if CORTEX_NUM_VECTORS > 124 + Vector230, Vector234, Vector238, Vector23C, +#endif +#if CORTEX_NUM_VECTORS > 128 + Vector240, Vector244, Vector248, Vector24C, +#endif +#if CORTEX_NUM_VECTORS > 132 + Vector250, Vector254, Vector258, Vector25C, +#endif +#if CORTEX_NUM_VECTORS > 136 + Vector260, Vector264, Vector268, Vector26C, +#endif +#if CORTEX_NUM_VECTORS > 140 + Vector270, Vector274, Vector278, Vector27C, +#endif +#if CORTEX_NUM_VECTORS > 144 + Vector280, Vector284, Vector288, Vector28C, +#endif +#if CORTEX_NUM_VECTORS > 148 + Vector290, Vector294, Vector298, Vector29C, +#endif +#if CORTEX_NUM_VECTORS > 152 + Vector2A0, Vector2A4, Vector2A8, Vector2AC, +#endif +#if CORTEX_NUM_VECTORS > 156 + Vector2B0, Vector2B4, Vector2B8, Vector2BC, +#endif +#if CORTEX_NUM_VECTORS > 160 + Vector2C0, Vector2C4, Vector2C8, Vector2CC, +#endif +#if CORTEX_NUM_VECTORS > 164 + Vector2D0, Vector2D4, Vector2D8, Vector2DC, +#endif +#if CORTEX_NUM_VECTORS > 168 + Vector2E0, Vector2E4, Vector2E8, Vector2EC, +#endif +#if CORTEX_NUM_VECTORS > 172 + Vector2F0, Vector2F4, Vector2F8, Vector2FC, +#endif +#if CORTEX_NUM_VECTORS > 176 + Vector300, Vector304, Vector308, Vector30C, +#endif +#if CORTEX_NUM_VECTORS > 180 + Vector310, Vector314, Vector318, Vector31C, +#endif +#if CORTEX_NUM_VECTORS > 184 + Vector320, Vector324, Vector328, Vector32C, +#endif +#if CORTEX_NUM_VECTORS > 188 + Vector330, Vector334, Vector338, Vector33C, +#endif +#if CORTEX_NUM_VECTORS > 192 + Vector340, Vector344, Vector348, Vector34C, +#endif +#if CORTEX_NUM_VECTORS > 196 + Vector350, Vector354, Vector358, Vector35C, +#endif +#if CORTEX_NUM_VECTORS > 200 + Vector360, Vector364, Vector368, Vector36C, +#endif +#if CORTEX_NUM_VECTORS > 204 + Vector370, Vector374, Vector378, Vector37C, +#endif +#if CORTEX_NUM_VECTORS > 208 + Vector380, Vector384, Vector388, Vector38C, +#endif +#if CORTEX_NUM_VECTORS > 212 + Vector390, Vector394, Vector398, Vector39C, +#endif +#if CORTEX_NUM_VECTORS > 216 + Vector3A0, Vector3A4, Vector3A8, Vector3AC, +#endif +#if CORTEX_NUM_VECTORS > 220 + Vector3B0, Vector3B4, Vector3B8, Vector3BC, +#endif +#if CORTEX_NUM_VECTORS > 224 + Vector3C0, Vector3C4, Vector3C8, Vector3CC, +#endif +#if CORTEX_NUM_VECTORS > 228 + Vector3D0, Vector3D4, Vector3D8, Vector3DC +#endif +#if CORTEX_NUM_VECTORS > 232 + Vector3E0, Vector3E4, Vector3E8, Vector3EC +#endif +#if CORTEX_NUM_VECTORS > 236 + Vector3F0, Vector3F4, Vector3F8, Vector3FC +#endif + } +}; + +/** @} */ diff --git a/os/common/ports/ARMCMx/devices/STM32F0xx/cmparams.h b/os/common/ports/ARMCMx/devices/STM32F0xx/cmparams.h new file mode 100644 index 000000000..ed563b106 --- /dev/null +++ b/os/common/ports/ARMCMx/devices/STM32F0xx/cmparams.h @@ -0,0 +1,83 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file STM32F0xx/cmparams.h + * @brief ARM Cortex-M0 parameters for the STM32F0xx. + * + * @defgroup ARMCMx_STM32F0xx STM32F0xx Specific Parameters + * @ingroup ARMCMx_SPECIFIC + * @details This file contains the Cortex-M0 specific parameters for the + * STM32F0xx platform. + * @{ + */ + +#ifndef _CMPARAMS_H_ +#define _CMPARAMS_H_ + +/** + * @brief Cortex core model. + */ +#define CORTEX_MODEL CORTEX_M0 + +/** + * @brief Memory Protection unit presence. + */ +#define CORTEX_HAS_MPU 0 + +/** + * @brief Floating Point unit presence. + */ +#define CORTEX_HAS_FPU 0 + +/** + * @brief Number of bits in priority masks. + */ +#define CORTEX_PRIORITY_BITS 2 + +/** + * @brief Number of interrupt vectors. + * @note This number does not include the 16 system vectors and must be + * rounded to a multiple of 4. + */ +#define CORTEX_NUM_VECTORS 32 + +/* The following code is not processed when the file is included from an + asm module.*/ +#if !defined(_FROM_ASM_) + +/* Including the device CMSIS header. Note, we are not using the definitions + from this header because we need this file to be usable also from + assembler source files. We verify that the info matches instead.*/ +#include "stm32f0xx.h" + +#if !CORTEX_HAS_MPU != !__MPU_PRESENT +#error "CMSIS __MPU_PRESENT mismatch" +#endif + +#if CORTEX_PRIORITY_BITS != __NVIC_PRIO_BITS +#error "CMSIS __NVIC_PRIO_BITS mismatch" +#endif + +#endif /* !defined(_FROM_ASM_) */ + +#endif /* _CMPARAMS_H_ */ + +/** @} */ diff --git a/os/common/ports/ARMCMx/devices/STM32F30x/cmparams.h b/os/common/ports/ARMCMx/devices/STM32F30x/cmparams.h new file mode 100644 index 000000000..84efdb0d3 --- /dev/null +++ b/os/common/ports/ARMCMx/devices/STM32F30x/cmparams.h @@ -0,0 +1,87 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file STM32F3xx/cmparams.h + * @brief ARM Cortex-M4 parameters for the STM32F3xx. + * + * @defgroup ARMCMx_STM32F3xx STM32F3xx Specific Parameters + * @ingroup ARMCMx_SPECIFIC + * @details This file contains the Cortex-M4 specific parameters for the + * STM32F3xx platform. + * @{ + */ + +#ifndef _CMPARAMS_H_ +#define _CMPARAMS_H_ + +/** + * @brief Cortex core model. + */ +#define CORTEX_MODEL CORTEX_M4 + +/** + * @brief Memory Protection unit presence. + */ +#define CORTEX_HAS_MPU 1 + +/** + * @brief Floating Point unit presence. + */ +#define CORTEX_HAS_FPU 1 + +/** + * @brief Number of bits in priority masks. + */ +#define CORTEX_PRIORITY_BITS 4 + +/** + * @brief Number of interrupt vectors. + * @note This number does not include the 16 system vectors and must be + * rounded to a multiple of 4. + */ +#define CORTEX_NUM_VECTORS 88 + +/* The following code is not processed when the file is included from an + asm module.*/ +#if !defined(_FROM_ASM_) + +/* Including the device CMSIS header. Note, we are not using the definitions + from this header because we need this file to be usable also from + assembler source files. We verify that the info matches instead.*/ +#include "stm32f30x.h" + +#if !CORTEX_HAS_MPU != !__MPU_PRESENT +#error "CMSIS __MPU_PRESENT mismatch" +#endif + +#if !CORTEX_HAS_FPU != !__FPU_PRESENT +#error "CMSIS __FPU_PRESENT mismatch" +#endif + +#if CORTEX_PRIORITY_BITS != __NVIC_PRIO_BITS +#error "CMSIS __NVIC_PRIO_BITS mismatch" +#endif + +#endif /* !defined(_FROM_ASM_) */ + +#endif /* _CMPARAMS_H_ */ + +/** @} */ diff --git a/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h b/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h new file mode 100644 index 000000000..48e279e56 --- /dev/null +++ b/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h @@ -0,0 +1,87 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file STM32F4xx/cmparams.h + * @brief ARM Cortex-M4 parameters for the STM32F4xx. + * + * @defgroup ARMCMx_STM32F4xx STM32F4xx Specific Parameters + * @ingroup ARMCMx_SPECIFIC + * @details This file contains the Cortex-M4 specific parameters for the + * STM32F4xx platform. + * @{ + */ + +#ifndef _CMPARAMS_H_ +#define _CMPARAMS_H_ + +/** + * @brief Cortex core model. + */ +#define CORTEX_MODEL CORTEX_M4 + +/** + * @brief Memory Protection unit presence. + */ +#define CORTEX_HAS_MPU 1 + +/** + * @brief Floating Point unit presence. + */ +#define CORTEX_HAS_FPU 1 + +/** + * @brief Number of bits in priority masks. + */ +#define CORTEX_PRIORITY_BITS 4 + +/** + * @brief Number of interrupt vectors. + * @note This number does not include the 16 system vectors and must be + * rounded to a multiple of 4. + */ +#define CORTEX_NUM_VECTORS 88 + +/* The following code is not processed when the file is included from an + asm module.*/ +#if !defined(_FROM_ASM_) + +/* Including the device CMSIS header. Note, we are not using the definitions + from this header because we need this file to be usable also from + assembler source files. We verify that the info matches instead.*/ +#include "stm32f4xx.h" + +#if !CORTEX_HAS_MPU != !__MPU_PRESENT +#error "CMSIS __MPU_PRESENT mismatch" +#endif + +#if !CORTEX_HAS_FPU != !__FPU_PRESENT +#error "CMSIS __FPU_PRESENT mismatch" +#endif + +#if CORTEX_PRIORITY_BITS != __NVIC_PRIO_BITS +#error "CMSIS __NVIC_PRIO_BITS mismatch" +#endif + +#endif /* !defined(_FROM_ASM_) */ + +#endif /* _CMPARAMS_H_ */ + +/** @} */ diff --git a/os/readme.txt b/os/readme.txt new file mode 100644 index 000000000..1c69d9a98 --- /dev/null +++ b/os/readme.txt @@ -0,0 +1,29 @@ +***************************************************************************** +*** ChibiOS products directory organization *** +***************************************************************************** + +--{root} - Distribution directory. + +--os/ - ChibiOS products, this directory. + | +--ext/ - Vendor files. + | +--common/ - Files used by multiple ChibiOS products. + | | +--ports - Common port files for various architectures and + | | compilers. + | +--hal/ - Hardware Abstraction Layer product. + | | +--include/ - HAL high level headers. + | | +--src/ - HAL high level sources. + | | +--platforms/ - HAL low level drivers implementations. + | | +--templates/ - Driver template files. + | | +--meta/ - Driver meta templates. + | +--rt/ - ChibiOS/RT kernel portable files. + | | +--include/ - RT kernel headers. + | | +--src/ - RT kernel sources. + | | +--templates/ - RT kernel port template files. + | | +--ports - RT kernel port files for various architectures and + | | compilers. + | +--nil/ - ChibiOS/NIL kernel portable files. + | | +--include/ - Nil kernel headers. + | | +--src/ - Nil kernel sources. + | | +--templates/ - Nil kernel port template files. + | | +--ports - Nil kernel port files for various architectures and + | | compilers. + | +--various/ - Various portable support files. diff --git a/os/rt/ports/ARMCMx/compilers/GCC/crt0.c b/os/rt/ports/ARMCMx/compilers/GCC/crt0.c deleted file mode 100644 index a9b58820e..000000000 --- a/os/rt/ports/ARMCMx/compilers/GCC/crt0.c +++ /dev/null @@ -1,354 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file GCC/crt0.c - * @brief Generic GCC ARMvx-M (Cortex-M0/M1/M3/M4) startup file. - * - * @addtogroup ARMCMx_GCC_STARTUP - * @{ - */ - -#include - -#if !defined(FALSE) -#define FALSE 0 -#endif - -#if !defined(TRUE) -#define TRUE (!FALSE) -#endif - -#define SCB_CPACR *((uint32_t *)0xE000ED88U) -#define SCB_FPCCR *((uint32_t *)0xE000EF34U) -#define SCB_FPDSCR *((uint32_t *)0xE000EF3CU) -#define FPCCR_ASPEN (0x1U << 31) -#define FPCCR_LSPEN (0x1U << 30) - -typedef void (*funcp_t)(void); -typedef funcp_t * funcpp_t; - -#define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) - -/* - * Area fill code, it is a macro because here functions cannot be called - * until stacks are initialized. - */ -#define fill32(start, end, filler) { \ - uint32_t *p1 = start; \ - uint32_t *p2 = end; \ - while (p1 < p2) \ - *p1++ = filler; \ -} - -/*===========================================================================*/ -/** - * @name Startup settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Control special register initialization value. - * @details The system is setup to run in privileged mode using the PSP - * stack (dual stack mode). - */ -#if !defined(CRT0_CONTROL_INIT) || defined(__DOXYGEN__) -#define CRT0_CONTROL_INIT 0x00000002 -#endif - -/** - * @brief Stack segments initialization switch. - */ -#if !defined(CRT0_STACKS_FILL_PATTERN) || defined(__DOXYGEN__) -#define CRT0_STACKS_FILL_PATTERN 0x55555555 -#endif - -/** - * @brief Stack segments initialization switch. - */ -#if !defined(CRT0_INIT_STACKS) || defined(__DOXYGEN__) -#define CRT0_INIT_STACKS TRUE -#endif - -/** - * @brief DATA segment initialization switch. - */ -#if !defined(CRT0_INIT_DATA) || defined(__DOXYGEN__) -#define CRT0_INIT_DATA TRUE -#endif - -/** - * @brief BSS segment initialization switch. - */ -#if !defined(CRT0_INIT_BSS) || defined(__DOXYGEN__) -#define CRT0_INIT_BSS TRUE -#endif - -/** - * @brief Constructors invocation switch. - */ -#if !defined(CRT0_CALL_CONSTRUCTORS) || defined(__DOXYGEN__) -#define CRT0_CALL_CONSTRUCTORS TRUE -#endif - -/** - * @brief Destructors invocation switch. - */ -#if !defined(CRT0_CALL_DESTRUCTORS) || defined(__DOXYGEN__) -#define CRT0_CALL_DESTRUCTORS TRUE -#endif - -/** @} */ - -/*===========================================================================*/ -/** - * @name Symbols from the scatter file - */ -/*===========================================================================*/ - -/** - * @brief Main stack lower boundary. - * @details This symbol must be exported by the linker script and represents - * the main stack lower boundary. - */ -extern uint32_t __main_stack_base__; - -/** - * - * @brief Main stack initial position. - * @details This symbol must be exported by the linker script and represents - * the main stack initial position. - */ -extern uint32_t __main_stack_end__; - -/** - * @brief Process stack lower boundary. - * @details This symbol must be exported by the linker script and represents - * the process stack lower boundary. - */ -extern uint32_t __process_stack_base__; - -/** - * @brief Process stack initial position. - * @details This symbol must be exported by the linker script and represents - * the process stack initial position. - */ -extern uint32_t __process_stack_end__; - -/** - * @brief ROM image of the data segment start. - * @pre The symbol must be aligned to a 32 bits boundary. - */ -extern uint32_t _textdata; - -/** - * @brief Data segment start. - * @pre The symbol must be aligned to a 32 bits boundary. - */ -extern uint32_t _data; - -/** - * @brief Data segment end. - * @pre The symbol must be aligned to a 32 bits boundary. - */ -extern uint32_t _edata; - -/** - * @brief BSS segment start. - * @pre The symbol must be aligned to a 32 bits boundary. - */ -extern uint32_t _bss_start; - -/** - * @brief BSS segment end. - * @pre The symbol must be aligned to a 32 bits boundary. - */ -extern uint32_t _bss_end; - -/** - * @brief Constructors table start. - * @pre The symbol must be aligned to a 32 bits boundary. - */ -extern funcp_t __init_array_start; - -/** - * @brief Constructors table end. - * @pre The symbol must be aligned to a 32 bits boundary. - */ -extern funcp_t __init_array_end; - -/** - * @brief Destructors table start. - * @pre The symbol must be aligned to a 32 bits boundary. - */ -extern funcp_t __fini_array_start; - -/** - * @brief Destructors table end. - * @pre The symbol must be aligned to a 32 bits boundary. - */ -extern funcp_t __fini_array_end; - -/** @} */ - -/** - * @brief Application @p main() function. - */ -extern void main(void); - -/** - * @brief Early initialization. - * @details This hook is invoked immediately after the stack initialization - * and before the DATA and BSS segments initialization. The - * default behavior is to do nothing. - * @note This function is a weak symbol. - */ -#if !defined(__DOXYGEN__) -__attribute__((weak)) -#endif -void __early_init(void) {} - -/** - * @brief Late initialization. - * @details This hook is invoked after the DATA and BSS segments - * initialization and before any static constructor. The - * default behavior is to do nothing. - * @note This function is a weak symbol. - */ -#if !defined(__DOXYGEN__) -__attribute__((weak)) -#endif -void __late_init(void) {} - -/** - * @brief Default @p main() function exit handler. - * @details This handler is invoked or the @p main() function exit. The - * default behavior is to enter an infinite loop. - * @note This function is a weak symbol. - */ -#if !defined(__DOXYGEN__) -__attribute__((weak, naked)) -#endif -void _default_exit(void) { - while (1) - ; -} - -/** - * @brief Reset vector. - */ -#if !defined(__DOXYGEN__) -__attribute__((naked)) -#endif -void Reset_Handler(void) { - uint32_t psp, reg; - - /* Process Stack initialization, it is allocated starting from the - symbol __process_stack_end__ and its lower limit is the symbol - __process_stack_base__.*/ - asm volatile ("cpsid i"); - psp = SYMVAL(__process_stack_end__); - asm volatile ("msr PSP, %0" : : "r" (psp)); - -#if CORTEX_USE_FPU - /* Initializing the FPU context save in lazy mode.*/ - SCB_FPCCR = FPCCR_ASPEN | FPCCR_LSPEN; - - /* CP10 and CP11 set to full access.*/ - SCB_CPACR |= 0x00F00000; - - /* FPSCR and FPDSCR initially zero.*/ - reg = 0; - asm volatile ("vmsr FPSCR, %0" : : "r" (reg) : "memory"); - SCB_FPDSCR = reg; - - /* CPU mode initialization, enforced FPCA bit.*/ - reg = CRT0_CONTROL_INIT | 4; -#else - /* CPU mode initialization.*/ - reg = CRT0_CONTROL_INIT; -#endif - asm volatile ("msr CONTROL, %0" : : "r" (reg)); - asm volatile ("isb"); - -#if CRT0_INIT_STACKS - /* Main and Process stacks initialization.*/ - fill32(&__main_stack_base__, - &__main_stack_end__, - CRT0_STACKS_FILL_PATTERN); - fill32(&__process_stack_base__, - &__process_stack_end__, - CRT0_STACKS_FILL_PATTERN); -#endif - - /* Early initialization hook invocation.*/ - __early_init(); - -#if CRT0_INIT_DATA - /* DATA segment initialization.*/ - { - uint32_t *tp, *dp; - - tp = &_textdata; - dp = &_data; - while (dp < &_edata) - *dp++ = *tp++; - } -#endif - -#if CRT0_INIT_BSS - /* BSS segment initialization.*/ - fill32(&_bss_start, &_bss_end, 0); -#endif - - /* Late initialization hook invocation.*/ - __late_init(); - -#if CRT0_CALL_CONSTRUCTORS - /* Constructors invocation.*/ - { - funcpp_t fpp = &__init_array_start; - while (fpp < &__init_array_end) { - (*fpp)(); - fpp++; - } - } -#endif - - /* Invoking application main() function.*/ - main(); - -#if CRT0_CALL_DESTRUCTORS - /* Destructors invocation.*/ - { - funcpp_t fpp = &__fini_array_start; - while (fpp < &__fini_array_end) { - (*fpp)(); - fpp++; - } - } -#endif - - /* Invoking the exit handler.*/ - _default_exit(); -} - -/** @} */ diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld b/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld deleted file mode 100644 index c9e4e9cd3..000000000 --- a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld +++ /dev/null @@ -1,153 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * ST32F051x8 memory setup. - */ -__main_stack_size__ = 0x0400; -__process_stack_size__ = 0x0400; - -MEMORY -{ - flash : org = 0x08000000, len = 64k - ram : org = 0x20000000, len = 8k -} - -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; - -ENTRY(Reset_Handler) - -SECTIONS -{ - . = 0; - _text = .; - - startup : ALIGN(16) SUBALIGN(16) - { - KEEP(*(vectors)) - } > flash - - constructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE(__init_array_end = .); - } > flash - - destructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__fini_array_start = .); - KEEP(*(.fini_array)) - KEEP(*(SORT(.fini_array.*))) - PROVIDE(__fini_array_end = .); - } > flash - - .text : ALIGN(16) SUBALIGN(16) - { - *(.text.startup.*) - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > flash - - .ARM.exidx : { - PROVIDE(__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE(__exidx_end = .); - } > flash - - .eh_frame_hdr : - { - *(.eh_frame_hdr) - } > flash - - .eh_frame : ONLY_IF_RO - { - *(.eh_frame) - } > flash - - .textalign : ONLY_IF_RO - { - . = ALIGN(8); - } > flash - - . = ALIGN(4); - _etext = .; - _textdata = _etext; - - .stacks : - { - . = ALIGN(8); - __main_stack_base__ = .; - . += __main_stack_size__; - . = ALIGN(8); - __main_stack_end__ = .; - __process_stack_base__ = .; - __main_thread_stack_base__ = .; - . += __process_stack_size__; - . = ALIGN(8); - __process_stack_end__ = .; - __main_thread_stack_end__ = .; - } > ram - - .data : - { - . = ALIGN(4); - PROVIDE(_data = .); - *(.data) - . = ALIGN(4); - *(.data.*) - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - PROVIDE(_edata = .); - } > ram AT > flash - - .bss : - { - . = ALIGN(4); - PROVIDE(_bss_start = .); - *(.bss) - . = ALIGN(4); - *(.bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE(_bss_end = .); - } > ram -} - -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__; diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld b/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld deleted file mode 100644 index 861bdd21d..000000000 --- a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld +++ /dev/null @@ -1,154 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * ST32F303xC memory setup. - */ -__main_stack_size__ = 0x0400; -__process_stack_size__ = 0x0400; - -MEMORY -{ - flash : org = 0x08000000, len = 256k - ram : org = 0x20000000, len = 40k - ccmram : org = 0x10000000, len = 8k -} - -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; - -ENTRY(Reset_Handler) - -SECTIONS -{ - . = 0; - _text = .; - - startup : ALIGN(16) SUBALIGN(16) - { - KEEP(*(vectors)) - } > flash - - constructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE(__init_array_end = .); - } > flash - - destructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__fini_array_start = .); - KEEP(*(.fini_array)) - KEEP(*(SORT(.fini_array.*))) - PROVIDE(__fini_array_end = .); - } > flash - - .text : ALIGN(16) SUBALIGN(16) - { - *(.text.startup.*) - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > flash - - .ARM.exidx : { - PROVIDE(__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE(__exidx_end = .); - } > flash - - .eh_frame_hdr : - { - *(.eh_frame_hdr) - } > flash - - .eh_frame : ONLY_IF_RO - { - *(.eh_frame) - } > flash - - .textalign : ONLY_IF_RO - { - . = ALIGN(8); - } > flash - - . = ALIGN(4); - _etext = .; - _textdata = _etext; - - .stacks : - { - . = ALIGN(8); - __main_stack_base__ = .; - . += __main_stack_size__; - . = ALIGN(8); - __main_stack_end__ = .; - __process_stack_base__ = .; - __main_thread_stack_base__ = .; - . += __process_stack_size__; - . = ALIGN(8); - __process_stack_end__ = .; - __main_thread_stack_end__ = .; - } > ram - - .data : - { - . = ALIGN(4); - PROVIDE(_data = .); - *(.data) - . = ALIGN(4); - *(.data.*) - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - PROVIDE(_edata = .); - } > ram AT > flash - - .bss : - { - . = ALIGN(4); - PROVIDE(_bss_start = .); - *(.bss) - . = ALIGN(4); - *(.bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE(_bss_end = .); - } > ram -} - -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__; diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld b/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld deleted file mode 100644 index 6d14877bc..000000000 --- a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld +++ /dev/null @@ -1,153 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* - * ST32F373xC memory setup. - */ -__main_stack_size__ = 0x0400; -__process_stack_size__ = 0x0400; - -MEMORY -{ - flash : org = 0x08000000, len = 256k - ram : org = 0x20000000, len = 32k -} - -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; - -ENTRY(Reset_Handler) - -SECTIONS -{ - . = 0; - _text = .; - - startup : ALIGN(16) SUBALIGN(16) - { - KEEP(*(vectors)) - } > flash - - constructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE(__init_array_end = .); - } > flash - - destructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__fini_array_start = .); - KEEP(*(.fini_array)) - KEEP(*(SORT(.fini_array.*))) - PROVIDE(__fini_array_end = .); - } > flash - - .text : ALIGN(16) SUBALIGN(16) - { - *(.text.startup.*) - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > flash - - .ARM.exidx : { - PROVIDE(__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE(__exidx_end = .); - } > flash - - .eh_frame_hdr : - { - *(.eh_frame_hdr) - } > flash - - .eh_frame : ONLY_IF_RO - { - *(.eh_frame) - } > flash - - .textalign : ONLY_IF_RO - { - . = ALIGN(8); - } > flash - - . = ALIGN(4); - _etext = .; - _textdata = _etext; - - .stacks : - { - . = ALIGN(8); - __main_stack_base__ = .; - . += __main_stack_size__; - . = ALIGN(8); - __main_stack_end__ = .; - __process_stack_base__ = .; - __main_thread_stack_base__ = .; - . += __process_stack_size__; - . = ALIGN(8); - __process_stack_end__ = .; - __main_thread_stack_end__ = .; - } > ram - - .data : - { - . = ALIGN(4); - PROVIDE(_data = .); - *(.data) - . = ALIGN(4); - *(.data.*) - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - PROVIDE(_edata = .); - } > ram AT > flash - - .bss : - { - . = ALIGN(4); - PROVIDE(_bss_start = .); - *(.bss) - . = ALIGN(4); - *(.bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE(_bss_end = .); - } > ram -} - -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__; diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld b/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld deleted file mode 100644 index 6c8effd11..000000000 --- a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld +++ /dev/null @@ -1,162 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - --- - - A special exception to the GPL can be applied should you wish to distribute - a combined work that includes ChibiOS/RT, without being obliged to provide - the source code for any proprietary components. See the file exception.txt - for full details of how and when the exception can be applied. -*/ - -/* - * ST32F405xG memory setup. - */ -__main_stack_size__ = 0x0400; -__process_stack_size__ = 0x0400; - -MEMORY -{ - flash : org = 0x08000000, len = 1M - ram : org = 0x20000000, len = 112k - ethram : org = 0x2001C000, len = 16k - ccmram : org = 0x10000000, len = 64k -} - -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; - -ENTRY(ResetHandler) - -SECTIONS -{ - . = 0; - _text = .; - - startup : ALIGN(16) SUBALIGN(16) - { - KEEP(*(vectors)) - } > flash - - constructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE(__init_array_end = .); - } > flash - - destructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__fini_array_start = .); - KEEP(*(.fini_array)) - KEEP(*(SORT(.fini_array.*))) - PROVIDE(__fini_array_end = .); - } > flash - - .text : ALIGN(16) SUBALIGN(16) - { - *(.text.startup.*) - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > flash - - .ARM.exidx : { - PROVIDE(__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE(__exidx_end = .); - } > flash - - .eh_frame_hdr : - { - *(.eh_frame_hdr) - } > flash - - .eh_frame : ONLY_IF_RO - { - *(.eh_frame) - } > flash - - .textalign : ONLY_IF_RO - { - . = ALIGN(8); - } > flash - - . = ALIGN(4); - _etext = .; - _textdata = _etext; - - .stacks : - { - . = ALIGN(8); - __main_stack_base__ = .; - . += __main_stack_size__; - . = ALIGN(8); - __main_stack_end__ = .; - __process_stack_base__ = .; - __main_thread_stack_base__ = .; - . += __process_stack_size__; - . = ALIGN(8); - __process_stack_end__ = .; - __main_thread_stack_end__ = .; - } > ram - - .data : - { - . = ALIGN(4); - PROVIDE(_data = .); - *(.data) - . = ALIGN(4); - *(.data.*) - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - PROVIDE(_edata = .); - } > ram AT > flash - - .bss : - { - . = ALIGN(4); - PROVIDE(_bss_start = .); - *(.bss) - . = ALIGN(4); - *(.bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE(_bss_end = .); - } > ram -} - -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__; diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld b/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld deleted file mode 100644 index 623b35c77..000000000 --- a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld +++ /dev/null @@ -1,162 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - --- - - A special exception to the GPL can be applied should you wish to distribute - a combined work that includes ChibiOS/RT, without being obliged to provide - the source code for any proprietary components. See the file exception.txt - for full details of how and when the exception can be applied. -*/ - -/* - * ST32F407xG memory setup. - */ -__main_stack_size__ = 0x0400; -__process_stack_size__ = 0x0400; - -MEMORY -{ - flash : org = 0x08000000, len = 1M - ram : org = 0x20000000, len = 112k - ethram : org = 0x2001C000, len = 16k - ccmram : org = 0x10000000, len = 64k -} - -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; - -ENTRY(Reset_Handler) - -SECTIONS -{ - . = 0; - _text = .; - - startup : ALIGN(16) SUBALIGN(16) - { - KEEP(*(vectors)) - } > flash - - constructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE(__init_array_end = .); - } > flash - - destructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__fini_array_start = .); - KEEP(*(.fini_array)) - KEEP(*(SORT(.fini_array.*))) - PROVIDE(__fini_array_end = .); - } > flash - - .text : ALIGN(16) SUBALIGN(16) - { - *(.text.startup.*) - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > flash - - .ARM.exidx : { - PROVIDE(__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE(__exidx_end = .); - } > flash - - .eh_frame_hdr : - { - *(.eh_frame_hdr) - } > flash - - .eh_frame : ONLY_IF_RO - { - *(.eh_frame) - } > flash - - .textalign : ONLY_IF_RO - { - . = ALIGN(8); - } > flash - - . = ALIGN(4); - _etext = .; - _textdata = _etext; - - .stacks : - { - . = ALIGN(8); - __main_stack_base__ = .; - . += __main_stack_size__; - . = ALIGN(8); - __main_stack_end__ = .; - __process_stack_base__ = .; - __main_thread_stack_base__ = .; - . += __process_stack_size__; - . = ALIGN(8); - __process_stack_end__ = .; - __main_thread_stack_end__ = .; - } > ram - - .data : - { - . = ALIGN(4); - PROVIDE(_data = .); - *(.data) - . = ALIGN(4); - *(.data.*) - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - PROVIDE(_edata = .); - } > ram AT > flash - - .bss : - { - . = ALIGN(4); - PROVIDE(_bss_start = .); - *(.bss) - . = ALIGN(4); - *(.bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE(_bss_end = .); - } > ram -} - -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__; diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld b/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld deleted file mode 100644 index 39a7defcc..000000000 --- a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld +++ /dev/null @@ -1,183 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - --- - - A special exception to the GPL can be applied should you wish to distribute - a combined work that includes ChibiOS/RT, without being obliged to provide - the source code for any proprietary components. See the file exception.txt - for full details of how and when the exception can be applied. -*/ - -/* - * ST32F407xG memory setup. - */ -__main_stack_size__ = 0x0400; -__process_stack_size__ = 0x0400; - -MEMORY -{ - flash : org = 0x08000000, len = 1M - ram : org = 0x20000000, len = 112k - ethram : org = 0x2001C000, len = 16k - ccmram : org = 0x10000000, len = 64k -} - -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; - -ENTRY(Reset_Handler) - -SECTIONS -{ - . = 0; - _text = .; - - startup : ALIGN(16) SUBALIGN(16) - { - KEEP(*(vectors)) - } > flash - - constructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE(__init_array_end = .); - } > flash - - destructors : ALIGN(4) SUBALIGN(4) - { - PROVIDE(__fini_array_start = .); - KEEP(*(.fini_array)) - KEEP(*(SORT(.fini_array.*))) - PROVIDE(__fini_array_end = .); - } > flash - - .text : ALIGN(16) SUBALIGN(16) - { - *(.text.startup.*) - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > flash - - .ARM.exidx : { - PROVIDE(__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE(__exidx_end = .); - } > flash - - .eh_frame_hdr : - { - *(.eh_frame_hdr) - } > flash - - .eh_frame : ONLY_IF_RO - { - *(.eh_frame) - } > flash - - .textalign : ONLY_IF_RO - { - . = ALIGN(8); - } > flash - - . = ALIGN(4); - _etext = .; - _textdata = _etext; - - .stacks : - { - . = ALIGN(8); - __main_stack_base__ = .; - . += __main_stack_size__; - . = ALIGN(8); - __main_stack_end__ = .; - __process_stack_base__ = .; - __main_thread_stack_base__ = .; - . += __process_stack_size__; - . = ALIGN(8); - __process_stack_end__ = .; - __main_thread_stack_end__ = .; - } > ccmram - - .ccm : - { - PROVIDE(_cmm_start = .); - . = ALIGN(4); - *(.bss.mainthread.*) - . = ALIGN(4); - *(.bss._idle_thread_wa) - . = ALIGN(4); - *(.bss.rlist) - . = ALIGN(4); - *(.bss.vtlist) - . = ALIGN(4); - *(.bss.endmem) - . = ALIGN(4); - *(.bss.nextmem) - . = ALIGN(4); - *(.bss.default_heap) - . = ALIGN(4); - PROVIDE(_cmm_end = .); - } > ccmram - - .data : - { - . = ALIGN(4); - PROVIDE(_data = .); - *(.data) - . = ALIGN(4); - *(.data.*) - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - PROVIDE(_edata = .); - } > ram AT > flash - - .bss : - { - . = ALIGN(4); - PROVIDE(_bss_start = .); - *(.bss) - . = ALIGN(4); - *(.bss.*) - . = ALIGN(4); - *(COMMON) - . = ALIGN(4); - PROVIDE(_bss_end = .); - } > ram -} - -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__; diff --git a/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f0xx.mk b/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f0xx.mk new file mode 100644 index 000000000..43131fc6b --- /dev/null +++ b/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f0xx.mk @@ -0,0 +1,15 @@ +# List of the ChibiOS/RT Cortex-M0 STM32F0xx port files. +PORTSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0.c \ + $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/vectors.c \ + ${CHIBIOS}/os/rt/ports/ARMCMx/chcore.c \ + ${CHIBIOS}/os/rt/ports/ARMCMx/chcore_v6m.c + +PORTASM = $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/chcoreasm_v6m.s + +PORTINC = ${CHIBIOS}/os/ext/CMSIS/include \ + ${CHIBIOS}/os/ext/CMSIS/ST \ + ${CHIBIOS}/os/common/ports/ARMCMx/devices/STM32F0xx \ + ${CHIBIOS}/os/rt/ports/ARMCMx \ + ${CHIBIOS}/os/rt/ports/ARMCMx/compilers/GCC + +PORTLD = ${CHIBIOS}/os/common/ports/ARMCMx/compilers/GCC/ld diff --git a/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f30x.mk b/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f30x.mk new file mode 100644 index 000000000..e3d87f411 --- /dev/null +++ b/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f30x.mk @@ -0,0 +1,15 @@ +# List of the ChibiOS/RT Cortex-M4 STM32F30x port files. +PORTSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0.c \ + $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/vectors.c \ + ${CHIBIOS}/os/rt/ports/ARMCMx/chcore.c \ + ${CHIBIOS}/os/rt/ports/ARMCMx/chcore_v7m.c + +PORTASM = $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/chcoreasm_v7m.s + +PORTINC = ${CHIBIOS}/os/ext/CMSIS/include \ + ${CHIBIOS}/os/ext/CMSIS/ST \ + ${CHIBIOS}/os/common/ports/ARMCMx/devices/STM32F30x \ + ${CHIBIOS}/os/rt/ports/ARMCMx \ + ${CHIBIOS}/os/rt/ports/ARMCMx/compilers/GCC + +PORTLD = ${CHIBIOS}/os/common/ports/ARMCMx/compilers/GCC/ld diff --git a/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f4xx.mk b/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f4xx.mk new file mode 100644 index 000000000..50964bb77 --- /dev/null +++ b/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f4xx.mk @@ -0,0 +1,15 @@ +# List of the ChibiOS/RT Cortex-M0 STM32F4xx port files. +PORTSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0.c \ + $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/vectors.c \ + ${CHIBIOS}/os/rt/ports/ARMCMx/chcore.c \ + ${CHIBIOS}/os/rt/ports/ARMCMx/chcore_v7m.c + +PORTASM = $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/chcoreasm_v7m.s + +PORTINC = ${CHIBIOS}/os/ext/CMSIS/include \ + ${CHIBIOS}/os/ext/CMSIS/ST \ + ${CHIBIOS}/os/common/ports/ARMCMx/devices/STM32F4xx \ + ${CHIBIOS}/os/rt/ports/ARMCMx \ + ${CHIBIOS}/os/rt/ports/ARMCMx/compilers/GCC + +PORTLD = ${CHIBIOS}/os/common/ports/ARMCMx/compilers/GCC/ld diff --git a/os/rt/ports/ARMCMx/compilers/GCC/rules.mk b/os/rt/ports/ARMCMx/compilers/GCC/rules.mk deleted file mode 100644 index 33531d201..000000000 --- a/os/rt/ports/ARMCMx/compilers/GCC/rules.mk +++ /dev/null @@ -1,220 +0,0 @@ -# ARM Cortex-Mx common makefile scripts and rules. - -# Output directory and files -ifeq ($(BUILDDIR),) - BUILDDIR = build -endif -ifeq ($(BUILDDIR),.) - BUILDDIR = build -endif -OUTFILES = $(BUILDDIR)/$(PROJECT).elf $(BUILDDIR)/$(PROJECT).hex \ - $(BUILDDIR)/$(PROJECT).bin $(BUILDDIR)/$(PROJECT).dmp - -# Automatic compiler options -OPT = $(USE_OPT) -COPT = $(USE_COPT) -CPPOPT = $(USE_CPPOPT) -ifeq ($(USE_LINK_GC),yes) - OPT += -ffunction-sections -fdata-sections -fno-common -endif - -# Source files groups and paths -ifeq ($(USE_THUMB),yes) - TCSRC += $(CSRC) - TCPPSRC += $(CPPSRC) -else - ACSRC += $(CSRC) - ACPPSRC += $(CPPSRC) -endif -ASRC = $(ACSRC)$(ACPPSRC) -TSRC = $(TCSRC)$(TCPPSRC) -SRCPATHS = $(sort $(dir $(ASMXSRC)) $(dir $(ASMSRC)) $(dir $(ASRC)) $(dir $(TSRC))) - -# Various directories -OBJDIR = $(BUILDDIR)/obj -LSTDIR = $(BUILDDIR)/lst - -# Object files groups -ACOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ACSRC:.c=.o))) -ACPPOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ACPPSRC:.cpp=.o))) -TCOBJS = $(addprefix $(OBJDIR)/, $(notdir $(TCSRC:.c=.o))) -TCPPOBJS = $(addprefix $(OBJDIR)/, $(notdir $(TCPPSRC:.cpp=.o))) -ASMOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMSRC:.s=.o))) -ASMXOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMXSRC:.S=.o))) -OBJS = $(ASMXOBJS) $(ASMOBJS) $(ACOBJS) $(TCOBJS) $(ACPPOBJS) $(TCPPOBJS) - -# Paths -IINCDIR = $(patsubst %,-I%,$(INCDIR) $(DINCDIR) $(UINCDIR)) -LLIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR)) - -# Macros -DEFS = $(DDEFS) $(UDEFS) -ADEFS = $(DADEFS) $(UADEFS) - -# Libs -LIBS = $(DLIBS) $(ULIBS) - -# Various settings -MCFLAGS = -mcpu=$(MCU) -ODFLAGS = -x --syms -ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS) -ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS) -CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS) -CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS) -ifeq ($(USE_LINK_GC),yes) - LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR) -else - LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch $(LLIBDIR) -endif - -# Thumb interwork enabled only if needed because it kills performance. -ifneq ($(TSRC),) - CFLAGS += -DTHUMB_PRESENT - CPPFLAGS += -DTHUMB_PRESENT - ASFLAGS += -DTHUMB_PRESENT - ifneq ($(ASRC),) - # Mixed ARM and THUMB mode. - CFLAGS += -mthumb-interwork - CPPFLAGS += -mthumb-interwork - ASFLAGS += -mthumb-interwork - LDFLAGS += -mthumb-interwork - else - # Pure THUMB mode, THUMB C code cannot be called by ARM asm code directly. - CFLAGS += -mno-thumb-interwork -DTHUMB_NO_INTERWORKING - CPPFLAGS += -mno-thumb-interwork -DTHUMB_NO_INTERWORKING - ASFLAGS += -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb - LDFLAGS += -mno-thumb-interwork -mthumb - endif -else - # Pure ARM mode - CFLAGS += -mno-thumb-interwork - CPPFLAGS += -mno-thumb-interwork - ASFLAGS += -mno-thumb-interwork - LDFLAGS += -mno-thumb-interwork -endif - -# Generate dependency information -CFLAGS += -MD -MP -MF .dep/$(@F).d -CPPFLAGS += -MD -MP -MF .dep/$(@F).d - -# Paths where to search for sources -VPATH = $(SRCPATHS) - -# -# Makefile rules -# - -all: $(OBJS) $(OUTFILES) MAKE_ALL_RULE_HOOK - -MAKE_ALL_RULE_HOOK: - -$(OBJS): | $(BUILDDIR) - -$(BUILDDIR) $(OBJDIR) $(LSTDIR): -ifneq ($(USE_VERBOSE_COMPILE),yes) - @echo Compiler Options - @echo $(CC) -c $(CFLAGS) -I. $(IINCDIR) main.c -o main.o - @echo -endif - mkdir -p $(OBJDIR) - mkdir -p $(LSTDIR) - -$(ACPPOBJS) : $(OBJDIR)/%.o : %.cpp Makefile -ifeq ($(USE_VERBOSE_COMPILE),yes) - @echo - $(CPPC) -c $(CPPFLAGS) $(AOPT) -I. $(IINCDIR) $< -o $@ -else - @echo Compiling $( $@ -else - @echo Creating $@ - @$(OD) $(ODFLAGS) $< > $@ - @echo Done -endif - -clean: - @echo Cleaning - -rm -fR .dep $(BUILDDIR) - @echo Done - -# -# Include the dependency files, should be the last of the makefile -# --include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) - -# *** EOF *** diff --git a/os/rt/ports/ARMCMx/compilers/GCC/vectors.c b/os/rt/ports/ARMCMx/compilers/GCC/vectors.c deleted file mode 100644 index 707f8b7b1..000000000 --- a/os/rt/ports/ARMCMx/compilers/GCC/vectors.c +++ /dev/null @@ -1,658 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file GCC/ARMCMx/STM32F4xx/vectors.c - * @brief Interrupt vectors for the STM32F4xx family. - * - * @defgroup ARMCMx_STM32F4xx_VECTORS STM32F4xx Interrupt Vectors - * @ingroup ARMCMx_SPECIFIC - * @details Interrupt vectors for the STM32F4xx family. - * @{ - */ - -#include -#include - -#include "cmparams.h" - -#if (CORTEX_NUM_VECTORS & 7) != 0 -#error "the constant CORTEX_NUM_VECTORS must be a multiple of 8" -#endif - -#if (CORTEX_NUM_VECTORS < 8) || (CORTEX_NUM_VECTORS > 240) -#error "the constant CORTEX_NUM_VECTORS must be between 8 and 240 inclusive" -#endif - -/** - * @brief Type of an IRQ vector. - */ -typedef void (*irq_vector_t)(void); - -/** - * @brief Type of a structure representing the whole vectors table. - */ -typedef struct { - uint32_t *init_stack; - irq_vector_t reset_handler; - irq_vector_t nmi_handler; - irq_vector_t hardfault_handler; - irq_vector_t memmanage_handler; - irq_vector_t busfault_handler; - irq_vector_t usagefault_handler; - irq_vector_t vector1c; - irq_vector_t vector20; - irq_vector_t vector24; - irq_vector_t vector28; - irq_vector_t svc_handler; - irq_vector_t debugmonitor_handler; - irq_vector_t vector34; - irq_vector_t pendsv_handler; - irq_vector_t systick_handler; - irq_vector_t vectors[CORTEX_NUM_VECTORS]; -} vectors_t; - -/** - * @brief Unhandled exceptions handler. - * @details Any undefined exception vector points to this function by default. - * This function simply stops the system into an infinite loop. - * - * @notapi - */ -#if !defined(__DOXYGEN__) -__attribute__ ((naked)) -#endif -void _unhandled_exception(void) { - - while (true) - ; -} - -#if !defined(__DOXYGEN__) -extern uint32_t __main_stack_end__; -void Reset_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); -void NMI_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); -void HardFault_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); -void MemManage_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); -void BusFault_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); -void UsageFault_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1C(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector20(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector24(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector28(void) __attribute__((weak, alias("_unhandled_exception"))); -void SVC_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); -void DebugMon_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector34(void) __attribute__((weak, alias("_unhandled_exception"))); -void PendSV_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); -void SysTick_Handler(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector40(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector44(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector48(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector4C(void) __attribute__((weak, alias("_unhandled_exception"))); -#if CORTEX_NUM_VECTORS > 4 -void Vector50(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector54(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector58(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector5C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 8 -void Vector60(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector64(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector68(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector6C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 12 -void Vector70(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector74(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector78(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector7C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 16 -void Vector80(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector84(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector88(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector8C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 20 -void Vector90(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector94(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector98(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector9C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 24 -void VectorA0(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorA4(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorA8(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorAC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 28 -void VectorB0(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorB4(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorB8(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorBC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 32 -void VectorC0(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorC4(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorC8(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorCC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 36 -void VectorD0(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorD4(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorD8(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorDC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 40 -void VectorE0(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorE4(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorE8(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorEC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 44 -void VectorF0(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorF4(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorF8(void) __attribute__((weak, alias("_unhandled_exception"))); -void VectorFC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 48 -void Vector100(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector104(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector108(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector10C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 52 -void Vector110(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector114(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector118(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector11C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 56 -void Vector120(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector124(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector128(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector12C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 60 -void Vector130(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector134(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector138(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector13C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 64 -void Vector140(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector144(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector148(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector14C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 68 -void Vector150(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector154(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector158(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector15C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 72 -void Vector160(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector164(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector168(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector16C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 76 -void Vector170(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector174(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector178(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector17C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 80 -void Vector180(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector184(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector188(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector18C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 84 -void Vector190(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector194(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector198(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector19C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 88 -void Vector1A0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1A4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1A8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1AC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 92 -void Vector1B0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1B4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1B8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1BC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 96 -void Vector1C0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1C4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1C8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1CC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 100 -void Vector1D0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1D4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1D8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1DC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 104 -void Vector1E0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1E4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1E8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1EC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 108 -void Vector1F0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1F4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1F8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector1FC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 112 -void Vector200(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector204(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector208(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector20C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 116 -void Vector210(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector214(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector218(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector21C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 120 -void Vector220(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector224(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector228(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector22C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 124 -void Vector230(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector234(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector238(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector23C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 128 -void Vector240(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector244(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector248(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector24C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 132 -void Vector250(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector254(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector258(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector25C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 136 -void Vector260(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector264(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector268(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector26C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 140 -void Vector270(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector274(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector278(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector27C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 144 -void Vector280(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector284(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector288(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector28C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 148 -void Vector290(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector294(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector298(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector29C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 152 -void Vector2A0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2A4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2A8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2AC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 156 -void Vector2B0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2B4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2B8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2BC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 160 -void Vector2C0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2C4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2C8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2CC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 164 -void Vector2D0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2D4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2D8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2DC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 168 -void Vector2E0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2E4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2E8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2EC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 172 -void Vector2F0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2F4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2F8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector2FC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 176 -void Vector300(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector304(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector308(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector30C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 180 -void Vector310(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector314(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector318(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector31C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 184 -void Vector320(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector324(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector328(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector32C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 188 -void Vector330(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector334(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector338(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector33C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 192 -void Vector340(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector344(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector348(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector34C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 196 -void Vector350(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector354(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector358(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector35C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 200 -void Vector360(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector364(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector368(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector36C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 204 -void Vector370(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector374(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector378(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector37C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 208 -void Vector380(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector384(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector388(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector38C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 212 -void Vector390(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector394(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector398(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector39C(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 216 -void Vector3A0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3A4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3A8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3AC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 220 -void Vector3B0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3B4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3B8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3BC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 224 -void Vector3C0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3C4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3C8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3CC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 228 -void Vector3D0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3D4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3D8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3DC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 232 -void Vector3E0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3E4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3E8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3EC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#if CORTEX_NUM_VECTORS > 236 -void Vector3F0(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3F4(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3F8(void) __attribute__((weak, alias("_unhandled_exception"))); -void Vector3FC(void) __attribute__((weak, alias("_unhandled_exception"))); -#endif -#endif /* !defined(__DOXYGEN__) */ - -/** - * @brief STM32 vectors table. - */ -#if !defined(__DOXYGEN__) -__attribute__ ((section("vectors"))) -#endif -vectors_t _vectors = { - &__main_stack_end__,Reset_Handler, NMI_Handler, HardFault_Handler, - MemManage_Handler, BusFault_Handler, UsageFault_Handler, Vector1C, - Vector20, Vector24, Vector28, SVC_Handler, - DebugMon_Handler, Vector34, PendSV_Handler, SysTick_Handler, - { - Vector40, Vector44, Vector48, Vector4C, -#if CORTEX_NUM_VECTORS > 4 - Vector50, Vector54, Vector58, Vector5C, -#endif -#if CORTEX_NUM_VECTORS > 8 - Vector60, Vector64, Vector68, Vector6C, -#endif -#if CORTEX_NUM_VECTORS > 12 - Vector70, Vector74, Vector78, Vector7C, -#endif -#if CORTEX_NUM_VECTORS > 16 - Vector80, Vector84, Vector88, Vector8C, -#endif -#if CORTEX_NUM_VECTORS > 20 - Vector90, Vector94, Vector98, Vector9C, -#endif -#if CORTEX_NUM_VECTORS > 24 - VectorA0, VectorA4, VectorA8, VectorAC, -#endif -#if CORTEX_NUM_VECTORS > 28 - VectorB0, VectorB4, VectorB8, VectorBC, -#endif -#if CORTEX_NUM_VECTORS > 32 - VectorC0, VectorC4, VectorC8, VectorCC, -#endif -#if CORTEX_NUM_VECTORS > 36 - VectorD0, VectorD4, VectorD8, VectorDC, -#endif -#if CORTEX_NUM_VECTORS > 40 - VectorE0, VectorE4, VectorE8, VectorEC, -#endif -#if CORTEX_NUM_VECTORS > 44 - VectorF0, VectorF4, VectorF8, VectorFC, -#endif -#if CORTEX_NUM_VECTORS > 48 - Vector100, Vector104, Vector108, Vector10C, -#endif -#if CORTEX_NUM_VECTORS > 52 - Vector110, Vector114, Vector118, Vector11C, -#endif -#if CORTEX_NUM_VECTORS > 56 - Vector120, Vector124, Vector128, Vector12C, -#endif -#if CORTEX_NUM_VECTORS > 60 - Vector130, Vector134, Vector138, Vector13C, -#endif -#if CORTEX_NUM_VECTORS > 64 - Vector140, Vector144, Vector148, Vector14C, -#endif -#if CORTEX_NUM_VECTORS > 68 - Vector150, Vector154, Vector158, Vector15C, -#endif -#if CORTEX_NUM_VECTORS > 72 - Vector160, Vector164, Vector168, Vector16C, -#endif -#if CORTEX_NUM_VECTORS > 76 - Vector170, Vector174, Vector178, Vector17C, -#endif -#if CORTEX_NUM_VECTORS > 80 - Vector180, Vector184, Vector188, Vector17C, -#endif -#if CORTEX_NUM_VECTORS > 84 - Vector190, Vector194, Vector198, Vector19C, -#endif -#if CORTEX_NUM_VECTORS > 88 - Vector1A0, Vector1A4, Vector1A8, Vector1AC, -#endif -#if CORTEX_NUM_VECTORS > 92 - Vector1B0, Vector1B4, Vector1B8, Vector1BC, -#endif -#if CORTEX_NUM_VECTORS > 96 - Vector1C0, Vector1C4, Vector1C8, Vector1CC, -#endif -#if CORTEX_NUM_VECTORS > 100 - Vector1D0, Vector1D4, Vector1D8, Vector1DC, -#endif -#if CORTEX_NUM_VECTORS > 104 - Vector1E0, Vector1E4, Vector1E8, Vector1EC, -#endif -#if CORTEX_NUM_VECTORS > 108 - Vector1F0, Vector1F4, Vector1F8, Vector1FC, -#endif -#if CORTEX_NUM_VECTORS > 112 - Vector200, Vector204, Vector208, Vector20C, -#endif -#if CORTEX_NUM_VECTORS > 116 - Vector210, Vector214, Vector218, Vector21C, -#endif -#if CORTEX_NUM_VECTORS > 120 - Vector220, Vector224, Vector228, Vector22C, -#endif -#if CORTEX_NUM_VECTORS > 124 - Vector230, Vector234, Vector238, Vector23C, -#endif -#if CORTEX_NUM_VECTORS > 128 - Vector240, Vector244, Vector248, Vector24C, -#endif -#if CORTEX_NUM_VECTORS > 132 - Vector250, Vector254, Vector258, Vector25C, -#endif -#if CORTEX_NUM_VECTORS > 136 - Vector260, Vector264, Vector268, Vector26C, -#endif -#if CORTEX_NUM_VECTORS > 140 - Vector270, Vector274, Vector278, Vector27C, -#endif -#if CORTEX_NUM_VECTORS > 144 - Vector280, Vector284, Vector288, Vector28C, -#endif -#if CORTEX_NUM_VECTORS > 148 - Vector290, Vector294, Vector298, Vector29C, -#endif -#if CORTEX_NUM_VECTORS > 152 - Vector2A0, Vector2A4, Vector2A8, Vector2AC, -#endif -#if CORTEX_NUM_VECTORS > 156 - Vector2B0, Vector2B4, Vector2B8, Vector2BC, -#endif -#if CORTEX_NUM_VECTORS > 160 - Vector2C0, Vector2C4, Vector2C8, Vector2CC, -#endif -#if CORTEX_NUM_VECTORS > 164 - Vector2D0, Vector2D4, Vector2D8, Vector2DC, -#endif -#if CORTEX_NUM_VECTORS > 168 - Vector2E0, Vector2E4, Vector2E8, Vector2EC, -#endif -#if CORTEX_NUM_VECTORS > 172 - Vector2F0, Vector2F4, Vector2F8, Vector2FC, -#endif -#if CORTEX_NUM_VECTORS > 176 - Vector300, Vector304, Vector308, Vector30C, -#endif -#if CORTEX_NUM_VECTORS > 180 - Vector310, Vector314, Vector318, Vector31C, -#endif -#if CORTEX_NUM_VECTORS > 184 - Vector320, Vector324, Vector328, Vector32C, -#endif -#if CORTEX_NUM_VECTORS > 188 - Vector330, Vector334, Vector338, Vector33C, -#endif -#if CORTEX_NUM_VECTORS > 192 - Vector340, Vector344, Vector348, Vector34C, -#endif -#if CORTEX_NUM_VECTORS > 196 - Vector350, Vector354, Vector358, Vector35C, -#endif -#if CORTEX_NUM_VECTORS > 200 - Vector360, Vector364, Vector368, Vector36C, -#endif -#if CORTEX_NUM_VECTORS > 204 - Vector370, Vector374, Vector378, Vector37C, -#endif -#if CORTEX_NUM_VECTORS > 208 - Vector380, Vector384, Vector388, Vector38C, -#endif -#if CORTEX_NUM_VECTORS > 212 - Vector390, Vector394, Vector398, Vector39C, -#endif -#if CORTEX_NUM_VECTORS > 216 - Vector3A0, Vector3A4, Vector3A8, Vector3AC, -#endif -#if CORTEX_NUM_VECTORS > 220 - Vector3B0, Vector3B4, Vector3B8, Vector3BC, -#endif -#if CORTEX_NUM_VECTORS > 224 - Vector3C0, Vector3C4, Vector3C8, Vector3CC, -#endif -#if CORTEX_NUM_VECTORS > 228 - Vector3D0, Vector3D4, Vector3D8, Vector3DC -#endif -#if CORTEX_NUM_VECTORS > 232 - Vector3E0, Vector3E4, Vector3E8, Vector3EC -#endif -#if CORTEX_NUM_VECTORS > 236 - Vector3F0, Vector3F4, Vector3F8, Vector3FC -#endif - } -}; - -/** @} */ diff --git a/os/rt/ports/ARMCMx/devices/STM32F0xx/port.mk b/os/rt/ports/ARMCMx/devices/STM32F0xx/port.mk deleted file mode 100644 index 23a461a32..000000000 --- a/os/rt/ports/ARMCMx/devices/STM32F0xx/port.mk +++ /dev/null @@ -1,15 +0,0 @@ -# List of the ChibiOS/RT Cortex-M0 STM32F0xx port files. -PORTSRC = ${CHIBIOS}/os/rt/ports/ARMCMx/chcore.c \ - ${CHIBIOS}/os/rt/ports/ARMCMx/chcore_v6m.c \ - $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/crt0.c \ - $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/vectors.c \ - -PORTASM = $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/chcoreasm_v6m.s - -PORTINC = ${CHIBIOS}/os/ext/CMSIS/include \ - ${CHIBIOS}/os/ext/CMSIS/ST \ - ${CHIBIOS}/os/rt/ports/ARMCMx \ - ${CHIBIOS}/os/rt/ports/ARMCMx/compilers/GCC \ - ${CHIBIOS}/os/rt/ports/ARMCMx/devices/STM32F0xx - -PORTLD = ${CHIBIOS}/os/rt/ports/ARMCMx/compilers/GCC/ld diff --git a/os/rt/ports/ARMCMx/devices/STM32F30x/port.mk b/os/rt/ports/ARMCMx/devices/STM32F30x/port.mk deleted file mode 100644 index f22a8e78b..000000000 --- a/os/rt/ports/ARMCMx/devices/STM32F30x/port.mk +++ /dev/null @@ -1,15 +0,0 @@ -# List of the ChibiOS/RT Cortex-M4 STM32F30x port files. -PORTSRC = ${CHIBIOS}/os/rt/ports/ARMCMx/chcore.c \ - ${CHIBIOS}/os/rt/ports/ARMCMx/chcore_v7m.c \ - $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/crt0.c \ - $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/vectors.c \ - -PORTASM = $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/chcoreasm_v7m.s - -PORTINC = ${CHIBIOS}/os/ext/CMSIS/include \ - ${CHIBIOS}/os/ext/CMSIS/ST \ - ${CHIBIOS}/os/rt/ports/ARMCMx \ - ${CHIBIOS}/os/rt/ports/ARMCMx/compilers/GCC \ - ${CHIBIOS}/os/rt/ports/ARMCMx/devices/STM32F30x - -PORTLD = ${CHIBIOS}/os/rt/ports/ARMCMx/compilers/GCC/ld diff --git a/os/rt/ports/ARMCMx/devices/STM32F4xx/port.mk b/os/rt/ports/ARMCMx/devices/STM32F4xx/port.mk deleted file mode 100644 index 69e30009b..000000000 --- a/os/rt/ports/ARMCMx/devices/STM32F4xx/port.mk +++ /dev/null @@ -1,15 +0,0 @@ -# List of the ChibiOS/RT Cortex-M0 STM32F4xx port files. -PORTSRC = ${CHIBIOS}/os/rt/ports/ARMCMx/chcore.c \ - ${CHIBIOS}/os/rt/ports/ARMCMx/chcore_v7m.c \ - $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/crt0.c \ - $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/vectors.c \ - -PORTASM = $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/chcoreasm_v7m.s - -PORTINC = ${CHIBIOS}/os/ext/CMSIS/include \ - ${CHIBIOS}/os/ext/CMSIS/ST \ - ${CHIBIOS}/os/rt/ports/ARMCMx \ - ${CHIBIOS}/os/rt/ports/ARMCMx/compilers/GCC \ - ${CHIBIOS}/os/rt/ports/ARMCMx/devices/STM32F4xx - -PORTLD = ${CHIBIOS}/os/rt/ports/ARMCMx/compilers/GCC/ld -- cgit v1.2.3