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

boards: Added module boards_common_stm32f103c8 & refactored bluepill

- Moved common code for STM32F103C8 based boards to the new module
- Updated board `bluepill` to use the new module
This commit is contained in:
Marian Buschsieweke 2018-05-28 22:32:44 +02:00
parent 5e5773c631
commit bb6d0e304c
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
12 changed files with 63 additions and 51 deletions

View File

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

View File

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

View File

@ -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

View File

@ -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

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

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