1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #9126 from maribu/stm32f103c8_boards

boards: add stm32mindev (clone of the Blue Pill board)
This commit is contained in:
Kevin Weiss 2018-06-04 10:48:57 +02:00 committed by GitHub
commit 28f2eaa381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 257 additions and 66 deletions

View File

@ -1,3 +1,5 @@
MODULE = board MODULE = board
DIRS = $(RIOTBOARD)/common/stm32f103c8
include $(RIOTBASE)/Makefile.base include $(RIOTBASE)/Makefile.base

View File

@ -1,3 +1,4 @@
ifneq (,$(filter saul_default,$(USEMODULE))) ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio USEMODULE += saul_gpio
endif endif
include $(RIOTBOARD)/common/stm32f103c8/Makefile.dep

View File

@ -1,13 +1 @@
# Put defined MCU peripherals here (in alphabetical order) -include $(RIOTBOARD)/common/stm32f103c8/Makefile.features
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
# The board MPU family (used for grouping by the CI system)
FEATURES_MCU_GROUP = cortex_m3_2
-include $(RIOTCPU)/stm32f1/Makefile.features

View File

@ -1,32 +1,2 @@
## the cpu to build for USEMODULE += boards_common_stm32f103c8
export CPU = stm32f1 include $(RIOTBOARD)/common/stm32f103c8/Makefile.include
export CPU_MODEL = stm32f103c8
# define the default port depending on the host OS
PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk
# optionally, use dfu-util to flash via usb
# note: needs a bootloader flashed before, config below is compatible
# with blackmagic_dfu, see https://github.com/blacksphere/blackmagic/
# To stop bootloader from loading an existing firmware, pull down
# (ground) GPIO B1.
ifeq ($(PROGRAMMER),dfu-util)
export ROM_OFFSET ?= 0x2000 # Skip the space needed by the embedded bootloader
export FLASHER = dfu-util
export DEBUGGER = # no debugger
export RESET = # dfu-util has no support for resetting the device
HEXFILE = $(BINFILE)
export FFLAGS = -d 1d50:6017 -s 0x08002000:leave -D "$(HEXFILE)"
else
# this board uses openocd by default
export DEBUG_ADAPTER ?= stlink
export STLINK_VERSION ?= 2
include $(RIOTMAKE)/tools/openocd.inc.mk
endif

View File

@ -1,4 +0,0 @@
source [find target/stm32f1x.cfg]
reset_config none separate
$_TARGETNAME configure -rtos auto

1
boards/bluepill/dist/openocd.cfg vendored Symbolic link
View File

@ -0,0 +1 @@
../../common/stm32f103c8/dist/openocd.cfg

View File

