Repository navigation
Firmware for HHKB Professional Classic and Hybrid keyboards running on the original STM32L072 controller. No controller replacement, soldering, or keyboard disassembly is required for normal installation.
This release extends the Classic firmware to Hybrid, Hybrid Type-S, and supported JIS variants, with Bluetooth profiles, battery power management, and local firmware packaging.
Supported Keyboards
- HHKB Professional Classic: ANSI.
- HHKB Professional Classic Type-S: ANSI and JIS.
- HHKB Professional Hybrid: ANSI and JIS.
- HHKB Professional Hybrid Type-S: ANSI and JIS.
Hybrid and Hybrid Type-S use the same firmware for a given layout. ANSI and JIS require different binaries. HHKB Studio and Professional 2 are not supported by these firmware images.
Important: Installation and Calibration
Classic models use ready-to-flash .hfb files. Hybrid requires local packaging: download the matching official HHKB firmware and replace its STM32 application with the DMK .bin using the HTML patcher or Python tool. The original Nordic Bluetooth firmware is preserved.
Patched Hybrid containers contain proprietary manufacturer code and are not distributed with DMK. Original firmware must be obtained from the official HHKB download pages; JIS downloads are available from the Japanese download page.
Use the new shared via.json from this release. The board is now named HHKB Professional, and the source directory has moved from keyboards/hhkb_classic/ to keyboards/hhkb/.
Perform a full custom calibration after flashing. Release all keys before starting, press each key fully, then release all keys before selecting Finish and save. During calibration, physical presses remain visible in Key Tester → Test Matrix, while normal typing and keymap actions are suppressed.
Installation guide · VIA and calibration guide
Headline Highlights
- Hybrid Bluetooth support using the original Nordic firmware, including four saved profiles, pairing, profile cycling, and USB/Bluetooth switching.
- Stock-style battery operation with a 4 MHz CPU clock, low-power ADC configuration, and ordinary OFF measured at 0.21 mA on the tester's keyboard.
- USB matrix scanning remains configurable up to 1000 Hz; battery scanning follows the stock-style 11 ms period (about 91–92 Hz), independently of Bluetooth report timing.
- Optional matrix-wake sleep with a configurable 1–10 Hz scan rate and a separate sleep-to-OFF timer.
- JIS support with a 69-key matrix and separate persistent storage geometry.
- A standalone local HTML tool for Hybrid patching and HFB flashing, with model and firmware compatibility checks.
- Calibration, EEPROM, recovery, and wake reliability fixes.
What's Changed
Hybrid Bluetooth and Power Management
- Added the SPI transport to the factory Nordic Bluetooth controller, four pairing slots, and persistent selection of the last Bluetooth profile.
- Added custom keycodes for profile selection, pairing, profile cycling, USB/Bluetooth switching, battery display, sleep, and power-off.
- Added configurable short and long PC5 power-button actions through VIA.
- Ordinary battery OFF requests Nordic idle, disables the analog matrix circuitry, and enters STM32 STOP without holding PD2 high. Holding PC5 for about one second and releasing resumes without resetting STM32. A ten-second hold cancels startup.
- Fixed missing keyboard input after OFF/on: the resume path now restores the Nordic keyboard packet type after clearing the report buffer.
- Disabled unused USB and clock peripherals on battery and matched the stock-style CPU and ADC clock configuration. Active battery scanning uses a fixed 11 ms target period, independently of VIA's USB scan-rate setting.
- Added an independent battery ADC oversampling setting, disabled by default.
- Added battery-level display and low-battery, pairing, and active-profile LED options. Battery percentages represent discrete hardware thresholds rather than a continuous charge estimate.
- Added critical-battery handling: an orange warning followed by deep STOP after 180 seconds or a two-second PC5 hold. This safety path wakes only on USB insertion and resets STM32.
Configurable Sleep
- With Wake with matrix disabled, an inactivity timeout or sleep action enters OFF directly.
- With matrix wake enabled, sleep blanks the LEDs and powers down the sensor circuitry between probes. VIA offers 1–10 Hz in 1 Hz steps, with 1 Hz as the default.
- Power off after sleep configures the battery sleep-to-OFF timeout; the default is three minutes, and zero disables the transition.
- The sleep scan-rate and sleep-to-OFF controls are hidden when matrix wake is disabled. Their saved values are retained.
- Sleep settings are stored in EEPROM and restored after a power cycle. PC5 control remains available independently of matrix wake.
On one Hybrid at 3.0 V, the tester measured 0.21 mA in OFF, 1.44 mA in sleep at 1 Hz, and 1.68 mA at 10 Hz. Fn-layer typing measured 3.5 mA with the indicator off and 5.8 mA with it on; stock has no Fn-layer indicator. These are measurements of one keyboard, not guaranteed values for every unit.
JIS, VIA, and Persistent Settings
- Added the fifth matrix row on PB11 and the 69-key JIS layout for Classic Type-S and Hybrid variants. ANSI builds continue scanning only their four physical rows.
- Unified the VIA and Vial definitions under HHKB Professional, with ANSI/JIS layout selection and Hybrid-only custom controls.
- Fixed JIS settings being saved only once and the settings reset failing to erase the JIS record.
- Prevented JIS builds from interpreting older ANSI calibration records with the wrong matrix geometry.
- Added EEPROM write-error and readback checks, with failed writes scheduled for retry.
- Fixed persistence of all debug toggles and corrected calibration progress reporting.
Custom controls require the VIA web app. Enable Settings → Show Design tab, then use Design → Load Draft Definition to load via.json. Vial supports keymap editing but does not expose the custom calibration and power controls.
Calibration and Recovery Reliability
- Kept calibrated baseline and peak values fixed outside an explicit calibration session, preventing runtime ADC spikes from permanently expanding a key's range.
- Kept the 16-sample baseline average; a timed-out ADC conversion restarts baseline capture rather than biasing the result.
- Prevented stale ADC register values from being used as valid measurements after a timeout.
- Added stable SW6 sampling before the Bank 1 recovery operation and verification of the erased vector page.
- Bounded VIA status strings and corrected a missing calibration-log argument.
Firmware Tools and Build Outputs
- Added
tools/hhkb/hhkb.html: a local Hybrid patcher and WebHID flasher. Patching works without Python; browser flashing still requires hardware validation. - Added model/layout identity checks for DMK binaries, original firmware templates, and connected update targets.
- Updated the Python flasher for supported Classic and Hybrid models, including JIS.
- Standardized final DMK HFB versions at A4.50, A8.50, A9.50, A0.50, and A2.50. These PFU-compatible container versions are separate from the DMK CalVer/git version displayed in VIA.
- CI builds Classic HFB packages and Hybrid STM32 binaries for ANSI and JIS. Hybrid users package their HFB locally; no original or patched manufacturer binaries are committed to the repository.
The Firmware Version field in VIA / Debug reports 2026.11.22 in these release binaries. PFU HFB version fields remain at their model-specific .50 values.
Firmware Packages
dmk-hhkb-classic-classic-via.hfb: Classic ANSI, AHHX01 / A4.50.dmk-hhkb-classic-type-s-via.hfb: Classic Type-S ANSI, AHHS01 / A8.50.dmk-hhkb-classic-type-s-jis-via.hfb: Classic Type-S JIS, AHKS01 / A9.50.dmk-hhkb-hybrid-ansi.bin: Hybrid / Hybrid Type-S ANSI, for local packaging.dmk-hhkb-hybrid-jis.bin: Hybrid / Hybrid Type-S JIS, for local packaging.hhkb.html: local patching and browser flashing tool.via.json: shared VIA definition.
Documentation
- Installation and local Hybrid patching
- Backup and restore
- Build options and HFB formats
- VIA controls, calibration, and diagnostics
- Supported models
- Russian documentation
Acknowledgements
Special thanks to SuperEnduro for extensive Hybrid testing, current measurements, reverse-engineering assistance, and tracking down the Nordic packet-type bug after wake. Their repeated hardware checks helped bring Bluetooth, pairing, power-button behaviour, and battery consumption to the current state.
Thanks also to guyguilty for testing the Classic.
HTML flasher update — 22 November 2026
The hhkb.html download now recognizes anniversary model suffixes such as PD-KB800YSC and PD-KB800YSC1, with equivalent handling across all five supported HFB families. Classic/Type-S and ANSI/JIS compatibility checks remain enforced. Download the updated HTML file if the previous version rejected a compatible target. Firmware assets are unchanged.