@@ -459,7 +459,7 @@ def connect_device(ser, args, verboseprint):
459
459
hello = bytearray ([0x00 ]* 4 )
460
460
fill_word (hello , 0 , ((8 << 16 ) | AM_SECBOOT_WIRED_MSGTYPE_HELLO ))
461
461
verboseprint ('Sending Hello.' )
462
- response = send_command (hello , 88 , ser )
462
+ response = send_command (hello , 88 , ser , verboseprint )
463
463
464
464
#Check if response failed
465
465
if response == False :
@@ -489,7 +489,7 @@ def connect_device(ser, args, verboseprint):
489
489
abortMsg = bytearray ([0x00 ]* 8 );
490
490
fill_word (abortMsg , 0 , ((12 << 16 ) | AM_SECBOOT_WIRED_MSGTYPE_ABORT ))
491
491
fill_word (abortMsg , 4 , abort )
492
- if send_ackd_command (abortMsg , ser ) == False :
492
+ if send_ackd_command (abortMsg , ser , verboseprint ) == False :
493
493
verboseprint ("Failed to ack command" )
494
494
return
495
495
@@ -501,7 +501,7 @@ def connect_device(ser, args, verboseprint):
501
501
otaDesc = bytearray ([0x00 ]* 8 );
502
502
fill_word (otaDesc , 0 , ((12 << 16 ) | AM_SECBOOT_WIRED_MSGTYPE_OTADESC ))
503
503
fill_word (otaDesc , 4 , otadescaddr )
504
- if send_ackd_command (otaDesc , ser ) == False :
504
+ if send_ackd_command (otaDesc , ser , verboseprint ) == False :
505
505
verboseprint ("Failed to ack command" )
506
506
return
507
507
@@ -571,7 +571,7 @@ def connect_device(ser, args, verboseprint):
571
571
fill_word (dataMsg , 4 , x )
572
572
573
573
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 :
575
575
verboseprint ("Failed to ack command" )
576
576
return
577
577
@@ -591,7 +591,7 @@ def connect_device(ser, args, verboseprint):
591
591
fill_word (resetmsg , 0 , ((12 << 16 ) | AM_SECBOOT_WIRED_MSGTYPE_RESET ))
592
592
# options
593
593
fill_word (resetmsg , 4 , args .reset )
594
- if send_ackd_command (resetmsg , ser ) == False :
594
+ if send_ackd_command (resetmsg , ser , verboseprint ) == False :
595
595
verboseprint ("Failed to ack command" )
596
596
return
597
597
@@ -616,9 +616,9 @@ def connect_device(ser, args, verboseprint):
616
616
# Sends a command, and waits for an ACK.
617
617
#
618
618
#******************************************************************************
619
- def send_ackd_command (command , ser ):
619
+ def send_ackd_command (command , ser , verboseprint ):
620
620
621
- response = send_command (command , 20 , ser )
621
+ response = send_command (command , 20 , ser , verboseprint )
622
622
623
623
#Check if response failed
624
624
if response == False :
@@ -647,7 +647,7 @@ def send_ackd_command(command, ser):
647
647
# Sends a command, and waits for the response.
648
648
#
649
649
#******************************************************************************
650
- def send_command (params , response_len , ser ):
650
+ def send_command (params , response_len , ser , verboseprint ):
651
651
652
652
# Compute crc
653
653
crc = crc32 (params )
0 commit comments