diff --git a/cpu/stm32f4/cpu.c b/cpu/stm32f4/cpu.c index 588f66ad63..98d23fa82f 100644 --- a/cpu/stm32f4/cpu.c +++ b/cpu/stm32f4/cpu.c @@ -21,10 +21,6 @@ #include "cpu.h" #include "periph_conf.h" -/** - * @name Pattern to write into the Coprocessor Access Control Register to allow full FPU access - */ -#define FULL_FPU_ACCESS (0x00f00000) static void cpu_clock_init(void); @@ -34,17 +30,10 @@ static void cpu_clock_init(void); */ void cpu_init(void) { - /* give full access to the FPU */ - SCB->CPACR |= (uint32_t)FULL_FPU_ACCESS; - - /* configure the vector table location to internal flash */ - SCB->VTOR = FLASH_BASE; - + /* initialize the Cortex-M core */ + cortexm_init(); /* initialize the clock system */ cpu_clock_init(); - - /* set pendSV interrupt to lowest possible priority */ - NVIC_SetPriority(PendSV_IRQn, 0xff); } /** diff --git a/cpu/stm32f4/include/cpu_conf.h b/cpu/stm32f4/include/cpu_conf.h index ef4ba0b0a9..b11e424c45 100644 --- a/cpu/stm32f4/include/cpu_conf.h +++ b/cpu/stm32f4/include/cpu_conf.h @@ -21,36 +21,23 @@ #ifndef __CPU_CONF_H #define __CPU_CONF_H -#ifdef CPU_MODEL_STM32F407VG +#if defined(CPU_MODEL_STM32F407VG) #include "stm32f407xx.h" -#elif defined CPU_MODEL_STM32F415RG +#elif defined(CPU_MODEL_STM32F415RG) #include "stm32f415xx.h" #endif -/** - * @name Kernel configuration - * - * TODO: measure and adjust for the Cortex-M4f - * @{ - */ -#define THREAD_EXTRA_STACKSIZE_PRINTF (2500) - -#ifndef THREAD_STACKSIZE_DEFAULT -#define THREAD_STACKSIZE_DEFAULT (2500) +#ifdef __cplusplus +extern "C" { #endif -#define THREAD_STACKSIZE_IDLE (512) -/** @} */ - /** - * @name UART0 buffer size definition for compatibility reasons - * - * TODO: remove once the remodeling of the uart0 driver is done + * @brief ARM Cortex-M specific CPU configuration * @{ */ -#ifndef UART0_BUFSIZE -#define UART0_BUFSIZE (128) -#endif +#define CPU_DEFAULT_IRQ_PRIO (1U) +#define CPU_IRQ_NUMOF (82U) +#define CPU_FLASH_BASE FLASH_BASE /** @} */ /** @@ -68,10 +55,6 @@ #endif /** @} */ -#ifdef __cplusplus -extern "C" { -#endif - #ifdef __cplusplus } #endif