From 6fa5a1a3f4fbd4b5a6dafa69db1460d678a94f39 Mon Sep 17 00:00:00 2001 From: DonaldBecker Date: Wed, 6 Nov 2019 20:32:17 -0500 Subject: [PATCH] A Unix shell script matching the functionality flash_dfu.bat (cherry picked from commit fd192ab28fde1dac204b19a6fd446728a3b35647) --- firmware/flash_dfu.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 firmware/flash_dfu.sh diff --git a/firmware/flash_dfu.sh b/firmware/flash_dfu.sh new file mode 100755 index 0000000000..044f8e5451 --- /dev/null +++ b/firmware/flash_dfu.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# This is a Linux/Unix script to do USB DFU (Device Firmware Update). +# +# The STM32 has multiple ways to write an application into the MCU. One is +# is USB DFU mode. +# This can write a blank or overwrite a corrupted ECU, but does require +# that the processor be set into DFU mode by holding down the 'Program' (AKA +# 'Boot1') button at reset or power up. +# Note: The 'Program' button is only checked immediately after reset. The +# button may be released after that instant. A reset or power cycle may be +# needed to exit DFU mode. +# + +# Future: Consider if creating a build/rusefi.dfu install file is more +# or less descriptive than multiple command line parameters. + +dfu-util --alt 0 --download build/rusefi.bin --dfuse-address 0x08000000 --reset + +# For Windows the batch file flash_dfu.bat runs the equivalent command +# DfuSeCommand.exe -c -d --fn build/rusefi.dfu