@ -7,7 +7,7 @@
*/ */
/** /**
* @ingroup boards_stm32f130c8t6 * @ingroup boards_bluepill
* @{ * @{
* *
* @file * @file

View File

@ -0,0 +1,3 @@
MODULE = boards_common_stm32f103c8
include $(RIOTBASE)/Makefile.base

View File

View File

@ -0,0 +1,13 @@
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
# The board MPU family (used for grouping by the CI system)
FEATURES_MCU_GROUP = cortex_m3_2
-include $(RIOTCPU)/stm32f1/Makefile.features

View File

@ -0,0 +1,34 @@
## the cpu to build for
export CPU = stm32f1
export CPU_MODEL = stm32f103c8
# define the default port depending on the host OS
PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk
# optionally, use dfu-util to flash via usb
# note: needs a bootloader flashed before, config below is compatible
# with blackmagic_dfu, see https://github.com/blacksphere/blackmagic/
# To stop bootloader from loading an existing firmware, pull down
# (ground) GPIO B1.
ifeq ($(PROGRAMMER),dfu-util)
export ROM_OFFSET ?= 0x2000 # Skip the space needed by the embedded bootloader
export FLASHER = dfu-util
export DEBUGGER = # no debugger
export RESET = # dfu-util has no support for resetting the device
HEXFILE = $(BINFILE)
export FFLAGS = -d 1d50:6017 -s 0x08002000:leave -D "$(HEXFILE)"
else
# this board uses openocd by default
export DEBUG_ADAPTER ?= stlink
export STLINK_VERSION ?= 2
include $(RIOTMAKE)/tools/openocd.inc.mk
INCLUDES += -I$(RIOTBOARD)/common/stm32f103c8/include
endif

View File

@ -0,0 +1,4 @@
source [find target/stm32f1x.cfg]
reset_config none separate
$_TARGETNAME configure -rtos auto

View File

@ -8,7 +8,7 @@
*/ */
/** /**
* @ingroup boards_bluepill * @ingroup boards_common_stm32f103c8
* @{ * @{
* *
* @file * @file

View File

@ -0,0 +1,5 @@
MODULE = board
DIRS = $(RIOTBOARD)/common/stm32f103c8
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,4 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/stm32f103c8/Makefile.dep

View File

@ -0,0 +1 @@
-include $(RIOTBOARD)/common/stm32f103c8/Makefile.features

View File

@ -0,0 +1,2 @@
USEMODULE += boards_common_stm32f103c8
include $(RIOTBOARD)/common/stm32f103c8/Makefile.include

View File

@ -0,0 +1,35 @@
/*
* Copyright (C) 2015 TriaGnoSys GmbH
* 2017 Alexander Kurth, Sören Tempel, Tristan Bruns
* 2018 Otto-von-Guericke-Universität Magdeburg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_stm32mindev
* @{
*
* @file
* @brief Board specific implementations for the STM32 Minimum Development
* Board
*
* @author Víctor Ariño <victor.arino@triagnosys.com>
* @author Sören Tempel <tempel@uni-bremen.de>
* @author Tristan Bruns <tbruns@uni-bremen.de>
* @author Alexander Kurth <kurth1@uni-bremen.de>
* @author Marian Buschsieweke <marian.buschsieweke@ovgu.de>
*
* @}
*/
#include "board.h"
#include "periph/gpio.h"
void board_init(void)
{
cpu_init();
gpio_init(LED0_PIN, GPIO_OUT);
}

1
boards/stm32mindev/dist/openocd.cfg vendored Symbolic link
View File

@ -0,0 +1 @@
../../common/stm32f103c8/dist/openocd.cfg

View File

@ -0,0 +1,79 @@
/*
* Copyright (C) 2015 TriaGnoSys GmbH
* 2017 Alexander Kurth, Sören Tempel, Tristan Bruns
* 2018 Otto-von-Guericke-Universität Magdeburg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup boards_stm32mindev STM32 Minimum System Development Board
* @ingroup boards
* @brief Support for the stm32f103c8 based STM32 Minimum System
* Development Board.
*
* This board can be bought very cheaply on sides like eBay or
* AliExpress. Although the MCU nominally has 64 KiB ROM, most of them
* have 128 KiB ROM. This board is almost identical to the bluepill board,
* except for the pin layout and the on board LED is connected to PB12 instead
* of PC13. For more information see:
* http://wiki.stm32duino.com/index.php?title=Blue_Pill
*
* @{
*
* @file
* @brief Peripheral MCU configuration for the stm32mindev board
*
* @author Víctor Ariño <victor.arino@triagnosys.com>
* @author Sören Tempel <tempel@uni-bremen.de>
* @author Tristan Bruns <tbruns@uni-bremen.de>
* @author Alexander Kurth <kurth1@uni-bremen.de>
* @author Marian Buschsieweke <marian.buschsieweke@ovgu.de>
*/
#ifndef BOARD_H
#define BOARD_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Macros for controlling the on-board LED.
* @{
*/
#define LED0_PORT GPIOB
#define LED0_PIN GPIO_PIN(PORT_B, 12)
#define LED0_MASK (1 << 12)
#define LED0_ON (LED0_PORT->BSRR = (LED0_MASK << 16))
#define LED0_OFF (LED0_PORT->BSRR = LED0_MASK)
#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK)
/** @} */
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
void board_init(void);
/**
* @brief Use the 2nd UART for STDIO on this board
*/
#define UART_STDIO_DEV UART_DEV(1)
/**
* @name xtimer configuration
* @{
*/
#define XTIMER_WIDTH (16)
#define XTIMER_BACKOFF 5
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H */
/** @} */

View File

@ -0,0 +1,49 @@
/*
* Copyright (C) 2017 HAW Hamburg
* 2018 Otto-von-Guericke-Universität Magdeburg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_stm32mindev
* @{
*
* @file
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Sebastian Meiling <s@mlng.net>
* @author Marian Buschsieweke <marian.buschsieweke@ovgu.de>
*/
#ifndef GPIO_PARAMS_H
#define GPIO_PARAMS_H
#include "board.h"
#include "saul/periph.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief GPIO pin configuration
*/
static const saul_gpio_params_t saul_gpio_params[] =
{
{
.name = "LED",
.pin = LED0_PIN,
.mode = GPIO_OUT,
.flags = (SAUL_GPIO_INVERTED | SAUL_GPIO_INIT_CLEAR)
},
};
#ifdef __cplusplus
}
#endif
#endif /* GPIO_PARAMS_H */
/** @} */

