klipper-dgus/lib/hidflash
Kevin O'Connor a5b5474f69 hidflash: Convert changes.diff to a unix style file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-28 14:52:22 -04:00
..
LICENSE lib: Add hidflash source 2020-05-28 14:44:51 -04:00
Makefile lib: Add hidflash source 2020-05-28 14:44:51 -04:00
README lib: Add hidflash source 2020-05-28 14:44:51 -04:00
changes.diff hidflash: Convert changes.diff to a unix style file 2020-05-28 14:52:22 -04:00
hid-libusb.c lib: Add hidflash source 2020-05-28 14:44:51 -04:00
hid-mac.c lib: Add hidflash source 2020-05-28 14:44:51 -04:00
hid-win.c lib: Add hidflash source 2020-05-28 14:44:51 -04:00
hidapi.h lib: Add hidflash source 2020-05-28 14:44:51 -04:00
main.c lib: Add hidflash source 2020-05-28 14:44:51 -04:00
rs232.c lib: Add hidflash source 2020-05-28 14:44:51 -04:00
rs232.h lib: Add hidflash source 2020-05-28 14:44:51 -04:00

README

The source for the hid-flash program in this folder is a deriviative of the
"cli" modified by Vassilis Serasidis to work with the STM32 Arduino core,
available here:
https://github.com/Serasidis/STM32_HID_Bootloader/tree/master/cli

The original source for hid-flash was written by Bruno Freitas, available
here:
https://github.com/bootsector/stm32-hid-bootloader/tree/master/cli

This derivative contains the following changes:
1) The "port" argument is now optional.  If not supplied hid-flash will not
   attempt to open a serial port and enter the bootloader, it will assume
   that the device has already entered the bootloader and look for a USB
   device with the appropriate Vendor and Product IDs. This change allows
   Klipper's "flash_usb.py" script to enter the bootloader and wait for the
   mcu to reconnect.
2) When the serial port is specified, hid-flash will use Klipper's procedure
   for entering the bootloader (Open the port at 1200 baud and toggle DTR).
3) The hid-flash program now accepts a command from the bootloader that allows
   a STM32F103 device to identify itself as a "high-density" device during
   the flashing process.  This fixes a bug where the final page would not
   be written if the last portion of the binary was less than or equal to
   1024 bytes. A forked version of the bootloader is required to send the
   "high-density" command, however the tool will still work correctly with
   the original bootloader (sans the bug that affects high density devices).
4) A typo was fixed where an "if" statement was using an assignment operator
   to test for equality.
5) The Makefile was changed to check for the libusb-1.0 dependency. If it
   does not exist the user will be warned and the build aborted, however
   no error will be generated.  This allows Klipper's "make FLASH"
   functionality to work when flashing via DFU without installing the
   libusb-1.0 dependency for hid-flash.

- Eric Callahan <arksine.code@gmail.com>