flash_fp_mcu: Unlock flash before programming it
Also, add a short sleep before stm32mon, which seems to make
programming more reliable.
BRANCH=none
TEST=bash flash_fp_mcu ec.bin works on first attempt with protected
flash.
@@ -69,8 +69,9 @@ echo "in" > /sys/class/gpio/gpio${GPIO_NRST}/direction
echo "${SPIID}" > /sys/bus/spi/drivers/cros-ec-spi/bind
echo "${SPIID}" > /sys/bus/spi/drivers/spidev/bind
+sleep 0.5
-stm32mon -p -s ${SPIDEV} -e -w $1
+stm32mon -u -p -s ${SPIDEV} -e -w $1
# unload spidev
echo "${SPIID}" > /sys/bus/spi/drivers/spidev/unbind
