diff options
13 files changed, 133 insertions, 41 deletions
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_k20x.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_k20x.mk index abcb5fb25..b7ea0f3be 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_k20x.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_k20x.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/K20x \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/K20x \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/KINETIS
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_kl2x.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_kl2x.mk index 8e6216cdb..a073da004 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_kl2x.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_kl2x.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v6m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/KL2x \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/KL2x \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/KINETIS
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk index 23f37a49d..e47c192ec 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v6m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F0xx \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F0xx \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/ST
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk index e5b884453..5397282ba 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F1xx \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F1xx \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/ST
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f2xx.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f2xx.mk index c1f08e57f..1f2dc5c25 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f2xx.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f2xx.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F2xx \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F2xx \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/ST
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk index e43a5b99e..939315756 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F3xx \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F3xx \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/ST
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk index 37145b232..d2c0d6174 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F4xx \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F4xx \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/ST
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk index b85577b37..113950aa9 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F7xx \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F7xx \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/ST
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l0xx.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l0xx.mk index 04c1120ad..0396af97d 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l0xx.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l0xx.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v6m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32L0xx \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32L0xx \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/ST
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l1xx.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l1xx.mk index 9724504cc..606379088 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l1xx.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l1xx.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32L1xx \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32L1xx \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/ST
diff --git a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l4xx.mk b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l4xx.mk index 225b7cbca..699bf875b 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l4xx.mk +++ b/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l4xx.mk @@ -4,7 +4,8 @@ STARTUPSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt1.c \ STARTUPASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s
-STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32L4xx \
+STARTUPINC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC \
+ $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32L4xx \
$(CHIBIOS)/os/ext/CMSIS/include \
$(CHIBIOS)/os/ext/CMSIS/ST
diff --git a/os/common/ports/ARMCMx/compilers/GCC/vectors.c b/os/common/ports/ARMCMx/compilers/GCC/vectors.c index a9bf5ae6a..d978d113c 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/vectors.c +++ b/os/common/ports/ARMCMx/compilers/GCC/vectors.c @@ -28,7 +28,7 @@ #include <stdbool.h>
#include <stdint.h>
-#include "cmparams.h"
+#include "vectors.h"
#if (CORTEX_NUM_VECTORS % 8) != 0
#error "the constant CORTEX_NUM_VECTORS must be a multiple of 8"
@@ -39,34 +39,6 @@ #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.
@@ -462,7 +434,11 @@ void Vector3FC(void) __attribute__((weak, alias("_unhandled_exception"))); * @brief STM32 vectors table.
*/
#if !defined(__DOXYGEN__)
-__attribute__ ((used, section(".vectors")))
+#if !defined(VECTORS_SECTION)
+__attribute__ ((used, aligned(128), section(".vectors")))
+#else
+__attribute__ ((used, aligned(128), section(VECTORS_SECTION)))
+#endif
#endif
/*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
vectors_t _vectors = {
diff --git a/os/common/ports/ARMCMx/compilers/GCC/vectors.h b/os/common/ports/ARMCMx/compilers/GCC/vectors.h new file mode 100644 index 000000000..a86db615b --- /dev/null +++ b/os/common/ports/ARMCMx/compilers/GCC/vectors.h @@ -0,0 +1,105 @@ +/*
+ ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
+
+ This file is part of ChibiOS.
+
+ ChibiOS 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 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 <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file ARMCMx/compilers/GCC/vectors.h
+ * @brief Interrupt vectors for Cortex-Mx devices.
+ *
+ * @defgroup ARMCMx_VECTORS Cortex-Mx Interrupt Vectors
+ * @{
+ */
+
+#ifndef _VECTORS_H_
+#define _VECTORS_H_
+
+#include "cmparams.h"
+
+/*===========================================================================*/
+/* Module constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module data structures and types. */
+/*===========================================================================*/
+
+#if !defined(_FROM_ASM_)
+/**
+ * @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;
+#endif /* !defined(_FROM_ASM_) */
+
+/*===========================================================================*/
+/* Module macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#if !defined(_FROM_ASM_)
+extern vectors_t _vectors;
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/*===========================================================================*/
+/* Module inline functions. */
+/*===========================================================================*/
+
+#endif /* _VECTORS_H_ */
+
+/** @} */
|