You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
4.3 KiB

  1. # Xiaomi Yuemi Pro MK02
  2. A tenkeyless keyboard sold under Xiaomi brand. It uses an STM32F072C8T6 microcontroller and can be flashed with QMK.
  3. LED backlight is currently not supported.
  4. * Keyboard Maintainer: [@xyzz](https://github.com/xyzz)
  5. * Hardware Supported: Xiaomi Yuemi Pro MK02
  6. * Hardware Availability: Aliexpress
  7. Make example for this keyboard (after setting up your build environment):
  8. make xiaomi/mk02:default
  9. See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
  10. ## Installation
  11. Please understand that following these steps will void your warranty and might irrecoverably damage your keyboard.
  12. ### Installing the bootloader
  13. You only need to do this step once (unless you destroy your user bootloader which is not possible so long as you follow these steps correctly).
  14. Unplug the keyboard. Disassemble the keyboard and look at the area around the MCU. Make sure your keyboard looks the same as in the picture and that the chip says STM32F072C8T6 on it:
  15. ![mcu](https://i.imgur.com/HM8tUWU.jpg)
  16. Using a piece of wire, connect TP28 (indicated in red) and 3v3 (square pad indicated in green) together with tweezers or a piece of wire. Make sure to not touch the case with your wire when shorting!!! Don't push it all the way through the hole.
  17. Plug the keyboard in with the wire connected. You should see the following device appear:
  18. ```
  19. [5067851.560317] usb 2-1.5.3.1: new full-speed USB device number 6 using ehci-pci
  20. [5067851.670006] usb 2-1.5.3.1: New USB device found, idVendor=0483, idProduct=df11, bcdDevice=22.00
  21. [5067851.670010] usb 2-1.5.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  22. [5067851.670013] usb 2-1.5.3.1: Product: STM32 BOOTLOADER
  23. [5067851.670015] usb 2-1.5.3.1: Manufacturer: STMicroelectronics
  24. [5067851.670017] usb 2-1.5.3.1: SerialNumber: FFFFFFFEFFFF
  25. ```
  26. If you don't see this, you did something wrong. Disconnect the keyboard and try again.
  27. If you do see this, remove the wire before continuing.
  28. Make a backup of internal flash memory in case you'd like to revert to the original firmware in the future:
  29. ```
  30. dfu-util -d 0483:df11 -a 0 -s 0x08000000 -U flash-backup.bin
  31. ```
  32. Ensure the dumped flash is correct:
  33. ```
  34. strings flash.bin | grep KB
  35. ```
  36. (You should see 2 entries of "USB KB")
  37. Finally, flash the bootloader ([jumploader-xiaomi_mk02-padded.bin](https://github.com/xyzz/stm32f072-keyboard-jumploader/releases/download/r1/jumploader-xiaomi_mk02-padded.bin)) with:
  38. ```
  39. dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D jumploader-xiaomi_mk02-padded.bin
  40. ```
  41. At this point the keyboard should reboot into bootloader mode; if it doesn't, wait a couple seconds and replug the USB cable.
  42. ### Installing the firmware
  43. To install QMK, first boot into bootloader mode as detailed below. When the keyboard boots in bootloader mode, you should see the following device:
  44. ```
  45. [5067851.560317] usb 2-1.5.3.1: new full-speed USB device number 6 using ehci-pci
  46. [5067851.670006] usb 2-1.5.3.1: New USB device found, idVendor=0483, idProduct=df11, bcdDevice=22.00
  47. [5067851.670010] usb 2-1.5.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  48. [5067851.670013] usb 2-1.5.3.1: Product: STM32 BOOTLOADER
  49. [5067851.670015] usb 2-1.5.3.1: Manufacturer: STMicroelectronics
  50. [5067851.670017] usb 2-1.5.3.1: SerialNumber: FFFFFFFEFFFF
  51. ```
  52. Flash the keyboard normally by executing:
  53. ```
  54. make xiaomi/mk02:default:flash
  55. ```
  56. Warning! If you flash the firmware manually by using `dfu-util`, make sure to use the following arguments:
  57. ```
  58. -d 0483:df11 -a 0 -s 0x08002000:leave
  59. ```
  60. If you don't, you'll blow away the user bootloader and will have to repeat the installation steps.
  61. ## Booting into bootloader
  62. To boot into bootloader, do either of the following:
  63. - map a RESET key in your keymap and tap it, or
  64. - hold spacebar while plugging in the keyboard.
  65. If neither of these work, you must have blown away the user bootloader somehow and will need to repeat the installation guide from the first step.
  66. ## Restoring the original firmware
  67. If you wish to restore the original firmware, boot into the bootloader and then execute:
  68. ```
  69. dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D flash-backup.bin
  70. ```