When programming a virgin STM32L4 MCU through dfu-util 0.9, it won't exit dfu mode until power cycle.
I am working on a IoT product with the STM32L412CBU6 that requires flashing and testing at our manufacturer. I am able to program the device through DFU mode over USB using:
sudo dfu-util -a 0 -i 0 -s 0x08000000:mass-erase:force:leave -R -D firmware.bin
However, it does not enter back into regular mode. Even if I return the boot pin to low and reset, it still appears as a DFU device with lsusb. However, when I power cycle the device it behaves as if it has the new firmware, and I am able to update the firmware with the exact same script and set it to normal/DFU mode using the boot pin and reset.
My question is why does the dfu update work in EVERY other instance other than the very first time I flash the firmware?
