qmk_firmware/keyboards/xiaomi/mk02
James Young a03aa301de
Remove Full Bootmagic (#13846)
* disambiguate Bootmagic rules in keymaps

The files edited by this commit were added at a point in time where `BOOTMAGIC_ENABLE = yes` enabled full Bootmagic.

This commit edits the files to specify that full Bootmagic is intended.

* remove BOOTMAGIC_ENABLE=full setting

* unify commented BOOTMAGIC_ENABLE rules in keyboards

Explicitly sets `BOOTMAGIC_ENABLE = no` in keyboards where the rule was commented out.

Command:

```
find keyboards/ -type f -name 'rules.mk' -and -not -path '*/keymaps/*' -exec sed -i -e 's;#[ \t]*\(BOOTMAGIC_ENABLE\)[ \t=]\+\([a-zA-Z]\+\).*;\1 = no       # Virtual DIP switch configuration;g' {} +
```

* remove commented Bootmagic rules from keymap/user level

Command:

```
find keyboards/ layouts/ users/ -type f -name 'rules.mk' -exec sed -i -e '/#.*\(BOOTMAGIC_ENABLE\)[ \t=]\+\([a-z]\+\).*/d' {} +
```

* update keyboard BOOTMAGIC_ENABLE rule formatting

Sets the formatting of BOOTMAGIC_ENABLE rules to `BOOTMAGIC_ENABLE = [value]`, without the inline comments (which will be replaced later).

Command:

```
find keyboards/ -type f -name 'rules.mk' -and -not -path '*/keymaps/*' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE\)[ \t=]\+\([a-z]\+\).*;\1 = \2;g' '{}' +
```

* update keyboards' BOOTMAGIC_ENABLE settings

Updates keyboard `rules.mk` files to use `BOOTMAGIC_ENABLE = lite` where `BOOTMAGIC_ENABLE = full` was being used.

Command:

```
find keyboards/ -type f -name 'rules.mk' -and -not -path '*/keymaps/*' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE = \)full;\1lite;g' '{}' +
```

* update keymap/user BOOTMAGIC_ENABLE settings

Updates keymap/user `rules.mk` files to use `BOOTMAGIC_ENABLE = lite` where `BOOTMAGIC_ENABLE = full` was being used.

Commands:

```
find keyboards/ -type f -name 'rules.mk' -and -path '*/keymaps/*' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE[ \t=]\+\)full;\1lite;g' '{}' +
find layouts/community/ users/ -type f -name 'rules.mk' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE[ \t=]\+\)full;\1lite;g' '{}' +
```

* remove and replace inline comments in keyboards and keymap/user files

Removes and replaces the inline comments, which have been updated to read `Enable Bootmagic Lite`.

Commands:

```
find keyboards/ -type f -name 'rules.mk' -and -path '*/keymaps/*' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE\)[ \t=]\+\([a-z]\+\).*;\1 = \2;g' '{}' +
find layouts/community/ users/ -type f -name 'rules.mk' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE\)[ \t=]\+\([a-z]\+\).*;\1 = \2;g' '{}' +
find keyboards/ layouts/community/ users/ -type f -name 'rules.mk' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE = lite\);\1     # Enable Bootmagic Lite;g' '{}' +
find keyboards/ layouts/community/ users/ -type f -name 'rules.mk' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE = yes\);\1      # Enable Bootmagic Lite;g' '{}' +
find keyboards/ layouts/community/ users/ -type f -name 'rules.mk' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE = no\);\1       # Enable Bootmagic Lite;g' '{}' +
```

* rename improperly named makefiles

Some files intended to be used as makefiles had improper names causing them to not be used as intended when building.

This commit corrects the filenames of the affected files.

* update renamed file with new rule formatting

* update QMK's template files

Updates QMK's `rules.mk` templates to use the new inline comment.

* update QMK Docs

- remove documentation of full Bootmagic
- update links to Bootmagic Lite doc
- add doc for Magic Keycodes

* rules.mk patch for coarse/ixora and coarse/vinta
2021-08-06 23:59:56 -07:00
..
keymaps/default
ld
.noci Exclude more keyboards from CI (#11436) 2021-01-13 08:12:28 -08:00
chconf.h ChibiOS conf migrations... take 11 (#11646) 2021-01-21 17:00:53 +11:00
config.h Merge remote-tracking branch 'origin/master' into develop 2021-01-20 01:42:07 +00:00
halconf.h Fix up comments showing how to execute config migration. (#11621) 2021-01-20 02:19:36 +11:00
info.json
mcuconf.h
mk02.c
mk02.h
readme.md
rules.mk Remove Full Bootmagic (#13846) 2021-08-06 23:59:56 -07:00

Xiaomi Yuemi Pro MK02

A tenkeyless keyboard sold under Xiaomi brand. It uses an STM32F072C8T6 microcontroller and can be flashed with QMK.

LED backlight is currently not supported.

  • Keyboard Maintainer: @xyzz
  • Hardware Supported: Xiaomi Yuemi Pro MK02
  • Hardware Availability: Aliexpress

Make example for this keyboard (after setting up your build environment):

make xiaomi/mk02:default

See the build environment setup and the make instructions for more information. Brand new to QMK? Start with our Complete Newbs Guide.

Installation

Please understand that following these steps will void your warranty and might irrecoverably damage your keyboard.

Installing the bootloader

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).

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:

mcu

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.

Plug the keyboard in with the wire connected. You should see the following device appear:

[5067851.560317] usb 2-1.5.3.1: new full-speed USB device number 6 using ehci-pci
[5067851.670006] usb 2-1.5.3.1: New USB device found, idVendor=0483, idProduct=df11, bcdDevice=22.00
[5067851.670010] usb 2-1.5.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[5067851.670013] usb 2-1.5.3.1: Product: STM32  BOOTLOADER
[5067851.670015] usb 2-1.5.3.1: Manufacturer: STMicroelectronics
[5067851.670017] usb 2-1.5.3.1: SerialNumber: FFFFFFFEFFFF

If you don't see this, you did something wrong. Disconnect the keyboard and try again.

If you do see this, remove the wire before continuing.

Make a backup of internal flash memory in case you'd like to revert to the original firmware in the future:

dfu-util -d 0483:df11 -a 0 -s 0x08000000 -U flash-backup.bin

Ensure the dumped flash is correct:

strings flash.bin | grep KB

(You should see 2 entries of "USB KB")

Finally, flash the bootloader (jumploader-xiaomi_mk02-padded.bin) with:

dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D jumploader-xiaomi_mk02-padded.bin

At this point the keyboard should reboot into bootloader mode; if it doesn't, wait a couple seconds and replug the USB cable.

Installing the firmware

To install QMK, first boot into bootloader mode as detailed below. When the keyboard boots in bootloader mode, you should see the following device:

[5067851.560317] usb 2-1.5.3.1: new full-speed USB device number 6 using ehci-pci
[5067851.670006] usb 2-1.5.3.1: New USB device found, idVendor=0483, idProduct=df11, bcdDevice=22.00
[5067851.670010] usb 2-1.5.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[5067851.670013] usb 2-1.5.3.1: Product: STM32  BOOTLOADER
[5067851.670015] usb 2-1.5.3.1: Manufacturer: STMicroelectronics
[5067851.670017] usb 2-1.5.3.1: SerialNumber: FFFFFFFEFFFF

Flash the keyboard normally by executing:

make xiaomi/mk02:default:flash

Warning! If you flash the firmware manually by using dfu-util, make sure to use the following arguments:

-d 0483:df11 -a 0 -s 0x08002000:leave

If you don't, you'll blow away the user bootloader and will have to repeat the installation steps.

Booting into bootloader

To boot into bootloader, do either of the following:

  • map a RESET key in your keymap and tap it, or
  • hold spacebar while plugging in the keyboard.

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.

Restoring the original firmware

If you wish to restore the original firmware, boot into the bootloader and then execute:

dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D flash-backup.bin