commit 7e734836ac85d835b9caca36b69bd5c37cbe7af5
parent 4ecf2eab60f79b169aa75e21353fc400c7e1f82e
Author: minute <lukas@mntre.com>
Date: Fri, 24 Nov 2023 22:18:03 +0000
Merge branch 'keyboard-fw-flash.sh' into 'master'
reform2-keyboard-fw/flash.sh: add more detailed instructions
See merge request reform/reform!59
Diffstat:
3 files changed, 35 insertions(+), 17 deletions(-)
diff --git a/reform2-keyboard-fw/constants.h b/reform2-keyboard-fw/constants.h
@@ -22,7 +22,7 @@
#endif
// allow overriding KBD_FW_VERSION by not touching it if it's already set
#ifndef KBD_FW_VERSION
-# define KBD_FW_VERSION "20230703"
+# define KBD_FW_VERSION "20231124"
#endif
// set KBD_FW_REV according to variant 2 or 3
#ifdef KBD_VARIANT_3
diff --git a/reform2-keyboard-fw/flash.sh b/reform2-keyboard-fw/flash.sh
@@ -48,17 +48,36 @@ devnum_keyboard=
if [ -n "$path_keyboard" ] && [ -e "$path_keyboard" ]; then
busnum_keyboard="$(udevadm info --query=property --property=BUSNUM --value "$path_keyboard")"
devnum_keyboard="$(udevadm info --query=property --property=DEVNUM --value "$path_keyboard")"
+ echo " 1. Find out your keyboard firmware version in the 'System Status' by pressing" >&2
+ echo " the circle key followed by the S key. The keyboard firmware version is on" >&2
+ echo " on the last line in a date-based format YYYYMMDD. Then either:"
echo >&2
- echo "Press the circle key followed by the X key to enter firmware update mode." >&2
+ echo " 2.A. If you are on keyboard firmware version 20231124 or newer:" >&2
echo >&2
- echo "If you have an old version of the keyboard firmware, you might need to:" >&2
- echo "- Toggle the programming DIP switch SW84 on the keyboard to “ON”." >&2
- echo "- Then press the reset button SW83." >&2
+ echo " 2.A.1. Press the circle key followed by the X key to enter firmware update mode." >&2
echo >&2
- echo "Waiting for the keyboard to disappear..." >&2
- udevadm wait --removed "$path_keyboard"
- echo "Waiting for the Atmel DFU bootloader USB device to appear..." >&2
- udevadm wait --settle "$path_keyboard"
+ echo " 2.B. If you are on keyboard firmware version older than 20231124:" >&2
+ echo >&2
+ echo " 2.B.1. Toggle the programming DIP switch SW84 on the keyboard to “ON”." >&2
+ echo " 2.B.2. Press the reset button SW83." >&2
+ echo >&2
+ echo " ATTENTION: Do not remove the keyboard bezel without having disconnected" >&2
+ echo " both battery boards first. If you don't want to remove the" >&2
+ echo " bezel you can reach both the programming DIP switch as well" >&2
+ echo " as the reset button with a non-conductive thin stick (like" >&2
+ echo " a wooden toothpick) behind the F4 key." >&2
+ echo >&2
+ if [ "$(udevadm --version)" -lt 251 ]; then
+ # no udevadm wait before version 251
+ echo " 3. Press the Enter key once you are ready" >&2
+ # shellcheck disable=SC2034
+ read -r enter
+ else
+ echo " 3. Waiting for the keyboard to disappear..." >&2
+ udevadm wait --removed "$path_keyboard"
+ echo " 4. Waiting for the Atmel DFU bootloader USB device to appear..." >&2
+ udevadm wait --settle "$path_keyboard"
+ fi
fi
path=$(find_usb_device 03eb 2ff4 ATm32U4DFU)
@@ -96,13 +115,12 @@ dfu-programmer "$device" flash ./keyboard.hex --suppress-bootloader-mem
dfu-programmer "$device" start
-echo "Waiting for the Atmel DFU bootloader USB device to disappear..." >&2
-
-udevadm wait --removed "$path"
-
-echo "Waiting for the keyboard to re-appear..." >&2
-
-udevadm wait --settle "$path"
+if [ "$(udevadm --version)" -ge 251 ]; then
+ echo "Waiting for the Atmel DFU bootloader USB device to disappear..." >&2
+ udevadm wait --removed "$path"
+ echo "Waiting for the keyboard to re-appear..." >&2
+ udevadm wait --settle "$path"
+fi
echo "All done!" >&2
echo >&2
diff --git a/reform2-lpc-fw/src/boards/reform2/board_reform2.c b/reform2-lpc-fw/src/boards/reform2/board_reform2.c
@@ -65,7 +65,7 @@
# define FW_STRING2 "25_R2"
#endif
#ifndef FW_STRING3
-# define FW_STRING3 "20230703"
+# define FW_STRING3 "20231124"
#endif
#define FW_REV FW_STRING1 FW_STRING2 FW_STRING3