Skip to content

Commit bff90e4

Browse files
committed
Add Bluepill Plus support
1 parent 6d868b4 commit bff90e4

4 files changed

Lines changed: 123 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ To build other targets, you can override the
2020
|`MAPLEMINI` | LeafLabs Maple Mini board and clone derivatives | https://stm32duinoforum.com/forum/wiki_subdomain/index_title_Maple_Mini.html |
2121
|`STLINK` | STLink/v2 hardware clones | https://wiki.paparazziuav.org/wiki/STLink#Clones |
2222
|`OLIMEXSTM32H103` | Olimex STM32-H103 | https://www.olimex.com/Products/ARM/ST/STM32-H103/ |
23+
|`BLUEPILLPLUSSTM32` | Bluepill with USB C | https://github.com/WeActTC/BluePill-Plus/ |
2324

2425
For each of the above targets, there are three variants that can be added to the target name:
2526

release.Makefile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,17 @@ all: dapboot-bluepill.bin \
3333
dapboot-maplemini.bin \
3434
dapboot-stlink.bin \
3535
dapboot-olimexstm32h103.bin \
36+
dapboot-bluepillplusstm32.bin \
3637
dapboot-bluepill-high.bin \
3738
dapboot-maplemini-high.bin \
3839
dapboot-stlink-high.bin \
3940
dapboot-olimexstm32h103-high.bin \
41+
dapboot-bluepillplusstm32-high.bin \
4042
dapboot-bluepill-high-128.bin \
4143
dapboot-maplemini-high-128.bin \
4244
dapboot-stlink-high-128.bin \
43-
dapboot-olimexstm32h103-high-128.bin
45+
dapboot-olimexstm32h103-high-128.bin \
46+
dapboot-bluepillplusstm32-high-128.bin
4447

