summaryrefslogtreecommitdiff
path: root/util/flash_ec
diff options
context:
space:
mode:
Diffstat (limited to 'util/flash_ec')
-rwxr-xr-xutil/flash_ec5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/flash_ec b/util/flash_ec
index 3278f1d8fd..0d840a9ae4 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -353,6 +353,11 @@ function flash_stm32_dfu() {
fi
SIZE=$(wc -c ${IMG} | cut -d' ' -f1)
+ # Remove read protection
+ sudo $DFU_UTIL -a 0 -s ${ADDR}:${SIZE}:force:unprotect -D "${IMG}"
+ # Wait for mass-erase and reboot after unprotection
+ sleep 1
+ # Actual image flashing
sudo $DFU_UTIL -a 0 -s ${ADDR}:${SIZE} -D "${IMG}"
}