aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/config_options.md1
-rw-r--r--docs/feature_split_keyboard.md2
-rw-r--r--docs/flashing.md4
-rw-r--r--docs/newbs_flashing.md16
-rw-r--r--tmk_core/chibios.mk15
-rw-r--r--tmk_core/common/eeconfig.c10
6 files changed, 44 insertions, 4 deletions
diff --git a/docs/config_options.md b/docs/config_options.md
index 77e2368f3..9e43f47c2 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -224,6 +224,7 @@ There are a few different ways to set handedness for split keyboards (listed in
2242. Set `EE_HANDS` and flash `eeprom-lefthand.eep`/`eeprom-righthand.eep` to each half 2242. Set `EE_HANDS` and flash `eeprom-lefthand.eep`/`eeprom-righthand.eep` to each half
225 * For boards with DFU bootloader you can use `:dfu-split-left`/`:dfu-split-right` to flash these EEPROM files 225 * For boards with DFU bootloader you can use `:dfu-split-left`/`:dfu-split-right` to flash these EEPROM files
226 * For boards with Caterina bootloader (like stock Pro Micros), use `:avrdude-split-left`/`:avrdude-split-right` 226 * For boards with Caterina bootloader (like stock Pro Micros), use `:avrdude-split-left`/`:avrdude-split-right`
227 * For boards with ARM DFU bootloader (like Proton C), use `:dfu-util-split-left`/`:dfu-util-split-right`
2273. Set `MASTER_RIGHT`: Half that is plugged into the USB port is determined to be the master and right half (inverse of the default) 2283. Set `MASTER_RIGHT`: Half that is plugged into the USB port is determined to be the master and right half (inverse of the default)
2284. Default: The side that is plugged into the USB port is the master half and is assumed to be the left half. The slave side is the right half 2294. Default: The side that is plugged into the USB port is the master half and is assumed to be the left half. The slave side is the right half
229 230
diff --git a/docs/feature_split_keyboard.md b/docs/feature_split_keyboard.md
index 60e0d278c..42dd838d0 100644
--- a/docs/feature_split_keyboard.md
+++ b/docs/feature_split_keyboard.md
@@ -96,6 +96,8 @@ However, you'll have to flash the EEPROM files for the correct hand to each cont
96* `:avrdude-split-right` 96* `:avrdude-split-right`
97* `:dfu-split-left` 97* `:dfu-split-left`
98* `:dfu-split-right` 98* `:dfu-split-right`
99* `:dfu-util-split-left`
100* `:dfu-util-split-right`
99 101
100This setting is not changed when re-initializing the EEPROM using the `EEP_RST` key, or using the `eeconfig_init()` function. However, if you reset the EEPROM outside of the firmware's built in options (such as flashing a file that overwrites the `EEPROM`, like how the [QMK Toolbox]()'s "Reset EEPROM" button works), you'll need to re-flash the controller with the `EEPROM` files. 102This setting is not changed when re-initializing the EEPROM using the `EEP_RST` key, or using the `eeconfig_init()` function. However, if you reset the EEPROM outside of the firmware's built in options (such as flashing a file that overwrites the `EEPROM`, like how the [QMK Toolbox]()'s "Reset EEPROM" button works), you'll need to re-flash the controller with the `EEPROM` files.
101 103
diff --git a/docs/flashing.md b/docs/flashing.md
index 00350b840..18ae6364d 100644
--- a/docs/flashing.md
+++ b/docs/flashing.md
@@ -232,4 +232,6 @@ Flashing sequence:
232There are a number of DFU commands that you can use to flash firmware to a STM32 device: 232There are a number of DFU commands that you can use to flash firmware to a STM32 device:
233 233
234* `:dfu-util` - The default command for flashing to STM32 devices. 234* `:dfu-util` - The default command for flashing to STM32 devices.
235* `:st-link-cli` - This allows you to flash the firmware via ST-LINK's CLI utility, rather than dfu-util. 235* `:dfu-util-split-left` - This flashes the normal firmware, just like the default option (`:dfu-util`). However, this also configures the "Left Side" EEPROM setting for split keyboards.
236* `:dfu-util-split-right` - This flashes the normal firmware, just like the default option (`:dfu-util`). However, this also configures the "Right Side" EEPROM setting for split keyboards.
237* `:st-link-cli` - This allows you to flash the firmware via ST-LINK's CLI utility, rather than dfu-util.
diff --git a/docs/newbs_flashing.md b/docs/newbs_flashing.md
index 3bf582d7f..4fb2f91d5 100644
--- a/docs/newbs_flashing.md
+++ b/docs/newbs_flashing.md
@@ -215,7 +215,7 @@ Additionally, if you want to flash multiple boards, use the following command:
215When you're done flashing boards, you'll need to hit Ctrl + C or whatever the correct keystroke is for your operating system to break the loop. 215When you're done flashing boards, you'll need to hit Ctrl + C or whatever the correct keystroke is for your operating system to break the loop.
216 216
217 217
218## HalfKay 218### HalfKay
219 219
220For the PJRC devices (Teensy's), when you're ready to compile and flash your firmware, open up your terminal window and run the build command: 220For the PJRC devices (Teensy's), when you're ready to compile and flash your firmware, open up your terminal window and run the build command:
221 221
@@ -248,7 +248,7 @@ Programming.....................................................................
248Booting 248Booting
249``` 249```
250 250
251## BootloadHID 251### BootloadHID
252 252
253For Bootmapper Client(BMC)/bootloadHID/ATmega32A based boards, when you're ready to compile and flash your firmware, open up your terminal window and run the build command: 253For Bootmapper Client(BMC)/bootloadHID/ATmega32A based boards, when you're ready to compile and flash your firmware, open up your terminal window and run the build command:
254 254
@@ -284,7 +284,7 @@ Uploading 22016 (0x5600) bytes starting at 0 (0x0)
2840x05580 ... 0x05600 2840x05580 ... 0x05600
285``` 285```
286 286
287## STM32 (ARM) 287### STM32 (ARM)
288 288
289For a majority of ARM boards (including the Proton C, Planck Rev 6, and Preonic Rev 3), when you're ready to compile and flash your firmware, open up your terminal window and run the build command: 289For a majority of ARM boards (including the Proton C, Planck Rev 6, and Preonic Rev 3), when you're ready to compile and flash your firmware, open up your terminal window and run the build command:
290 290
@@ -334,6 +334,16 @@ File downloaded successfully
334Transitioning to dfuMANIFEST state 334Transitioning to dfuMANIFEST state
335``` 335```
336 336
337#### STM32 Commands
338
339There are a number of DFU commands that you can use to flash firmware to a STM32 device:
340
341* `:dfu-util` - The default command for flashing to STM32 devices.
342* `:dfu-util-wait` - This works like the default command, but it gives you a (configurable) 10 second timeout before it attempts to flash the firmware. You can use `TIME_DELAY=20` from the command line to change the timeout.
343 * Eg: `make <keyboard>:<keymap>:dfu-util TIME_DELAY=5`
344* `:dfu-util-split-left` - This flashes the normal firmware, just like the default option (`:dfu-util`). However, this also configures the "Left Side" EEPROM setting for split keyboards.
345* `:dfu-util-split-right` - This flashes the normal firmware, just like the default option (`:dfu-util`). However, this also configures the "Right Side" EEPROM setting for split keyboards.
346
337## Test It Out! 347## Test It Out!
338 348
339Congrats! Your custom firmware has been programmed to your keyboard! 349Congrats! Your custom firmware has been programmed to your keyboard!
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index c25e28707..62e156187 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -248,6 +248,21 @@ dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter
248# Legacy alias 248# Legacy alias
249dfu-util-wait: dfu-util 249dfu-util-wait: dfu-util
250 250
251# TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS
252# within the emulated eeprom via dfu-util or another tool
253ifneq (,$(filter $(MAKECMDGOALS),dfu-util-split-left))
254 OPT_DEFS += -DINIT_EE_HANDS_LEFT
255endif
256
257ifneq (,$(filter $(MAKECMDGOALS),dfu-util-split-right))
258 OPT_DEFS += -DINIT_EE_HANDS_RIGHT
259endif
260
261dfu-util-split-left: dfu-util
262
263dfu-util-split-right: dfu-util
264
265
251st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter 266st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter
252 $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst 267 $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst
253 268
diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c
index 933ac42bd..4cf4ca3ac 100644
--- a/tmk_core/common/eeconfig.c
+++ b/tmk_core/common/eeconfig.c
@@ -48,6 +48,16 @@ void eeconfig_init_quantum(void) {
48 eeprom_update_dword(EECONFIG_RGB_MATRIX, 0); 48 eeprom_update_dword(EECONFIG_RGB_MATRIX, 0);
49 eeprom_update_byte(EECONFIG_RGB_MATRIX_SPEED, 0); 49 eeprom_update_byte(EECONFIG_RGB_MATRIX_SPEED, 0);
50 50
51 // TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS
52 // within the emulated eeprom via dfu-util or another tool
53#if defined INIT_EE_HANDS_LEFT
54 #pragma message "Faking EE_HANDS for left hand"
55 eeprom_update_byte(EECONFIG_HANDEDNESS, 1);
56#elif defined INIT_EE_HANDS_RIGHT
57 #pragma message "Faking EE_HANDS for right hand"
58 eeprom_update_byte(EECONFIG_HANDEDNESS, 0);
59#endif
60
51 eeconfig_init_kb(); 61 eeconfig_init_kb();
52} 62}
53 63