Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ To build other targets, you can override the
|`MAPLEMINI` | LeafLabs Maple Mini board and clone derivatives | https://stm32duinoforum.com/forum/wiki_subdomain/index_title_Maple_Mini.html |
|`STLINK` | STLink/v2 hardware clones | https://wiki.paparazziuav.org/wiki/STLink#Clones |
|`OLIMEXSTM32H103` | Olimex STM32-H103 | https://www.olimex.com/Products/ARM/ST/STM32-H103/ |
|`BLUEPILLPLUSSTM32` | Bluepill with USB C | https://github.com/WeActTC/BluePill-Plus/ |

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

Expand Down
23 changes: 22 additions & 1 deletion release.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ all: dapboot-bluepill.bin \
dapboot-maplemini.bin \
dapboot-stlink.bin \
dapboot-olimexstm32h103.bin \
dapboot-bluepillplusstm32.bin \
dapboot-bluepill-high.bin \
dapboot-maplemini-high.bin \
dapboot-stlink-high.bin \
dapboot-olimexstm32h103-high.bin \
dapboot-bluepillplusstm32-high.bin \
dapboot-bluepill-high-128.bin \
dapboot-maplemini-high-128.bin \
dapboot-stlink-high-128.bin \
dapboot-olimexstm32h103-high-128.bin
dapboot-olimexstm32h103-high-128.bin \
dapboot-bluepillplusstm32-high-128.bin

clean:
$(Q)$(RM) $(BUILD_DIR)/*.bin
Expand Down Expand Up @@ -75,6 +78,12 @@ dapboot-olimexstm32h103.bin: | $(BUILD_DIR)
$(Q)$(MAKE) TARGET=OLIMEXSTM32H103 -C src/
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)

dapboot-bluepillplusstm32.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32 -C src/ clean
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32 -C src/
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)

dapboot-bluepill-high.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=BLUEPILL_HIGH -C src/ clean
Expand All @@ -99,6 +108,12 @@ dapboot-olimexstm32h103-high.bin: | $(BUILD_DIR)
$(Q)$(MAKE) TARGET=OLIMEXSTM32H103_HIGH -C src/
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)

dapboot-bluepillplusstm32-high.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32_HIGH -C src/ clean
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32_HIGH -C src/
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)

dapboot-bluepill-high-128.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=BLUEPILL_HIGH_128 -C src/ clean
Expand All @@ -122,3 +137,9 @@ dapboot-olimexstm32h103-high-128.bin: | $(BUILD_DIR)
$(Q)$(MAKE) TARGET=OLIMEXSTM32H103_HIGH_128 -C src/ clean
$(Q)$(MAKE) TARGET=OLIMEXSTM32H103_HIGH_128 -C src/
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)

dapboot-bluepillplusstm32-high-128.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32_HIGH_128 -C src/ clean
$(Q)$(MAKE) TARGET=BLUEPILLPLUSSTM32_HIGH_128 -C src/
$(Q)cp src/dapboot.bin $(BUILD_DIR)/$(@)
81 changes: 81 additions & 0 deletions src/stm32f103/bluepillplus/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright (c) 2016, Devan Lai
*
* Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted, provided
* that the above copyright notice and this permission notice
* appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef CONFIG_H_INCLUDED
#define CONFIG_H_INCLUDED

#ifndef APP_BASE_ADDRESS
#define APP_BASE_ADDRESS (0x08000000 + BOOTLOADER_OFFSET)
#endif
#ifndef FLASH_SIZE_OVERRIDE
#define FLASH_SIZE_OVERRIDE 0x20000
#endif
#ifndef FLASH_PAGE_SIZE
#define FLASH_PAGE_SIZE 1024
#endif
#ifndef DFU_UPLOAD_AVAILABLE
#define DFU_UPLOAD_AVAILABLE 1
#endif
#ifndef DFU_DOWNLOAD_AVAILABLE
#define DFU_DOWNLOAD_AVAILABLE 1
#endif

#ifndef HAVE_LED
#define HAVE_LED 1
#endif
#ifndef LED_OPEN_DRAIN
#define LED_OPEN_DRAIN 0
#endif
#ifndef LED_GPIO_PORT
#define LED_GPIO_PORT GPIOB
#endif
#ifndef LED_GPIO_PIN
#define LED_GPIO_PIN GPIO2
#endif

#ifndef HAVE_BUTTON
#define HAVE_BUTTON 1
#endif
#ifndef BUTTON_ACTIVE_HIGH
#define BUTTON_ACTIVE_HIGH 1
#endif
#ifndef BUTTON_GPIO_PORT
#define BUTTON_GPIO_PORT GPIOA
#endif
#ifndef BUTTON_GPIO_PIN
#define BUTTON_GPIO_PIN GPIO0
#endif
#ifndef BUTTON_USES_PULL
#define BUTTON_USES_PULL 1
#endif
#ifndef BUTTON_SAMPLE_DELAY_CYCLES
#define BUTTON_SAMPLE_DELAY_CYCLES 1440000
#endif

#ifndef HAVE_USB_PULLUP_CONTROL
#define HAVE_USB_PULLUP_CONTROL 0
#endif

#ifndef USES_GPIOA
#define USES_GPIOA 1
#endif
#ifndef USES_GPIOB
#define USES_GPIOB 1
#endif

#endif
19 changes: 19 additions & 0 deletions src/targets.mk
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,25 @@ ifeq ($(TARGET),OLIMEXSTM32H103_HIGH_128)
ARCH = STM32F1
DEFS += -DBOOTLOADER_HIGH
endif
ifeq ($(TARGET),BLUEPILLPLUSSTM32)
TARGET_COMMON_DIR := ./stm32f103
TARGET_SPEC_DIR := ./stm32f103/bluepillplus
LDSCRIPT := ./stm32f103/stm32f103x8.ld
ARCH = STM32F1
endif
ifeq ($(TARGET),BLUEPILLPLUSSTM32_HIGH)
TARGET_COMMON_DIR := ./stm32f103
TARGET_SPEC_DIR := ./stm32f103/bluepillplus
LDSCRIPT := ./stm32f103/stm32f103x8_high.ld
ARCH = STM32F1
endif
ifeq ($(TARGET),BLUEPILLPLUSSTM32_HIGH_128)
TARGET_COMMON_DIR := ./stm32f103
TARGET_SPEC_DIR := ./stm32f103/bluepillplus
LDSCRIPT := ./stm32f103/stm32f103xb_high.ld
ARCH = STM32F1
DEFS += -DBOOTLOADER_HIGH
endif
ifeq ($(TARGET),STM32L1_GENERIC)
TARGET_COMMON_DIR := ./stm32l1
TARGET_SPEC_DIR := ./stm32l1/generic
Expand Down