stm32_mem.py: Add exception handler for better diagnosis, as erase on STM32F407 times out

This commit is contained in:
Uwe Bonnes 2013-01-17 14:04:43 +01:00
parent 5e71ea3f60
commit 06c2d52c59
1 changed files with 5 additions and 1 deletions

View File

@ -115,7 +115,11 @@ if __name__ == "__main__":
while bin:
print ("Programming memory at 0x%08X\r" % addr),
stdout.flush()
stm32_erase(dfudev, addr)
try:
stm32_erase(dfudev, addr)
except:
print "\nErase Timed out\n"
break
stm32_write(dfudev, bin[:1024])
bin = bin[1024:]