View File

@ -18,7 +18,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon b-l072z-lrwan1 bluepill calliope-mini
nucleo-f042k6 nucleo-f303k8 nucleo-l031k6 nucleo-f030r8 \ nucleo-f042k6 nucleo-f303k8 nucleo-l031k6 nucleo-f030r8 \
nucleo-f070rb nucleo-f072rb nucleo-f103rb nucleo-f302r8 nucleo-f334r8 \ nucleo-f070rb nucleo-f072rb nucleo-f103rb nucleo-f302r8 nucleo-f334r8 \
nucleo-l053r8 nucleo-l073rz opencm904 \ nucleo-l053r8 nucleo-l073rz opencm904 \
spark-core stm32f0discovery yunjia-nrf51822 spark-core stm32f0discovery stm32mindev yunjia-nrf51822
# Include packages that pull up and auto-init the link layer. # Include packages that pull up and auto-init the link layer.
# NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present

View File

@ -13,8 +13,8 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon b-l072z-lrwan1 bluepill calliope-mini
nucleo-f031k6 nucleo-f042k6 nucleo-f303k8 nucleo-l031k6 \ nucleo-f031k6 nucleo-f042k6 nucleo-f303k8 nucleo-l031k6 \
nucleo-f030r8 nucleo-f070rb nucleo-f072rb nucleo-f103rb nucleo-f302r8 \ nucleo-f030r8 nucleo-f070rb nucleo-f072rb nucleo-f103rb nucleo-f302r8 \
nucleo-f334r8 nucleo-l053r8 nucleo-l073rz opencm904 \ nucleo-f334r8 nucleo-l053r8 nucleo-l073rz opencm904 \
spark-core stm32f0discovery telosb weio wsn430-v1_3b \ spark-core stm32f0discovery stm32mindev telosb \
wsn430-v1_4 yunjia-nrf51822 z1 weio wsn430-v1_3b wsn430-v1_4 yunjia-nrf51822 z1
# The following boards do not have an available UART # The following boards do not have an available UART
BOARD_BLACKLIST += mips-malta pic32-wifire pic32-clicker ruuvitag thingy52 BOARD_BLACKLIST += mips-malta pic32-wifire pic32-clicker ruuvitag thingy52

View File

@ -11,7 +11,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon b-l072z-lrwan1 bluepill calliope-mini
hifive1 microbit msb-430 msb-430h nrf51dongle nrf6310 nucleo-f031k6 \ hifive1 microbit msb-430 msb-430h nrf51dongle nrf6310 nucleo-f031k6 \
nucleo-f042k6 nucleo-f303k8 nucleo-l031k6 nucleo-f030r8 \ nucleo-f042k6 nucleo-f303k8 nucleo-l031k6 nucleo-f030r8 \
nucleo-f070rb nucleo-f072rb nucleo-f103rb nucleo-f302r8 nucleo-f334r8 \ nucleo-f070rb nucleo-f072rb nucleo-f103rb nucleo-f302r8 nucleo-f334r8 \
nucleo-l053r8 spark-core stm32f0discovery \ nucleo-l053r8 spark-core stm32f0discovery stm32mindev \
telosb wsn430-v1_3b wsn430-v1_4 yunjia-nrf51822 z1 telosb wsn430-v1_3b wsn430-v1_4 yunjia-nrf51822 z1
# Include packages that pull up and auto-init the link layer. # Include packages that pull up and auto-init the link layer.

View File

