@@ -459,7 +459,7 @@ def connect_device(ser, args, verboseprint):
459459 hello = bytearray ([0x00 ]* 4 )
460460 fill_word (hello , 0 , ((8 << 16 ) | AM_SECBOOT_WIRED_MSGTYPE_HELLO ))
461461 verboseprint ('Sending Hello.' )
462- response = send_command (hello , 88 , ser )
462+ response = send_command (hello , 88 , ser , verboseprint )
463463
464464 #Check if response failed
465465 if response == False :
@@ -489,7 +489,7 @@ def connect_device(ser, args, verboseprint):
489489 abortMsg = bytearray ([0x00 ]* 8 );
490490 fill_word (abortMsg , 0 , ((12 << 16 ) | AM_SECBOOT_WIRED_MSGTYPE_ABORT ))
491491 fill_word (abortMsg , 4 , abort )
492- if send_ackd_command (abortMsg , ser ) == False :
492+ if send_ackd_command (abortMsg , ser , verboseprint ) == False :
493493 verboseprint ("Failed to ack command" )
494494 return
495495
@@ -501,7 +501,7 @@ def connect_device(ser, args, verboseprint):
501501 otaDesc = bytearray ([0x00 ]* 8 );
502502 fill_word (otaDesc , 0 , ((12 << 16 ) | AM_SECBOOT_WIRED_MSGTYPE_OTADESC ))
503503 fill_word (otaDesc , 4 , otadescaddr )
504- if send_ackd_command (otaDesc , ser ) == False :
504+ if send_ackd_command (otaDesc , ser , verboseprint ) == False :
505505 verboseprint ("Failed to ack command" )
506506 return
507507
@@ -571,7 +571,7 @@ def connect_device(ser, args, verboseprint):
571571 fill_word (dataMsg , 4 , x )
572572
573573 verboseprint ("Sending Data Packet of length " , chunklen )
574- if send_ackd_command (dataMsg + chunk , ser ) == False :
574+ if send_ackd_command (dataMsg + chunk , ser , verboseprint ) == False :
575575 verboseprint ("Failed to ack command" )
576576 return
577577
@@ -591,7 +591,7 @@ def connect_device(ser, args, verboseprint):
591591 fill_word (resetmsg , 0 , ((12 << 16 ) | AM_SECBOOT_WIRED_MSGTYPE_RESET ))
592592 # options
593593 fill_word (resetmsg , 4 , args .reset )
594- if send_ackd_command (resetmsg , ser ) == False :
594+ if send_ackd_command (resetmsg , ser , verboseprint ) == False :
595595 verboseprint ("Failed to ack command" )
596596 return
597597
@@ -616,9 +616,9 @@ def connect_device(ser, args, verboseprint):
616616# Sends a command, and waits for an ACK.
617617#
618618#******************************************************************************
619- def send_ackd_command (command , ser ):
619+ def send_ackd_command (command , ser , verboseprint ):
620620
621- response = send_command (command , 20 , ser )
621+ response = send_command (command , 20 , ser , verboseprint )
622622
623623 #Check if response failed
624624 if response == False :
@@ -647,7 +647,7 @@ def send_ackd_command(command, ser):
647647# Sends a command, and waits for the response.
648648#
649649#******************************************************************************
650- def send_command (params , response_len , ser ):
650+ def send_command (params , response_len , ser , verboseprint ):
651651
652652 # Compute crc
653653 crc = crc32 (params )
0 commit comments