From f595df3755379409eb93fc77cd7c01d60de64027 Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Wed, 2 Nov 2016 13:54:19 +0100 Subject: [PATCH] stm32f4: Enable STM32Cube SDK support on stm32f4 family Enable HAS_CUBE config flag on stm32f4 family soc.h is updated to include minimum include files from ext/hal/stm23cube Change-Id: I35a8c33aab777167ee7029edc1b7a4f6d21fccd8 Signed-off-by: Erwan Gouriou Signed-off-by: Kumar Gala --- arch/arm/soc/st_stm32/stm32f4/Kconfig.series | 1 + arch/arm/soc/st_stm32/stm32f4/soc.h | 46 ++++---------------- 2 files changed, 9 insertions(+), 38 deletions(-) diff --git a/arch/arm/soc/st_stm32/stm32f4/Kconfig.series b/arch/arm/soc/st_stm32/stm32f4/Kconfig.series index b385ef334ce..06bc6e5cf6f 100644 --- a/arch/arm/soc/st_stm32/stm32f4/Kconfig.series +++ b/arch/arm/soc/st_stm32/stm32f4/Kconfig.series @@ -21,5 +21,6 @@ config SOC_SERIES_STM32F4X select CPU_CORTEX_M4 select SOC_FAMILY_STM32 select SYS_POWER_LOW_POWER_STATE_SUPPORTED + select HAS_STM32CUBE help Enable support for STM32F4 MCU series diff --git a/arch/arm/soc/st_stm32/stm32f4/soc.h b/arch/arm/soc/st_stm32/stm32f4/soc.h index 53685ca2803..872b72159c2 100644 --- a/arch/arm/soc/st_stm32/stm32f4/soc.h +++ b/arch/arm/soc/st_stm32/stm32f4/soc.h @@ -28,48 +28,16 @@ #ifndef _STM32F4_SOC_H_ #define _STM32F4_SOC_H_ -/* peripherals start address */ -#define PERIPH_BASE 0x40000000 - -/* use naming consistent with STMF4 Peripherals Library */ -#define APB1PERIPH_BASE PERIPH_BASE -#define APB2PERIPH_BASE (PERIPH_BASE + 0x10000) -#define AHB1PERIPH_BASE (PERIPH_BASE + 0x20000) -#define AHB2PERIPH_BASE (PERIPH_BASE + 0x10000000) - -/* UART */ -#define USART1_ADDR (APB2PERIPH_BASE + 0x1000) -#define USART2_ADDR (APB1PERIPH_BASE + 0x4400) -#define USART6_ADDR (APB2PERIPH_BASE + 0x1400) - -/* Reset and Clock Control */ -#define RCC_BASE (AHB1PERIPH_BASE + 0x3800) - #define GPIO_REG_SIZE 0x400 -#define GPIOA_BASE (AHB1PERIPH_BASE + 0x0000) -#define GPIOB_BASE (AHB1PERIPH_BASE + 0x0400) -#define GPIOC_BASE (AHB1PERIPH_BASE + 0x0800) -#define GPIOD_BASE (AHB1PERIPH_BASE + 0x0C00) -#define GPIOE_BASE (AHB1PERIPH_BASE + 0x1000) -#define GPIOH_BASE (AHB1PERIPH_BASE + 0x1C00) -#define GPIOI_BASE (AHB1PERIPH_BASE + 0x2000) -#define GPIOJ_BASE (AHB1PERIPH_BASE + 0x2400) -#define GPIOK_BASE (AHB1PERIPH_BASE + 0x2800) - /* base address for where GPIO registers start */ #define GPIO_PORTS_BASE (GPIOA_BASE) -/* EXTI */ -#define EXTI_BASE (APB2PERIPH_BASE + 0x3C00) - -/* IWDG */ -#define IWDG_BASE (APB1PERIPH_BASE + 0x3000) - -/* FLASH */ -#define FLASH_R_BASE (AHB1PERIPH_BASE + 0x3C00) - -/* SYSCFG */ -#define SYSCFG_BASE (APB2PERIPH_BASE + 0x3800) +/* FIXME: keep these defines until we enable STM32CUBE on this family */ +/* Then they will bre replaced by "USARTX_BASE" defines */ +/* UART */ +#define USART1_ADDR (APB2PERIPH_BASE + 0x1000) +#define USART2_ADDR (APB1PERIPH_BASE + 0x4400) +#define USART6_ADDR (APB1PERIPH_BASE + 0x1400) #ifndef _ASMLANGUAGE @@ -77,6 +45,8 @@ #include #include +#include + /* IO pin functions */ enum stm32f4x_pin_config_mode { STM32F4X_PIN_CONFIG_DRIVE_PUSH_PULL,