Skip to content

Releases

HHKB Classic Nightly — 2026.11.16

Pre-release

Choose a tag to compare

@aroum aroum released this 16 Nov 19:41

Pre-release nightly build for HHKB Professional Classic (PD-KB401*, AHHX01) and Classic Type-S (PD-KB401*SC, AHHS01) running on the stock STM32L072 microcontroller. No hardware modifications or controller replacements are required.

Headline: Travel Calibration, Curve Modeling & Complete VIA Diagnostic Suite

This release introduces per-key physical travel curve calibration with PCHIP spline interpolation, extended factory reset safety controls, unified HID console diagnostics, and deep VIA configuration integration.

  • 5-Point Monotonic Travel Calibration: Accurate physical travel modeling from 0.0 mm up to the user-configured max bottom-out depth (3.1–4.5 mm, default 4.0 mm) using PCHIP (Piecewise Cubic Hermite Interpolating Polynomial) spline interpolation with zero overshoot or non-monotonic oscillation.
  • Actuation Clamping & Safety Bounds: Strict firmware-level clamping guarantees actuation points and Rapid Trigger sensitivities can never exceed calibrated bottom-out depth.
  • Guarded Factory Reset in VIA: Added dedicated EEPROM reset menu with two-step safety confirmation toggle and hardware DIP SW6 protection against accidental wipes.
  • Standardized HID Console Diagnostics: Unified reporting across all debugging channels with structured key coordinates, raw ADC readings, floating baseline, and travel percentages.

What's Changed

Calibration & Travel Curve Modeling

  • 5-Point Calibration Curve:
    • Modeled key travel using 5 control points: 0% (0.0 mm baseline), 25%, 50%, 75%, and 100% of the user-configured bottom-out depth (3.1–4.5 mm).
    • Implemented monotonic cubic spline interpolation (PCHIP) evaluated into a 126-entry lookup table mapping ADC delta directly to travel depth.
    • Added interactive visualizer utility (tools/ec_curve_visualizer.py, executable via uv run tools/ec_curve_visualizer.py) for inspecting individual dome curves.
  • Dynamic Baseline & Temperature Compensation:
    • Documented and refined baseline tracker: moving average over 16 non-actuated samples with slow continuous background drift tracking.
  • Actuation Point Bounds Checking:
    • Enforced strict hardware clamping: act_pm, press_pm, and release_pm are automatically bounded by curve[125] (maximum physical bottom-out travel), preventing dead-zone key states.

VIA Controls & Settings Storage

  • Guarded Factory Reset Submenu:
    • Added dedicated reset action with a two-step confirmation toggle (Confirm Reset) directly in the VIA custom menu.
    • Implemented hardware interlock: factory reset via VIA is blocked unless DIP switch SW6 is set to ON, preventing accidental wiping during standard usage.
  • Calibrated EEPROM Storage:
    • Hardened EEPROM magic storage guards to persist customized key calibration baselines and peaks reliably across firmware updates.
    • Maintained backward compatibility with legacy keymap structures.
  • Dynamic Status Label Refresh:
    • Documented WebHID / VIA v3 menu limitations: dynamic status indicators (such as calibration completion) require selecting another submenu or reloading the tab to poll fresh values.
  • Status Indicator Naming:
    • Standardized LED indicator naming in VIA definitions (Blue and Orange LEDs).

HID Console Diagnostics

  • Standardized EC Matrix Streaming:
    • Unified matrix debug stream format across diagnostic tools:
      [EC] R<row> C<col> : raw=<raw> base=<base> peak=<peak> travel=<norm/10>% <DN|UP>
  • Enhanced Calibration Progress Monitoring:
    • Real-time ASCII progress bar and percentage completion reporting for all 60 keys:
      [CAL] [====> ] 45% (27/60) | Key R1 C3 peak: 2840 (base: 1120)
  • Channel Documentation:
    • Documented all active console channels ([EC], [CAL], [RATE], [VIA_DIAG], [BOOT]) in via.md.