@ -13,7 +13,8 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon b-l072z-lrwan1 bluepill calliope-mini
nucleo-f072rb nucleo-f103rb nucleo-f302r8 nucleo-f334r8 nucleo-f410rb \ nucleo-f072rb nucleo-f103rb nucleo-f302r8 nucleo-f334r8 nucleo-f410rb \
nucleo-l053r8 nucleo-l073rz nucleo-f031k6 nucleo-f042k6 \ nucleo-l053r8 nucleo-l073rz nucleo-f031k6 nucleo-f042k6 \
nucleo-f303k8 nucleo-l031k6 opencm904 \ nucleo-f303k8 nucleo-l031k6 opencm904 \
spark-core stm32f0discovery yunjia-nrf51822 \ spark-core stm32f0discovery stm32mindev \
yunjia-nrf51822
BOARD_BLACKLIST := arduino-duemilanove arduino-mega2560 arduino-uno chronos \ BOARD_BLACKLIST := arduino-duemilanove arduino-mega2560 arduino-uno chronos \
msb-430 msb-430h telosb waspmote-pro wsn430-v1_3b \ msb-430 msb-430h telosb waspmote-pro wsn430-v1_3b \

View File

@ -7,17 +7,18 @@ BOARD ?= native
RIOTBASE ?= $(CURDIR)/../.. RIOTBASE ?= $(CURDIR)/../..
BOARD_INSUFFICIENT_MEMORY := bluepill calliope-mini cc2650-launchpad \ BOARD_INSUFFICIENT_MEMORY := bluepill calliope-mini cc2650-launchpad \
cc2650stk maple-mini microbit nrf51dongle \ cc2650stk maple-mini microbit nrf51dongle \
nucleo-f030r8 nucleo-f031k6 nucleo-f042k6 \ nucleo-f030r8 nucleo-f031k6 nucleo-f042k6 \
nucleo-f070rb nucleo-f072rb nucleo-f103rb \ nucleo-f070rb nucleo-f072rb nucleo-f103rb \
nucleo-f302r8 nucleo-f303k8 nucleo-f334r8 \ nucleo-f302r8 nucleo-f303k8 nucleo-f334r8 \
nucleo-f410rb nucleo-l031k6 nucleo-l053r8 \ nucleo-f410rb nucleo-l031k6 nucleo-l053r8 \
opencm904 spark-core stm32f0discovery opencm904 spark-core stm32f0discovery \
stm32mindev
BOARD_BLACKLIST := arduino-duemilanove arduino-mega2560 arduino-uno \ BOARD_BLACKLIST := arduino-duemilanove arduino-mega2560 arduino-uno \
chronos hifive1 jiminy-mega256rfr2 mega-xplained mips-malta \ chronos hifive1 jiminy-mega256rfr2 mega-xplained mips-malta \
msb-430 msb-430h pic32-clicker pic32-wifire telosb \ msb-430 msb-430h pic32-clicker pic32-wifire telosb \
waspmote-pro wsn430-v1_3b wsn430-v1_4 z1 waspmote-pro wsn430-v1_3b wsn430-v1_4 z1
# Comment this out to disable code in RIOT that does safety checking # Comment this out to disable code in RIOT that does safety checking

View File

@ -7,8 +7,8 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon b-l072z-lrwan1 bluepill calliope-mini
nucleo-f302r8 nucleo-f334r8 nucleo-l053r8 nucleo-l073rz \ nucleo-f302r8 nucleo-f334r8 nucleo-l053r8 nucleo-l073rz \
nucleo-f031k6 nucleo-f042k6 nucleo-f303k8 \ nucleo-f031k6 nucleo-f042k6 nucleo-f303k8 \
nucleo-l031k6 opencm904 spark-core \ nucleo-l031k6 opencm904 spark-core \
stm32f0discovery telosb wsn430-v1_3b wsn430-v1_4 \ stm32f0discovery stm32mindev telosb \
yunjia-nrf51822 z1 wsn430-v1_3b wsn430-v1_4 yunjia-nrf51822 z1
USEMODULE += embunit USEMODULE += embunit
USEMODULE += gnrc_netif USEMODULE += gnrc_netif

View File

@ -66,6 +66,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon \
stk3600 \ stk3600 \
stm32f0discovery \ stm32f0discovery \
stm32f3discovery \ stm32f3discovery \
stm32mindev \
teensy31 \ teensy31 \
telosb \ telosb \
waspmote-pro \ waspmote-pro \