The reform-standalone-keyboard-v4.pdf makes reference to the v4 path but there is not any instructions for the packages need it to flash it.
While exploring the Reform git repository, I found a README.md file for the reform2-keyboard-fw repository
cd ~/mnt-keyboard4/reform
git branch --show-current
echo "##############"
exa . | rg 2-keyboard
results:
master
##############
reform2-keyboard-case
reform2-keyboard-editor
reform2-keyboard-fw
reform2-keyboard-lettering
reform2-keyboard-pcb
reform2-keyboard3-pcb
reform2-keyboard4-fw
reform2-keyboard4-pcb
cd ~/mnt-keyboard4/reform
git branch --show-current
echo "##############"
batcat -p reform2-keyboard-fw/README.md
results:
master
##############
# MNT Reform 2.0 Keyboard Firmware
## Code Structure
- `constants.h`: Define which keyboard variant you want to build for
- `keyboard.c`: Main entrypoint that includes the chosen matrix file (keyboard layout)
- `matrix.h`: Keyboard layout definition (default)
- `matrix_*.h`: Alternative layouts
- `backlight.c`: Keyboard backlight control
- `menu.c`: OLED Menu handling
- `oled.c`: OLED graphics control
- `remote.c`: Communication with MNT Reform motherboard LPC
- `hid_report.c`: USB HID raw report handler (commands sent by OS)
- `powersave.c`: Low power/sleep mode
- `descriptors.c`: USB HID descriptors
- `i2c.c`: Soft I2C master implementation (for OLED)
- `serial.c`: Soft UART implementation
- `font.c`: Bitmap data for OLED font and icons
## Dependencies
### Debian/Ubuntu
apt install gcc-avr avr-libc dfu-programmer
## Hacking
To change the keyboard layout, adjust the `matrix` arrays in `keyboard.c`.
## Building
Build the firmware by running `make`. The firmware can then be found in
keyboard.hex. To build for the different layouts of the MNT Reform keyboards 2
or 3, define the `KBD_VARIANT_2` or `KBD_VARIANT_3` preprocessor variables,
respectively, using the `REFORM_KBD_OPTIONS` argument to `make`.
make REFORM_KBD_OPTIONS=-DKBD_VARIANT_2_US # default for keyboard 2.0 (US)
make REFORM_KBD_OPTIONS=-DKBD_VARIANT_2 # default for keyboard 2.0 (non-US)
make REFORM_KBD_OPTIONS=-DKBD_VARIANT_3_US # keyboard 3.0 layout (US)
make REFORM_KBD_OPTIONS=-DKBD_VARIANT_3 # keyboard 3.0 layout (non-US)
Without any options, `KBD_VARIANT_2` is the default. To build for the
standalone keyboard for, define `KBD_MODE_STANDALONE` using
`REFORM_KBD_OPTIONS` like this:
make REFORM_KBD_OPTIONS="-DKBD_VARIANT_2_US -DKBD_MODE_STANDALONE"
make REFORM_KBD_OPTIONS="-DKBD_VARIANT_2 -DKBD_MODE_STANDALONE"
make REFORM_KBD_OPTIONS="-DKBD_VARIANT_3_US -DKBD_MODE_STANDALONE"
make REFORM_KBD_OPTIONS="-DKBD_VARIANT_3 -DKBD_MODE_STANDALONE"
For keyboard 3 there is also an option to swap Ctrl- and Hyper-Keys: `KBD_SWP_CTRL`.
To flash, put your keyboard into [flashing mode](https://mntre.com/reform2/handbook/parts.html#keyboard-firmware) and run:
`sudo ./flash.sh`
cd ~/mnt-keyboard4/reform
git branch --show-current
echo "##############"
apt show gcc-avr avr-libc dfu-programmer
# apt install -y gcc-avr avr-libc dfu-programmer
results:
master
##############
Package: gcc-avr
Version: 1:5.4.0+Atmel3.6.2-3
Priority: extra
Section: universe/devel
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Hakan Ardo <hakan@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 71.9 MB
Provides: c-compiler-avr
Depends: libc6 (>= 2.34), libgmp10, libmpc3 (>= 1.1.0), libmpfr6 (>= 3.1.3), zlib1g (>= 1:1.1.4), binutils-avr (>= 2.26.20160125+Atmel3.6.2)
Suggests: gcc-doc (>= 4:4.8), gcc (>= 4:4.8), avr-libc (>= 1:2.0.0+Atmel3.6.2)
Conflicts: avr-libc (<= 1:1.7.1-2)
Download-Size: 17.2 MB
APT-Sources: http://apt.pop-os.org/ubuntu jammy/universe amd64 Packages
Description: GNU C compiler (cross compiler for avr)
This is the GNU C compiler, a fairly portable optimizing compiler which
supports multiple languages. This package includes support for C.
Package: avr-libc
Version: 1:2.0.0+Atmel3.6.2-3
Priority: extra
Section: universe/otherosfs
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Hakan Ardo <hakan@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 44.6 MB
Depends: gcc-avr (>= 5.4.0+Atmel3.6.2-1), binutils-avr (>= 2.26.20160125+Atmel3.6.2-1)
Download-Size: 4,859 kB
APT-Sources: http://apt.pop-os.org/ubuntu jammy/universe amd64 Packages
Description: Standard C library for Atmel AVR development
Standard library used to the development of C programs for the
Atmel AVR micro controllers. This package contains static
libraries as well as the header files needed.
Package: dfu-programmer
Version: 0.6.1-1build1
Priority: optional
Section: universe/devel
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Rodolphe Pelloux-Prayer <rodolphe@damsy.net>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 82.9 kB
Depends: libc6 (>= 2.7), libusb-1.0-0 (>= 2:1.0.8)
Homepage: http://dfu-programmer.sourceforge.net/
Download-Size: 30.6 kB
APT-Sources: http://apt.pop-os.org/ubuntu jammy/universe amd64 Packages
Description: device firmware update (DFU) based USB programmer for Atmel chips
A Linux based command-line programmer for Atmel chips with a USB
bootloader supporting in-system programming.
.
This is a mostly Device Firmware Update (DFU)-1.0-compliant
user-space application. This program was created because the Atmel
FLIP program for flashing devices does not run on Linux and because
standard DFU loaders do not work for Atmel chips.
cd ~/mnt-keyboard4/reform
git branch --show-current
echo "##############"
batcat -p reform2-keyboard4-fw/README.md
results:
master
##############
# MNT Reform Keyboard 4.0 Firmware
## Building
You have to pass 3 variables to `build.sh`:
- `-DKBD_MODE` can be `KBD_MODE_LAPTOP` or `KBD_MODE_STANDALONE`
- `-DKBD_VARIANT` can be `KBD_VARIANT_US` or `KBD_VARIANT_INTL` (for 102nd key instead of DEL next to left shift)
- `-DKBD_HID_FW_REV` is a string that is displayed as the revision on the OLED system status screen
Example:
./build.sh -DKBD_MODE=KBD_MODE_LAPTOP -DKBD_VARIANT=KBD_VARIANT_US -DKBD_HID_FW_REV=\"debug\"
Then I found MNT Reform Operator Handbook, 3rd Edition
Keyboard Firmware
You can update the firmware of the keyboard on MNT Reform itself, but make sure to read this section
in full to avoid ending up in a situation where you have to disassemble the laptop.
You’ll need an external USB keyboard to finish the process, as your laptop’s keyboard will stop
responding after entering firmware update mode. Otherwise, you can only recover from this mode by
opening the laptop and pressing the keyboard’s reset button or disconnecting and reconnecting the
battery or keyboard cables.
To be able to flash the firmware to the keyboard, its microcontroller has to be in this special
programming mode. Since the 3.0 revision of the Keyboard, you can put it in programming mode by
pressing the Circle key followed by the X key.
For keyboard 4.0 (with RGB backlight), execute these commands:
git clone https://source.mnt.re/reform/reform
cd reform/reform2-keyboard4-fw
./download-fw.sh laptop-us
sudo ./flash.sh
Substitute laptop-us with laptop-intl if you have a non-US keyboard layout.
For older keyboard versions (white backlight):
git clone https://source.mnt.re/reform/reform
cd reform/reform2-keyboard-fw
./download-fw.sh 3_US # or 3 if you have a
# non-US keyboard
# or 2 if you have an
# older pre-V3 keyboard
sudo ./flash.sh
You can find MNT Reform keyboard firmware sources for the current version with RGB backlight in the
source folder reform2-keyboard4-fw.
MNT Reform keyboard firmware sources for older versions of the keyboard are in the source folder
reform2-keyboard-fw.
cd ~/mnt-keyboard4/reform
git branch --show-current
echo "##############"
exa -T reform2-keyboard4-fw/
results:
master
##############
reform2-keyboard4-fw
├── bitmap-font
│ ├── lcdfont
│ ├── lcdfont.c
│ ├── reform2kbdbitmapfont.xbm
│ └── reform2kbdbitmapfont.xcf
├── build.sh
├── CMakeLists.txt
├── flash-direct.sh
├── pico_sdk_import.cmake
├── README.md
└── src
├── azoteq.c
├── azoteq.h
├── font.c
├── iqs9150.c
├── iqs9150.h
├── IQS9150_init.h
├── keyboard.h
├── main.c
├── matrix.h
├── matrix_anri.h
├── menu.c
├── menu.h
├── oled.c
├── oled.h
├── reform2kbdbitmapfont.xcf
├── remote.c
├── remote.h
├── tusb_config.h
├── usb_descriptors.c
├── usb_descriptors.h
├── usb_hid_keys.h
├── ws2812.pio
└── ws2812.pio.h
Are the following debian packages need it for the mnt-reform v4 keyboard too right ??
apt install -y gcc-avr avr-libc dfu-programmer
There isn’t a file called download-fw.sh in reform/reform2-keyboard4-fw
Is the MNT Reform Operator Handbook, 3rd Edition oudated ?
If I only want to update the firmware without changing any key yet what I should do ?
I pull recent changes from Reform / reform · GitLab
Is there any command to back up the current firmware ?
I have mnt-reform v4 keyboard standalone If I follow the mnt-reform v4 keyboard standalone README.md the command should be the following right?
./build.sh -DKBD_MODE=KBD_MODE_STANDALONE -DKBD_VARIANT=KBD_VARIANT_US - DKBD_HID_FW_REV=\"9e524c07\"