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:
parent
5e5773c631
commit
bb6d0e304c
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user