From 09fdbf9a37c19bb5d9a60385a7c44e32843ef2ff Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 2 Sep 2013 09:33:20 +0000 Subject: [PATCH] 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 +- .../ARMCM4-STM32F407-DISCOVERY-MEMS/Makefile | 4 +- .../ARMCM4-STM32F407-DISCOVERY-MEMS/chconf.h | 2 +- .../ARMCM4-STM32F407-DISCOVERY-MEMS/halconf.h | 8 +- .../rt/ARMCM4-STM32F407-DISCOVERY-MEMS/main.c | 15 ++-- demos/rt/ARMCM4-STM32F407-DISCOVERY/Makefile | 4 +- .../ports/ARMCMx/compilers/GCC/crt0.c | 0 .../ARMCMx/compilers/GCC/ld/STM32F051x8.ld | 0 .../ARMCMx/compilers/GCC/ld/STM32F303xC.ld | 0 .../ARMCMx/compilers/GCC/ld/STM32F373xC.ld | 0 .../ARMCMx/compilers/GCC/ld/STM32F405xG.ld | 0 .../ARMCMx/compilers/GCC/ld/STM32F407xG.ld | 0 .../compilers/GCC/ld/STM32F407xG_CCM.ld | 0 .../ports/ARMCMx/compilers/GCC/rules.mk | 0 .../ports/ARMCMx/compilers/GCC/vectors.c | 0 .../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 +++++++ .../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/devices/STM32F0xx/port.mk | 15 ---- os/rt/ports/ARMCMx/devices/STM32F30x/port.mk | 15 ---- os/rt/ports/ARMCMx/devices/STM32F4xx/port.mk | 15 ---- 26 files changed, 351 insertions(+), 66 deletions(-) rename os/{rt => common}/ports/ARMCMx/compilers/GCC/crt0.c (100%) rename os/{rt => common}/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld (100%) rename os/{rt => common}/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld (100%) rename os/{rt => common}/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld (100%) rename os/{rt => common}/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld (100%) rename os/{rt => common}/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld (100%) rename os/{rt => common}/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld (100%) rename os/{rt => common}/ports/ARMCMx/compilers/GCC/rules.mk (100%) rename os/{rt => common}/ports/ARMCMx/compilers/GCC/vectors.c (100%) 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 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/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/rt/ports/ARMCMx/compilers/GCC/crt0.c b/os/common/ports/ARMCMx/compilers/GCC/crt0.c similarity index 100% rename from os/rt/ports/ARMCMx/compilers/GCC/crt0.c rename to os/common/ports/ARMCMx/compilers/GCC/crt0.c diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld similarity index 100% rename from os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld rename to os/common/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld similarity index 100% rename from os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld rename to os/common/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld similarity index 100% rename from os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld rename to os/common/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld similarity index 100% rename from os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld rename to os/common/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld similarity index 100% rename from os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld rename to os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld diff --git a/os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld similarity index 100% rename from os/rt/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld rename to os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG_CCM.ld diff --git a/os/rt/ports/ARMCMx/compilers/GCC/rules.mk b/os/common/ports/ARMCMx/compilers/GCC/rules.mk similarity index 100% rename from os/rt/ports/ARMCMx/compilers/GCC/rules.mk rename to os/common/ports/ARMCMx/compilers/GCC/rules.mk diff --git a/os/rt/ports/ARMCMx/compilers/GCC/vectors.c b/os/common/ports/ARMCMx/compilers/GCC/vectors.c similarity index 100% rename from os/rt/ports/ARMCMx/compilers/GCC/vectors.c rename to os/common/ports/ARMCMx/compilers/GCC/vectors.c 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/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/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