Skip to content

Commit

Permalink
soc: stm32f1: Add support for stm32f1xx SoCs
Browse files Browse the repository at this point in the history
Define stm32f100xx family, tested using stm32vl_disco
(stm32f100rb).

Signed-off-by: Jonas Eriksson <[email protected]>
  • Loading branch information
zqad authored and MaureenHelm committed Jan 28, 2020
1 parent 7e7f055 commit 3e64e75
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
36 changes: 36 additions & 0 deletions dts/arm/st/f1/stm32f100Xb.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2020 Jonas Eriksson, Up to Code AB
*
* SoC device tree include for STM32F100xB SoCs
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <mem.h>
#include <st/f1/stm32f1.dtsi>

/ {
sram0: memory@20000000 {
reg = <0x20000000 DT_SIZE_K(8)>;
};

soc {
flash-controller@40022000 {
flash0: flash@8000000 {
reg = <0x08000000 DT_SIZE_K(128)>;
erase-block-size = <DT_SIZE_K(1)>;
};
};

spi2: spi@40003800 {
compatible = "st,stm32-spi";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x40003800 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00004000>;
interrupts = <36 5>;
status = "disabled";
label = "SPI_2";
};
};
};
35 changes: 35 additions & 0 deletions dts/arm/st/f1/stm32f100Xe.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2020 Jonas Eriksson, Up to Code AB
*
* SoC device tree include for STM32F100xE SoCs
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <mem.h>
#include <st/f1/stm32f100Xb.dtsi>

/ {
sram0: memory@20000000 {
reg = <0x20000000 DT_SIZE_K(32)>;
};

soc {
flash-controller@40022000 {
flash0: flash@8000000 {
reg = <0x08000000 DT_SIZE_K(512)>;
};
};

spi3: spi@40003c00 {
compatible = "st,stm32-spi";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x40003c00 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00008000>;
interrupts = <51 5>;
status = "disabled";
label = "SPI_3";
};
};
};
24 changes: 24 additions & 0 deletions soc/arm/st_stm32/stm32f1/Kconfig.defconfig.stm32f100xx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ST Microelectronics STM32F100XX MCU

# Copyright (c) 2020, Jonas Eriksson, Up to Code AB
# SPDX-License-Identifier: Apache-2.0

if SOC_STM32F100XB

config SOC
default "stm32f100xb"

config NUM_IRQS
default 56

endif # SOC_STM32F100XB

if SOC_STM32F100XE

config SOC
default "stm32f100xe"

config NUM_IRQS
default 61

endif # SOC_STM32F100XE
8 changes: 8 additions & 0 deletions soc/arm/st_stm32/stm32f1/Kconfig.soc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ choice
prompt "STM32F1x MCU Selection"
depends on SOC_SERIES_STM32F1X

config SOC_STM32F100XB
bool "STM32F100XB"
select SOC_STM32F10X_DENSITY_DEVICE

config SOC_STM32F100XE
bool "STM32F100XE"
select SOC_STM32F10X_DENSITY_DEVICE

config SOC_STM32F103XE
bool "STM32F103XE"
select SOC_STM32F10X_DENSITY_DEVICE
Expand Down

0 comments on commit 3e64e75

Please sign in to comment.