Build System & Documentation

  • Toolchain & Build Automation:
    • build_all.sh now automatically detects and uses locally built picotool from CMake dependencies with fallback to system binaries (#3).
    • Added build target directory ignores for local development hygiene.
  • Documentation Overhaul:
    • Integrated complete VIA, HID console debugging, and calibration guides into keyboards/hhkb_classic/docs/via.md (both Russian and English versions).
    • Documented hardware research notes and model matrix references for HHKB Hybrid and Studio controllers.

Included Assets

  • dmk-hhkb-classic-classic-via.hfb: Firmware for HHKB Professional Classic (Model AHHX01, HFB version A4.50).
  • dmk-hhkb-classic-type-s-via.hfb: Firmware for HHKB Professional Classic Type-S (Model AHHS01, HFB version A8.50).
  • via.json: Complete VIA v3 draft definition containing layout definitions, custom Topre/EC settings, calibration controls, and debug toggles.

Installation & Documentation

HHKB Classic Nightly — 2026.11.15

Pre-release

Choose a tag to compare

@aroum aroum released this 15 Nov 07:24

Pre-release nightly build for HHKB Professional Classic (PD-KB401*, AHHX01) and Classic Type-S (PD-KB401*SC, AHHS01) running on the stock STM32L072 microcontroller. No hardware modifications or controller replacements are required.

Headline: Full 1000 Hz Matrix Scan Rate Achieved

The matrix scanning engine has been comprehensively optimized to achieve a sustained, monolithic 1000 Hz (1 ms) scan rate without altering analog discharge times, row strobe delays, or Rapid Trigger precision.

  • Scan Time Reduction: Raw scan execution time dropped from 1094 µs to 835 µs (-24%, saving ~259 µs per pass).
  • Guaranteed Timing Headroom: Full work cycle completes in ~841–875 µs, leaving a solid 125–159 µs (>12%) margin under the 1000 µs deadline.
  • Zero Missed Deadlines: Sustained 1000 Hz polling with miss = 0 during continuous operation.
  • USB Task Starvation Protection: Restored non-blocking overdue timer notification drop mechanism (ulTaskNotifyTake(pdTRUE, 0)) to ensure the lower-priority FreeRTOS USB task is never starved of CPU time.

What's Changed

Topre Matrix & Hot-Path Optimizations

  • Cumulative 260 µs Latency Reduction:
    • Raw scan time reduced from 1094 µs to 835 µs (-24%), unlocking a true 1000 Hz polling rate with ~125–159 µs of idle headroom per millisecond.
  • Outer Loop Array Caching:
    • Eliminated 120 getter calls (hhkb_get_cal_peak() and hhkb_get_rt_key()) per scan pass by caching column pointers at the column loop level.
    • Hoisted hhkb_get_debug_flag(DEBUG_FLAG_TOPRE) evaluation completely out of the 60-key loop (evaluated once per pass instead of 60 times).
  • Native PRIMASK Critical Sections:
    • Replaced FreeRTOS taskENTER_CRITICAL() and taskEXIT_CRITICAL() inside the RAM-resident scan loop (.RamFunc) with atomic __get_PRIMASK() / __disable_irq() / __set_PRIMASK().
    • Completely eliminated 120 Flash-veneer jumps (__vPortEnterCritical_veneer / __vPortExitCritical_veneer) between RAM and Flash per pass, executing in 1–2 CPU cycles directly in RAM.

USB & HID Console Diagnostics

  • Debug Console Formatting & Buffer Expansion:
    • Expanded debug_console_printf buffer from 96 to 128 bytes and the console ring buffer from 192 to 256 bytes.
    • Resolved diagnostic line truncation that previously stripped trailing carriage return / line feed sequences (\r\n), restoring clean line breaks in HID Console.
  • Production Purity & Zero Debug Overhead:
    • All debug monitoring streams (Topre matrix stream, VIA telemetry, Polling rate monitor, Calibration monitor) remain strictly disabled by default.
    • Internal scan diagnostics profiler (HHKB_SCAN_DIAGNOSTICS) disabled by default in release configuration for maximum efficiency.

Included Assets

  • dmk-hhkb-classic-classic-via.hfb: Firmware for HHKB Professional Classic (Model AHHX01, HFB version A4.50).
  • dmk-hhkb-classic-type-s-via.hfb: Firmware for HHKB Professional Classic Type-S (Model AHHS01, HFB version A8.50).
  • via.json: Complete VIA v3 draft definition containing layout definitions, custom Topre settings, calibration controls, and debug toggles.

Installation & Documentation

HHKB Classic Nightly — 2026.11.14

Pre-release

Choose a tag to compare

@aroum aroum released this 14 Nov 17:27

Pre-release nightly build for HHKB Professional Classic (PD-KB401*, AHHX01) and Classic Type-S (PD-KB401*SC, AHHS01) running on the stock STM32L072 microcontroller. No hardware modifications or controller replacements are required.

Important: Recommended Initial Key Calibration

Although the firmware comes with robust default capacitive threshold baselines, it is strongly advised to perform a full custom calibration of all 60 keys after your initial flash to adapt to your specific PCB capacitance and spring tolerances.

Step-by-step calibration instructions, live console monitoring, and visual tracking via the Key Tester (Test Matrix) tab are provided in the VIA Calibration Process Guide.

Important Notice: Scan Rate Limitation

Matrix scan rate is currently capped to a maximum of 500 Hz. The 1000 Hz scan rate mode is temporarily restricted while timing optimization, power profiling, and stability validation are being completed. Hardware ADC 4x oversampling remains fully supported and recommended at 50–500 Hz.

What's Changed

Actuation & Typing Dynamics

  • Set default actuation point to 75% key travel (~2.8 mm) with a 0.4 mm release hysteresis for typing stability out of the box.
  • Rapid Trigger is disabled by default and can be enabled via VIA when required.
  • Standardized stock baseline thresholds across builds; decoupled factory thresholds from CI.

Calibration Subsystem & Live Monitoring

  • Added real-time calibration progress monitoring to the USB HID Console: displays baseline capture, per-key peak travel registration, and a dynamic progress bar ([CAL] [====> ] X% (N/60)).
  • Added console notifications when a higher peak travel value is registered for an existing key ([CAL] Key C... R... peak updated: ... -> ...).
  • Added Calibration status indicator and Refresh status button to the VIA Calibration submenu.
  • Documented in VIA definitions and guides that custom UI labels do not poll continuously in VIA Web, and that navigating to the HID Console tab or Key Tester tab does not reset or interrupt active calibration.
  • Documented workflow to visually monitor actuated keys during calibration by switching to the Key Tester tab and enabling Test Matrix.

VIA Configuration & Key Tester Fix

  • Fixed VIA Key Tester matrix mode: corrected buffer offset and byte-endianness in the switch matrix state protocol handler (VIA_SUB_SWITCH_MATRIX_STATE) so pressed physical keys highlight the exact corresponding keys in VIA's Test Matrix mode.
  • Added dedicated Debug submenu in VIA with selective toggles:
    • Topre Matrix Stream (per-key ADC raw, permille travel, press/release events)
    • Calibration Monitor (real-time progress output)
    • Polling Rate Monitor (scan frequency reporting)
    • VIA Telemetry Diag (protocol message inspection)
  • Disabled all debug streaming channels by default to ensure minimal MCU load and zero USB overhead.
  • Fixed a VIA Web UI crash caused by cross-menu conditional visibility rules (showIf).
  • Added troubleshooting guidance for transient blank key legends on Layer 0 during initial VIA Web load.
  • Added dedicated Debug section in VIA documentation linking to the diagnostic guide.

Flasher, Protocol Verification & Hardware Documentation

  • Documented the verified PFU Raw HID firmware update protocol (0xE0, 0xE1, 0xE2, 0xE3) with 57-byte payload chunks in 64-byte HID reports.
  • Confirmed byte-for-byte fidelity of flashed Bank 2 firmware via hardware SWD readback.
  • Added documentation for hhkb_flasher.py validation flags (--skip-crc, --skip-model-check, --force).
  • Added architectural overview and model reference for ANSI and JIS Classic and Type-S variants.
  • Documented recovery procedures via SW6.

System & Memory Optimizations

  • Reduced BSS memory footprint (optimized calibration baseline accumulation buffer and console formatting buffers) to prevent RAM exhaustion on STM32L072.
  • Fixed USB Vial OUT endpoint wMaxPacketSize configuration (set to 64 bytes) to ensure proper short-packet completion.
  • Enhanced HID console synchronization to eliminate cross-key log message interleaving.

Included Assets

  • dmk-hhkb-classic-classic-via.hfb: Firmware for HHKB Professional Classic (Model AHHX01, HFB version A4.50).
  • dmk-hhkb-classic-type-s-via.hfb: Firmware for HHKB Professional Classic Type-S (Model AHHS01, HFB version A8.50).
  • via.json: Complete VIA v3 draft definition containing layout definitions, custom Topre settings, calibration controls, and debug toggles.

Installation & Documentation

HHKB Classic Custom Firmware — 2026.11.13

Choose a tag to compare

@aroum aroum released this 12 Nov 21:06

HHKB Professional Classic and Classic Type-S firmware for the original STM32L072 controller. No controller replacement or hardware modifications are required.

Features include VIA and Vial keymap support, configurable 50/125/250/500/1000 Hz matrix scanning, factory or user calibration, adjustable actuation and hysteresis, Rapid Trigger, configurable LEDs, and four layers across two systems. Hardware ADC oversampling is available at 50–500 Hz.

Choose the HFB matching your keyboard: hhkb-classic-A4.50.hfb for Classic (AHHX01) or hhkb-classic-type-s-A8.50.hfb for Classic Type-S (AHHS01). Load via.json in VIA Design to access the custom controls.

Before flashing, back up the keyboard and follow the installation guide. The Classic build has been checked on a physical board; Type-S has been compiler checked but not yet verified on a Type-S keyboard.

Both HHKB builds passed GitHub Actions run 43305956460. The overall workflow reported failure in an unrelated magneteno job.