Skip to content

Commit

Permalink
board: stm32_min_dev: Add support for blue/black variant
Browse files Browse the repository at this point in the history
Add support for blue pill and black pill variants of the STM32
minimum development board by splitting board configuration into
stm32_min_dev_blue and stm32_min_dev_black.

CODEOWNERS: Add myself (@cbsiddharth) as codeowner for stm32_min_dev

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
  • Loading branch information
sidcha authored and galak committed Apr 26, 2019
1 parent 33d32fb commit bb72df5
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 15 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -80,6 +80,7 @@
/boards/arm/stm32*_eval/ @erwango /boards/arm/stm32*_eval/ @erwango
/boards/nios2/ @wentongwu /boards/nios2/ @wentongwu
/boards/nios2/altera_max10/ @wentongwu /boards/nios2/altera_max10/ @wentongwu
/boards/arm/stm32_min_dev/ @cbsiddharth
/boards/posix/ @aescolar /boards/posix/ @aescolar
/boards/riscv32/ @kgugala @pgielda @nategraff-sifive /boards/riscv32/ @kgugala @pgielda @nategraff-sifive
/boards/shields/ @erwango /boards/shields/ @erwango
Expand Down
9 changes: 7 additions & 2 deletions boards/arm/stm32_min_dev/Kconfig.board
Expand Up @@ -4,6 +4,11 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
config BOARD_STM32_MIN_DEV
bool "STM32 Minimum Development Board" config BOARD_STM32_MIN_DEV_BLUE
bool "STM32 Minimum Development Board (Blue)"
depends on SOC_STM32F103X8

config BOARD_STM32_MIN_DEV_BLACK
bool "STM32 Minimum Development Board (Black)"
depends on SOC_STM32F103X8 depends on SOC_STM32F103X8
7 changes: 4 additions & 3 deletions boards/arm/stm32_min_dev/Kconfig.defconfig
Expand Up @@ -5,10 +5,11 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #


if BOARD_STM32_MIN_DEV if BOARD_STM32_MIN_DEV_BLUE || BOARD_STM32_MIN_DEV_BLACK


config BOARD config BOARD
default "stm32_min_dev" default "stm32_min_dev_blue" if BOARD_STM32_MIN_DEV_BLUE
default "stm32_min_dev_black" if BOARD_STM32_MIN_DEV_BLACK


if UART_CONSOLE if UART_CONSOLE


Expand Down Expand Up @@ -41,4 +42,4 @@ config SPI_2


endif # SPI endif # SPI


endif # BOARD_STM32_MIN_DEV endif # BOARD_STM32_MIN_DEV_BLUE || BOARD_STM32_MIN_DEV_BLACK
@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017, embedjournal.com * Copyright (c) 2019, embedjournal.com
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
Expand All @@ -9,7 +9,7 @@


/ { / {
model = "STM32 Minimum Development Board"; model = "STM32 Minimum Development Board";
compatible = "st,stm32_min_dev", "st,stm32f103c8"; compatible = "st,stm32f103c8";


chosen { chosen {
zephyr,console = &usart1; zephyr,console = &usart1;
Expand All @@ -21,7 +21,7 @@
leds { leds {
compatible = "gpio-leds"; compatible = "gpio-leds";
led: led { led: led {
gpios = <&gpioc 13 GPIO_INT_ACTIVE_HIGH>; gpios = <&gpiob 12 GPIO_INT_ACTIVE_HIGH>;
label = "LD"; label = "LD";
}; };
}; };
Expand Down Expand Up @@ -70,7 +70,3 @@
status = "ok"; status = "ok";
}; };
}; };

&usb {
status = "ok";
};
19 changes: 19 additions & 0 deletions boards/arm/stm32_min_dev/stm32_min_dev_black.dts
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2019, embedjournal.com
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include "stm32_min_dev.dtsi"

/ {
model = "STM32 Minimum Development Board (Black)";
compatible = "st,stm32_min_dev_black", "st,stm32f103c8";

leds {
led: led {
gpios = <&gpiob 12 GPIO_INT_ACTIVE_HIGH>;
};
};
};
13 changes: 13 additions & 0 deletions boards/arm/stm32_min_dev/stm32_min_dev_black.yaml
@@ -0,0 +1,13 @@
identifier: stm32_min_dev_black
name: STM32 Minimum Development Board (Black)
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 20
supported:
- i2c
- pwm
- spi
44 changes: 44 additions & 0 deletions boards/arm/stm32_min_dev/stm32_min_dev_black_defconfig
@@ -0,0 +1,44 @@
# Kconfig - STM32 Minimum Development Board Configuration
#
# Copyright (c) 2019, embedjournal.com
#
# SPDX-License-Identifier: Apache-2.0
#

CONFIG_ARM=y
CONFIG_BOARD_STM32_MIN_DEV_BLACK=y
CONFIG_SOC_SERIES_STM32F1X=y
CONFIG_SOC_STM32F103X8=y
CONFIG_CORTEX_M_SYSTICK=y

# 72MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000

# enable uart driver
CONFIG_SERIAL=y

# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# enable pinmux
CONFIG_PINMUX=y

# enable GPIO
CONFIG_GPIO=y

# clock configuration
CONFIG_CLOCK_CONTROL=y
CONFIG_CLOCK_STM32_HSE_CLOCK=8000000
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y

# use HSE as PLL input
CONFIG_CLOCK_STM32_PLL_SRC_HSE=y
# produce 72MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_XTPRE=n
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9
CONFIG_CLOCK_STM32_AHB_PRESCALER=1

# APB1 clock must not exceed 36MHz limit
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
CONFIG_CLOCK_STM32_APB2_PRESCALER=1
19 changes: 19 additions & 0 deletions boards/arm/stm32_min_dev/stm32_min_dev_blue.dts
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2017, embedjournal.com
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include "stm32_min_dev.dtsi"

/ {
model = "STM32 Minimum Development Board (Blue)";
compatible = "st,stm32_min_dev_blue", "st,stm32f103c8";

leds {
led: led {
gpios = <&gpioc 13 GPIO_INT_ACTIVE_HIGH>;
};
};
};
@@ -1,5 +1,5 @@
identifier: stm32_min_dev identifier: stm32_min_dev_blue
name: STM32-MIN-DEV name: STM32 Minimum Development Board (Blue)
type: mcu type: mcu
arch: arm arch: arm
toolchain: toolchain:
Expand Down
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0


CONFIG_ARM=y CONFIG_ARM=y
CONFIG_BOARD_STM32_MIN_DEV=y CONFIG_BOARD_STM32_MIN_DEV_BLUE=y
CONFIG_SOC_SERIES_STM32F1X=y CONFIG_SOC_SERIES_STM32F1X=y
CONFIG_SOC_STM32F103X8=y CONFIG_SOC_STM32F103X8=y
CONFIG_CORTEX_M_SYSTICK=y CONFIG_CORTEX_M_SYSTICK=y
Expand Down

0 comments on commit bb72df5

Please sign in to comment.