remap-keys / remap

Keymap Customization Web app for your keyboard.
https://remap-keys.app
Other
227 stars 27 forks source link

Support flashing a firmware via DFU bootloader #672

Closed yoichiro closed 2 years ago

yoichiro commented 2 years ago

Fix #664

This pull request provides the feature to flash a firmware via DFU bootloader.

To flash a firmware via DFU bootloader, this logic uses WebUSB API. Actually, there are some DFU protocols, but this pull request has a logic to support ATMEL DFU (ADC_AVR). That is, ADC_8051, ADC_AVR32, ADC_XMEGA and DC_STM32 are not supported in this time. The supported MCU list are:

at90usb1287, at90usb1286, at90usb1287-4k, at90usb1286-4k, at90usb647,
at90usb646, at90usb162, at90usb82, atmega32u6, atmega32u4, atmega32u2,
atmega16u4, atmega16u2, atmega8u2

Basically, it can wrote same firmware binary hex file using one of bootloaders for one MCU. For example, if you have a firmware hex file and you have a MCU with ATmega32u4 which has the Catarina bootloader, you can flash it with the Catarina protocol. And, if you also have a MCU with ATmega32u4 which has the DFU bootloader, you also can flash the same hex file with the DFU protocol. Therefore, users need to select a bootloader type at flashing a firmware on the introduction dialog pane. That is, it is unnecessary to specify a bootloader type and MCU type at registering a firmware by the keyboard designer. In this pull request, I removed the UI to specify them from the firmware upload page for keyboard designers, and I added the UI to specify a bootloader type on the firmware flashing dialog for users.

Screenshot_20211118_194924

yoichiro commented 2 years ago

@adamrocker I tested this code diff with Elite-C (ATmega32u4 + DFU) and ABQ (ATmega32u2 + DFU), and they were successfully. I release this.