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:
commit
28f2eaa381
@ -1,3 +1,5 @@
|
||||
MODULE = board
|
||||
|
||||
DIRS = $(RIOTBOARD)/common/stm32f103c8
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
|
@ -1,3 +1,4 @@
|
||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||
USEMODULE += saul_gpio
|
||||
endif
|
||||
include $(RIOTBOARD)/common/stm32f103c8/Makefile.dep
|
||||
|
@ -1,13 +1 @@
|
||||
# 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
|
||||
-include $(RIOTBOARD)/common/stm32f103c8/Makefile.features
|
||||
|
@ -1,32 +1,2 @@
|
||||
## 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
|
||||
endif
|
||||
USEMODULE += boards_common_stm32f103c8
|
||||
include $(RIOTBOARD)/common/stm32f103c8/Makefile.include
|
||||
|
4
boards/bluepill/dist/openocd.cfg
vendored
4
boards/bluepill/dist/openocd.cfg
vendored
@ -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
1
boards/bluepill/dist/openocd.cfg
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../common/stm32f103c8/dist/openocd.cfg
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_stm32f130c8t6
|
||||
* @ingroup boards_bluepill
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
|
3
boards/common/stm32f103c8/Makefile
Normal file
3
boards/common/stm32f103c8/Makefile
Normal file
@ -0,0 +1,3 @@
|
||||
MODULE = boards_common_stm32f103c8
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
0
boards/common/stm32f103c8/Makefile.dep
Normal file
0
boards/common/stm32f103c8/Makefile.dep
Normal file
13
boards/common/stm32f103c8/Makefile.features
Normal file
13
boards/common/stm32f103c8/Makefile.features
Normal 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
|
34
boards/common/stm32f103c8/Makefile.include
Normal file
34
boards/common/stm32f103c8/Makefile.include
Normal 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
|
4
boards/common/stm32f103c8/dist/openocd.cfg
vendored
Normal file
4
boards/common/stm32f103c8/dist/openocd.cfg
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
source [find target/stm32f1x.cfg]
|
||||
reset_config none separate
|
||||
|
||||
$_TARGETNAME configure -rtos auto
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_bluepill
|
||||
* @ingroup boards_common_stm32f103c8
|
||||
* @{
|
||||
*
|
||||
* @file
|
5
boards/stm32mindev/Makefile
Normal file
5
boards/stm32mindev/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
MODULE = board
|
||||
|
||||
DIRS = $(RIOTBOARD)/common/stm32f103c8
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
4
boards/stm32mindev/Makefile.dep
Normal file
4
boards/stm32mindev/Makefile.dep
Normal file
@ -0,0 +1,4 @@
|
||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||
USEMODULE += saul_gpio
|
||||
endif
|
||||
include $(RIOTBOARD)/common/stm32f103c8/Makefile.dep
|
1
boards/stm32mindev/Makefile.features
Normal file
1
boards/stm32mindev/Makefile.features
Normal file
@ -0,0 +1 @@
|
||||
-include $(RIOTBOARD)/common/stm32f103c8/Makefile.features
|
2
boards/stm32mindev/Makefile.include
Normal file
2
boards/stm32mindev/Makefile.include
Normal file
@ -0,0 +1,2 @@
|
||||
USEMODULE += boards_common_stm32f103c8
|
||||
include $(RIOTBOARD)/common/stm32f103c8/Makefile.include
|
35
boards/stm32mindev/board.c
Normal file
35
boards/stm32mindev/board.c
Normal 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
1
boards/stm32mindev/dist/openocd.cfg
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../common/stm32f103c8/dist/openocd.cfg
|
79
boards/stm32mindev/include/board.h
Normal file
79
boards/stm32mindev/include/board.h
Normal 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 */
|
||||
/** @} */
|
49
boards/stm32mindev/include/gpio_params.h
Normal file
49
boards/stm32mindev/include/gpio_params.h
Normal 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 */
|
||||
/** @} */
|
@ -18,7 +18,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon b-l072z-lrwan1 bluepill calliope-mini
|
||||
nucleo-f042k6 nucleo-f303k8 nucleo-l031k6 nucleo-f030r8 \
|
||||
nucleo-f070rb nucleo-f072rb nucleo-f103rb nucleo-f302r8 nucleo-f334r8 \
|
||||
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.
|
||||
# NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present
|
||||
|
@ -13,8 +13,8 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon b-l072z-lrwan1 bluepill calliope-mini
|
||||
nucleo-f031k6 nucleo-f042k6 nucleo-f303k8 nucleo-l031k6 \
|
||||
nucleo-f030r8 nucleo-f070rb nucleo-f072rb nucleo-f103rb nucleo-f302r8 \
|
||||
nucleo-f334r8 nucleo-l053r8 nucleo-l073rz opencm904 \
|
||||
spark-core stm32f0discovery telosb weio wsn430-v1_3b \
|
||||
wsn430-v1_4 yunjia-nrf51822 z1
|
||||
spark-core stm32f0discovery stm32mindev telosb \
|
||||
weio wsn430-v1_3b wsn430-v1_4 yunjia-nrf51822 z1
|
||||
|
||||
# The following boards do not have an available UART
|
||||
BOARD_BLACKLIST += mips-malta pic32-wifire pic32-clicker ruuvitag thingy52
|
||||
|
@ -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 \
|
||||
nucleo-f042k6 nucleo-f303k8 nucleo-l031k6 nucleo-f030r8 \
|
||||
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
|
||||
|
||||
# Include packages that pull up and auto-init the link layer.
|
||||
|
@ -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-l053r8 nucleo-l073rz nucleo-f031k6 nucleo-f042k6 \
|
||||
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 \
|
||||
msb-430 msb-430h telosb waspmote-pro wsn430-v1_3b \
|
||||
|
@ -7,17 +7,18 @@ BOARD ?= native
|
||||
RIOTBASE ?= $(CURDIR)/../..
|
||||
|
||||
BOARD_INSUFFICIENT_MEMORY := bluepill calliope-mini cc2650-launchpad \
|
||||
cc2650stk maple-mini microbit nrf51dongle \
|
||||
nucleo-f030r8 nucleo-f031k6 nucleo-f042k6 \
|
||||
nucleo-f070rb nucleo-f072rb nucleo-f103rb \
|
||||
nucleo-f302r8 nucleo-f303k8 nucleo-f334r8 \
|
||||
nucleo-f410rb nucleo-l031k6 nucleo-l053r8 \
|
||||
opencm904 spark-core stm32f0discovery
|
||||
cc2650stk maple-mini microbit nrf51dongle \
|
||||
nucleo-f030r8 nucleo-f031k6 nucleo-f042k6 \
|
||||
nucleo-f070rb nucleo-f072rb nucleo-f103rb \
|
||||
nucleo-f302r8 nucleo-f303k8 nucleo-f334r8 \
|
||||
nucleo-f410rb nucleo-l031k6 nucleo-l053r8 \
|
||||
opencm904 spark-core stm32f0discovery \
|
||||
stm32mindev
|
||||
|
||||
BOARD_BLACKLIST := arduino-duemilanove arduino-mega2560 arduino-uno \
|
||||
chronos hifive1 jiminy-mega256rfr2 mega-xplained mips-malta \
|
||||
msb-430 msb-430h pic32-clicker pic32-wifire telosb \
|
||||
waspmote-pro wsn430-v1_3b wsn430-v1_4 z1
|
||||
msb-430 msb-430h pic32-clicker pic32-wifire telosb \
|
||||
waspmote-pro wsn430-v1_3b wsn430-v1_4 z1
|
||||
|
||||
|
||||
# Comment this out to disable code in RIOT that does safety checking
|
||||
|
@ -7,8 +7,8 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon b-l072z-lrwan1 bluepill calliope-mini
|
||||
nucleo-f302r8 nucleo-f334r8 nucleo-l053r8 nucleo-l073rz \
|
||||
nucleo-f031k6 nucleo-f042k6 nucleo-f303k8 \
|
||||
nucleo-l031k6 opencm904 spark-core \
|
||||
stm32f0discovery telosb wsn430-v1_3b wsn430-v1_4 \
|
||||
yunjia-nrf51822 z1
|
||||
stm32f0discovery stm32mindev telosb \
|
||||
wsn430-v1_3b wsn430-v1_4 yunjia-nrf51822 z1
|
||||
|
||||
USEMODULE += embunit
|
||||
USEMODULE += gnrc_netif
|
||||
|
@ -66,6 +66,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon \
|
||||
stk3600 \
|
||||
stm32f0discovery \
|
||||
stm32f3discovery \
|
||||
stm32mindev \
|
||||
teensy31 \
|
||||
telosb \
|
||||
waspmote-pro \
|
||||
|
Loading…
Reference in New Issue
Block a user