logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

readme.md (4128B)


  1. # HHKB Alternate Controller (YANG HHKB BLE Mod)
  2. ![YANG HHKB BLE Mod](https://i.imgur.com/aZP1GYc.jpeg)
  3. An alternative controler for the HHKB designed by YANG (yangdigi)
  4. based on the hasu controller.
  5. * Keyboard Maintainer: [Kan-Ru Chen](https://github.com/kanru)
  6. * Hardware Supported: YANG HHKB BLE Controller
  7. * Hardware Availability: https://kbdfans.com/products/hhkb-ble-mod-upgrade-module
  8. Make example for this keyboard (after setting up your build environment):
  9. make hhkb/yang:default
  10. To flash, first boot your keyboard into bootloader (hold ESC and attach usb cable)
  11. then a virtual USB storage should appear. You can copy the `hhkb_yang_default.bin`
  12. file to the virtual USB storage and override the `HHKB_BLE.BIN` file in there.
  13. Make sure to unmount and eject the virtual USB storage.
  14. ## Features:
  15. - [x] QMK (via USB)
  16. - [x] Bluetooth (BLE)
  17. - [x] Power saving mode
  18. - [x] Idle mode
  19. - [x] Deep sleep mode
  20. - [x] LEDs
  21. - [x] Battery service
  22. - [x] Special commands
  23. - [x] Switch BT peer
  24. ## Entering flash mode
  25. Different ways to enter flash mode:
  26. * Press and hold the ESC key. Insert the USB cable to enter the flash
  27. mode. When the OS shows the drive disk, you can release the key.
  28. * Use the magic command LSHIFT+RSHIFT+B to reboot to bootloader then
  29. quickly hold the ESC key.
  30. If you reflash the wrong firmware or did not reflash successfully, you
  31. can no longer enter the flash mode, especially the wireless keyboard
  32. with battery. You need to turn off the keyboard's power switch, and
  33. re-enter the flash mode, reflash the correct firmware.
  34. After entering the bootloader(flash mode), three indicators on the top
  35. right of the HHKB BLE controller will flash. LED3(green) will flash
  36. quickly when writing firmware to the controller.
  37. If these three leds are not soldered or your hhkb case is black, you
  38. can't know their status, but you can still see LED3 under the right
  39. USB port.
  40. ## How to reliably flash LUFA MassStorage bootloader on Linux
  41. The FAT filesystem on Linux very often cannot flush the write cache,
  42. leading to broken firmware in the flash.
  43. We can use `dd` to write to the virtual block storage directly to
  44. bypass the vfs layer.
  45. ```
  46. dd if=FLASH.bin of=<path of virtual block device> seek=4
  47. ```
  48. Skip 4 sectors because the default sector size of the virtual device
  49. and dd is 512 bytes and the emulated flash file starts at 5th sector.
  50. ## How to find the path of the virtual block device
  51. After the keyboard boots into flash mode, on Linux system you should
  52. be able to find the block device in `dmesg` logs.
  53. For exmaple if you type
  54. ```
  55. sudo dmesg
  56. ```
  57. You should find something like
  58. ```
  59. [357885.143593] usb 1-1.4: USB disconnect, device number 24
  60. [357885.627740] usb 1-1.4: new full-speed USB device number 25 using xhci_hcd
  61. [357885.729486] usb 1-1.4: New USB device found, idVendor=03eb, idProduct=1962, bcdDevice= 0.01
  62. [357885.729492] usb 1-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
  63. [357885.745620] SCSI subsystem initialized
  64. [357885.746712] usb-storage 1-1.4:1.0: USB Mass Storage device detected
  65. [357885.746818] scsi host0: usb-storage 1-1.4:1.0
  66. [357885.746919] usbcore: registered new interface driver usb-storage
  67. [357885.747689] usbcore: registered new interface driver uas
  68. [357886.766755] scsi 0:0:0:0: Direct-Access LUFA Bootloader 0.00 PQ: 0 ANSI: 0
  69. [357886.773216] scsi 0:0:0:0: Attached scsi generic sg0 type 0
  70. [357886.777474] sd 0:0:0:0: [sdx] 134 512-byte logical blocks: (68.6 kB/67.0 KiB)
  71. [357886.780300] sd 0:0:0:0: [sdx] Write Protect is off
  72. [357886.780302] sd 0:0:0:0: [sdx] Mode Sense: 00 00 00 00
  73. [357886.783113] sd 0:0:0:0: [sdx] Asking for cache data failed
  74. [357886.783114] sd 0:0:0:0: [sdx] Assuming drive cache: write through
  75. [357886.842676] sdx:
  76. [357886.859528] sd 0:0:0:0: [sdx] Attached SCSI removable disk
  77. ```
  78. The `sdx` is the block device name and the full path is at `/dev/sdx`
  79. The above flash command will become
  80. ```
  81. dd if=FLASH.bin of=/dev/sdx seek=4
  82. ```
  83. **Caution**: if set to incorrect device it may wipe out
  84. your actual disk.
  85. ## Help page of original firmware
  86. http://help.ydkb.io/doku.php?id=en:kb-mods:hhkb-ble