mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-29 02:38:07 +08:00
[tools] update dfu script
- add a timeout so you have time to connect the device - less verbose, don't print all addresses
This commit is contained in:
committed by
Felix Ruess
parent
49059f0880
commit
3e689f0ce6
Executable → Regular
+12
-2
@@ -29,6 +29,7 @@ from optparse import OptionParser
|
||||
|
||||
import usb
|
||||
import dfu
|
||||
import time
|
||||
|
||||
APP_ADDRESS = 0x08002000
|
||||
SECTOR_SIZE = 2048
|
||||
@@ -101,7 +102,13 @@ if __name__ == "__main__":
|
||||
if options.verbose:
|
||||
print_copyright()
|
||||
|
||||
devs = dfu.finddevs()
|
||||
for i in range(1,60):
|
||||
devs = dfu.finddevs()
|
||||
if not devs:
|
||||
print('.', end="")
|
||||
stdout.flush()
|
||||
time.sleep(0.5)
|
||||
print("")
|
||||
if not devs:
|
||||
print("No DFU devices found!")
|
||||
exit(1)
|
||||
@@ -186,8 +193,11 @@ if __name__ == "__main__":
|
||||
|
||||
#addr = APP_ADDRESS
|
||||
addr = options.addr
|
||||
print ("Programming memory from 0x%08X...\r" % addr)
|
||||
|
||||
while bin:
|
||||
print("Programming memory at 0x%08X\r" % addr)
|
||||
# print("Programming memory at 0x%08X\r" % addr),
|
||||
print('#', end="")
|
||||
stdout.flush()
|
||||
stm32_erase(target, addr)
|
||||
stm32_write(target, bin[:SECTOR_SIZE])
|
||||
|
||||
Reference in New Issue
Block a user