From a1c8e97c12b616565a00d66519ae33de23783028 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 27 Nov 2014 06:12:35 -0600 Subject: [PATCH] Enable support for STM32F102. https://github.com/PX4/NuttX/pull/28.diff --- arch/arm/include/stm32/chip.h | 37 +++++++++++++++++++++++++++++++++++ arch/arm/src/stm32/Kconfig | 15 ++++++++++++++ arch/arm/src/stm32/chip.h | 4 ++++ 3 files changed, 56 insertions(+) diff --git a/arch/arm/include/stm32/chip.h b/arch/arm/include/stm32/chip.h index ae2e44767a..ec22d39878 100644 --- a/arch/arm/include/stm32/chip.h +++ b/arch/arm/include/stm32/chip.h @@ -534,6 +534,43 @@ # define STM32_NRNG 0 /* No random number generator (RNG) */ # define STM32_NDCMI 0 /* No digital camera interface (DCMI) */ + +/* STM32 F102x8/102xB Medium Density USB Access Family ***************************/ +#elif defined(CONFIG_ARCH_CHIP_STM32F102CB) +# undef CONFIG_STM32_STM32L15XX /* STM32L151xx and STM32L152xx family */ +# undef CONFIG_STM32_ENERGYLITE /* STM32L EnergyLite vamily */ +# define CONFIG_STM32_STM32F10XX 1 /* STM32F10xx family */ +# undef CONFIG_STM32_LOWDENSITY /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */ +# define CONFIG_STM32_MEDIUMDENSITY 1 /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */ +# undef CONFIG_STM32_HIGHDENSITY /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */ +# undef CONFIG_STM32_VALUELINE /* STM32F100x */ +# define CONFIG_STM32_USBACCESSLINE 1 /* STM32F102xx */ +# undef CONFIG_STM32_CONNECTIVITYLINE /* STM32F105x and STM32F107x */ +# undef CONFIG_STM32_STM32F20XX /* STM32F205x and STM32F207x */ +# undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */ +# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx families */ +# define STM32_NFSMC 1 /* FSMC */ +# define STM32_NATIM 0 /* No advanced timer TIM1 */ +# define STM32_NGTIM 3 /* 16-bit general timers TIM2,3,4 */ +# define STM32_NBTIM 0 /* No basic timers */ +# define STM32_NDMA 1 /* DMA */ +# define STM32_NSPI 2 /* SPI1-2 */ +# define STM32_NI2S 0 /* No I2S */ +# define STM32_NUSART 3 /* USART1-3 */ +# define STM32_NI2C 2 /* I2C1-2 */ +# define STM32_NCAN 0 /* No CAN */ +# define STM32_NSDIO 0 /* No SDIO */ +# define STM32_NLCD 0 /* No LCD */ +# define STM32_NUSBOTG 0 /* No USB OTG FS/HS */ +# define STM32_NGPIO 37 /* GPIOA-D */ +# define STM32_NADC 1 /* ADC1 */ +# define STM32_NDAC 0 /* No DAC */ +# define STM32_NCAPSENSE 0 /* No capacitive sensing channels */ +# define STM32_NCRC 1 /* CRC1 */ +# define STM32_NETHERNET 0 /* No ethernet */ +# define STM32_NRNG 0 /* No random number generator (RNG) */ +# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */ + /* STM32 F103 Low Density Family *************************************************/ /* STM32F103C4 & STM32F103C6 */ diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index 61c78e2f2b..33c08b2ac7 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -251,6 +251,13 @@ config ARCH_CHIP_STM32F100VE select STM32_VALUELINE select STM32_HIGHDENSITY +config ARCH_CHIP_STM32F102CB + bool "STM32F102CB" + select ARCH_CORTEXM3 + select STM32_STM32F10XX + select STM32_USBACCESSLINE + select STM32_MEDIUMDENSITY + config ARCH_CHIP_STM32F103T8 bool "STM32F103T8" select ARCH_CORTEXM3 @@ -673,6 +680,14 @@ config STM32_PERFORMANCELINE select STM32_HAVE_ADC2 select STM32_HAVE_CAN1 +config STM32_USBACCESSLINE + bool + default n + select STM32_HAVE_USBDEV + select STM32_HAVE_FSMC + select STM32_HAVE_USART3 + select STM32_HAVE_SPI2 + config STM32_HIGHDENSITY bool default n diff --git a/arch/arm/src/stm32/chip.h b/arch/arm/src/stm32/chip.h index 87225ce0c8..17d9cc9f89 100644 --- a/arch/arm/src/stm32/chip.h +++ b/arch/arm/src/stm32/chip.h @@ -69,6 +69,10 @@ # if defined(CONFIG_STM32_VALUELINE) # include "chip/stm32f100_pinmap.h" +/* STM32 F102 USB Access Medium Density Family */ +# elif defined(CONFIG_ARCH_CHIP_STM32F102CB) +# include "chip/stm32f102_pinmap.h" + /* STM32 F103 Low / Medium Density Family */ # elif defined(CONFIG_ARCH_CHIP_STM32F103C4) || \ defined(CONFIG_ARCH_CHIP_STM32F103C8) || \