summaryrefslogtreecommitdiff
path: root/keyboards/handwired/onekey/bluepill_f103c6/rules.mk
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-08-28 14:23:01 +1000
committerNick Brassel <nick@tzarc.org>2022-08-28 14:23:01 +1000
commit0a3f7e48690bb2b7b008300a54554979a55be19a (patch)
tree7499d52f20040ed7d5a56496ecb81ed114f80719 /keyboards/handwired/onekey/bluepill_f103c6/rules.mk
parentfc0bf67f372c38f72c303cdec21b1d4afb5e8cb4 (diff)
parent9b5b0722555891ba94f240760ef3a6d4c870fd13 (diff)
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'keyboards/handwired/onekey/bluepill_f103c6/rules.mk')
-rw-r--r--keyboards/handwired/onekey/bluepill_f103c6/rules.mk27
1 files changed, 27 insertions, 0 deletions
diff --git a/keyboards/handwired/onekey/bluepill_f103c6/rules.mk b/keyboards/handwired/onekey/bluepill_f103c6/rules.mk
new file mode 100644
index 0000000000..f2280a1a59
--- /dev/null
+++ b/keyboards/handwired/onekey/bluepill_f103c6/rules.mk
@@ -0,0 +1,27 @@
+# MCU name
+MCU = STM32F103
+
+# Bootloader selection
+# Cannot use `BOOTLOADER = stm32duino` due to the need to override
+# `MCU_LDSCRIPT`, therefore all parameters need to be specified here manually.
+OPT_DEFS += -DBOOTLOADER_STM32DUINO
+MCU_LDSCRIPT = STM32F103x6_stm32duino_bootloader
+BOARD = STM32_F103_STM32DUINO
+BOOTLOADER_TYPE = stm32duino
+DFU_ARGS = -d 1EAF:0003 -a 2 -R
+DFU_SUFFIX_ARGS = -v 1EAF -p 0003
+
+# Enter lower-power sleep mode when on the ChibiOS idle thread
+OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
+
+# LTO is required to fit the firmware into the available 24K of flash
+LTO_ENABLE = yes
+
+# Disable some features which still don't fit into flash even with LTO
+MOUSEKEY_ENABLE = no
+NKRO_ENABLE = no
+
+# EEPROM emulation not supported yet (need to implement a proper firmware size
+# check first, otherwise the chance of the EEPROM backing store overwriting
+# some part of the firmware code is really high).
+EEPROM_DRIVER = transient