From 4f92c18ebf5b639b109b9a2a92c4fa38744b4a31 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Wed, 22 Mar 2017 20:46:09 -0300 Subject: [PATCH] scripts/dfuutil: add support for DfuSe devices Add DFUUTIL_DFUSE_ADDR to the list of dfu-util environment variables, which can be used to flash DfuSe devices (e.g. STM32 based MCUs). Change-Id: I39fdc338f7f034376ce50b648b06f39fee3169a7 Signed-off-by: Ricardo Salveti --- scripts/support/dfuutil.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/support/dfuutil.sh b/scripts/support/dfuutil.sh index feac1a8825f..c119eb02618 100755 --- a/scripts/support/dfuutil.sh +++ b/scripts/support/dfuutil.sh @@ -39,6 +39,11 @@ do_flash() { done fi + # Allow DfuSe based devices by checking for DFUUTIL_DFUSE_ADDR + if [ -n "${DFUUTIL_DFUSE_ADDR}" ]; then + DFUUTIL_CMD="${DFUUTIL_CMD} -s ${DFUUTIL_DFUSE_ADDR}:leave" + fi + # Flash DFU device with specified image # Do NOT reset with -R, to avoid random 'error resetting after download' $DFUUTIL_CMD -a $DFUUTIL_ALT -D $DFUUTIL_IMG