4548
clean:
4649
$(Q)$(RM) $(BUILD_DIR)/*.bin
@@ -75,6 +78,12 @@ dapboot-olimexstm32h103.bin: | $(BUILD_DIR)
7578
$(Q)$(MAKE) TARGET=OLIMEXSTM32H103 -C src/
7679
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)
7780

81+
dapboot-bluepillplusstm32.bin: | $(BUILD_DIR)
82+
@printf " BUILD $(@)\n"
83+
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32 -C src/ clean
84+
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32 -C src/
85+
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)
86+
7887
dapboot-bluepill-high.bin: | $(BUILD_DIR)
7988
@printf " BUILD $(@)\n"
8089
$(Q)$(MAKE) TARGET=BLUEPILL_HIGH -C src/ clean
@@ -99,6 +108,12 @@ dapboot-olimexstm32h103-high.bin: | $(BUILD_DIR)
99108
$(Q)$(MAKE) TARGET=OLIMEXSTM32H103_HIGH -C src/
100109
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)
101110

111+
dapboot-bluepillplusstm32-high.bin: | $(BUILD_DIR)
112+
@printf " BUILD $(@)\n"
113+
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32_HIGH -C src/ clean
114+
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32_HIGH -C src/
115+
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)
116+
102117
dapboot-bluepill-high-128.bin: | $(BUILD_DIR)
103118
@printf " BUILD $(@)\n"
104119
$(Q)$(MAKE) TARGET=BLUEPILL_HIGH_128 -C src/ clean
@@ -122,3 +137,9 @@ dapboot-olimexstm32h103-high-128.bin: | $(BUILD_DIR)
122137
$(Q)$(MAKE) TARGET=OLIMEXSTM32H103_HIGH_128 -C src/ clean
123138
$(Q)$(MAKE) TARGET=OLIMEXSTM32H103_HIGH_128 -C src/
124139
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)
140+
141+
dapboot-bluepillplusstm32-high-128.bin: | $(BUILD_DIR)
142+
@printf " BUILD $(@)\n"
143+
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32_HIGH_128 -C src/ clean
144+
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32_HIGH_128 -C src/
145+
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
* Copyright (c) 2016, Devan Lai
3+
*
4+
* Permission to use, copy, modify, and/or distribute this software
5+
* for any purpose with or without fee is hereby granted, provided
6+
* that the above copyright notice and this permission notice
7+
* appear in all copies.
8+
*
9+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10+
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11+
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12+
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
13+
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15+
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16+
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17+
*/
18+
19+
#ifndef CONFIG_H_INCLUDED
20+
#define CONFIG_H_INCLUDED
21+
22+
#ifndef APP_BASE_ADDRESS
23+
#define APP_BASE_ADDRESS (0x08000000 + BOOTLOADER_OFFSET)
24+
#endif
25+
#ifndef FLASH_SIZE_OVERRIDE
26+
#define FLASH_SIZE_OVERRIDE 0x20000
27+
#endif
28+
#ifndef FLASH_PAGE_SIZE
29+
#define FLASH_PAGE_SIZE 1024
30+
#endif
31+
#ifndef DFU_UPLOAD_AVAILABLE
32+
#define DFU_UPLOAD_AVAILABLE 1
33+
#endif
34+
#ifndef DFU_DOWNLOAD_AVAILABLE
35+
#define DFU_DOWNLOAD_AVAILABLE 1
36+
#endif
37+
38+
#ifndef HAVE_LED
39+
#define HAVE_LED 1
40+
#endif
41+
#ifndef LED_OPEN_DRAIN
42+
#define LED_OPEN_DRAIN 0
43+
#endif
44+
#ifndef LED_GPIO_PORT
45+
#define LED_GPIO_PORT GPIOB
46+
#endif
47+
#ifndef LED_GPIO_PIN
48+
#define LED_GPIO_PIN GPIO2
49+
#endif
50+
51+
#ifndef HAVE_BUTTON
52+
#define HAVE_BUTTON 1
53+
#endif
54+
#ifndef BUTTON_ACTIVE_HIGH
55+
#define BUTTON_ACTIVE_HIGH 1
56+
#endif
57+
#ifndef BUTTON_GPIO_PORT
58+
#define BUTTON_GPIO_PORT GPIOA
59+
#endif
60+
#ifndef BUTTON_GPIO_PIN
61+
#define BUTTON_GPIO_PIN GPIO0
62+
#endif
63+
#ifndef BUTTON_USES_PULL
64+
#define BUTTON_USES_PULL 1
65+
#endif
66+
#ifndef BUTTON_SAMPLE_DELAY_CYCLES
67+
#define BUTTON_SAMPLE_DELAY_CYCLES 1440000
68+
#endif
69+
70+
#ifndef HAVE_USB_PULLUP_CONTROL
71+
#define HAVE_USB_PULLUP_CONTROL 0
72+
#endif
73+
74+
#ifndef USES_GPIOA
75+
#define USES_GPIOA 1
76+
#endif
77+
#ifndef USES_GPIOB
78+
#define USES_GPIOB 1
79+
#endif
80+
81+
#endif

src/targets.mk

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,25 @@ ifeq ($(TARGET),OLIMEXSTM32H103_HIGH_128)
100100
ARCH = STM32F1
101101
DEFS += -DBOOTLOADER_HIGH
102102
endif
103+
ifeq ($(TARGET),BLUEPILLPLUSSTM32)
104+
TARGET_COMMON_DIR := ./stm32f103
105+
TARGET_SPEC_DIR := ./stm32f103/bluepillplus
106+
LDSCRIPT := ./stm32f103/stm32f103x8.ld
107+
ARCH = STM32F1
108+
endif
109+
ifeq ($(TARGET),BLUEPILLPLUSSTM32_HIGH)
110+
TARGET_COMMON_DIR := ./stm32f103
111+
TARGET_SPEC_DIR := ./stm32f103/bluepillplus
112+
LDSCRIPT := ./stm32f103/stm32f103x8_high.ld
113+
ARCH = STM32F1
114+
endif
115+
ifeq ($(TARGET),BLUEPILLPLUSSTM32_HIGH_128)
116+
TARGET_COMMON_DIR := ./stm32f103
117+
TARGET_SPEC_DIR := ./stm32f103/bluepillplus
118+
LDSCRIPT := ./stm32f103/stm32f103xb_high.ld
119+
ARCH = STM32F1
120+
DEFS += -DBOOTLOADER_HIGH
121+
endif
103122
ifeq ($(TARGET),STM32L1_GENERIC)
104123
TARGET_COMMON_DIR := ./stm32l1
105124
TARGET_SPEC_DIR := ./stm32l1/generic

0 commit comments

Comments
 (0)