Skip to content

Commit 7f6773d

Browse files
committed
Add input buffer reset just before device connection
Appears to fix UART hammer problems such as this one: https://forum.sparkfun.com/viewtopic.php?f=164&t=50481&p=206398#p206270
1 parent 807c7d9 commit 7f6773d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/ambiq/ambiq_bin2board.py

+2
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@ def upload(args, verboseprint):
426426
#Give bootloader a chance to run and check bootload pin before communication begins. But must initiate com before bootloader timeout of 250ms.
427427
time.sleep(0.100) #100ms works well
428428

429+
ser.reset_input_buffer() # reset the input bufer to discard any UART traffic that the device may have generated
430+
429431
connect_device(ser, args, verboseprint)
430432

431433
if(loadSuccess == True):

0 commit comments

Comments
 (0)