mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fix exit_dfu
This commit is contained in:
parent
4bb1d3fc3f
commit
619bc14fa1
@ -160,11 +160,16 @@ def write_page(buf, xfer_offset):
|
|||||||
print ("Write: 0x%x "%(xfer_base+xfer_offset))
|
print ("Write: 0x%x "%(xfer_base+xfer_offset))
|
||||||
|
|
||||||
def exit_dfu():
|
def exit_dfu():
|
||||||
|
# set jump address
|
||||||
|
set_address(0x08000000)
|
||||||
|
|
||||||
# Send DNLOAD with 0 length to exit DFU
|
# Send DNLOAD with 0 length to exit DFU
|
||||||
__dev.ctrl_transfer(0x21, __DFU_DNLOAD, 0, __DFU_INTERFACE, None, __TIMEOUT)
|
__dev.ctrl_transfer(0x21, __DFU_DNLOAD, 0, __DFU_INTERFACE, None, __TIMEOUT)
|
||||||
|
|
||||||
# Execute last command
|
# Execute last command
|
||||||
get_status()
|
if (get_status() != __DFU_STATE_DFU_MANIFEST):
|
||||||
|
print("Failed to reset device")
|
||||||
|
pass # ignore
|
||||||
|
|
||||||
# Release device
|
# Release device
|
||||||
usb.util.dispose_resources(__dev)
|
usb.util.dispose_resources(__dev)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user