1
1
#!/usr/bin/env python
2
- VERSION = "1.2.6 "
2
+ VERSION = "1.2.7 "
3
3
4
- # Copyright (c) 2019 , Pycom Limited.
4
+ # Copyright (c) 2021 , Pycom Limited.
5
5
#
6
6
# This software is licensed under the GNU GPL version 3 or any
7
7
# later version, with permitted additional terms. For more information
@@ -350,7 +350,7 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
350
350
load_fff = True if force_fff else load_fff
351
351
target_baudrate = baudrate
352
352
baudrate = self .__modem_speed if self .__speed_detected else baudrate
353
- if debug : print ('mirror? {} recover? {} resume? {} direct? {} atneg_only? {} bootrom? {} load_fff? {}' .format (mirror , recover , resume , direct , atneg_only , bootrom , load_fff ))
353
+ if debug : print ('file_path? {} mirror? {} recover? {} resume? {} direct? {} atneg_only? {} bootrom? {} load_fff? {}' .format (file_path , mirror , recover , resume , direct , atneg_only , bootrom , load_fff ))
354
354
if debug : print ('baudrate: {} target_baudrate: {}' .format (baudrate , target_baudrate ))
355
355
abort = True
356
356
external = False
@@ -522,7 +522,7 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
522
522
return self .uart_mirror (rgbled )
523
523
524
524
elif bootrom :
525
- if verbose : print ('Starting STP' )
525
+ if verbose : print ('Starting STP [BR] ' )
526
526
else :
527
527
if verbose :
528
528
if load_fff :
@@ -547,7 +547,6 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
547
547
except Exception as ex :
548
548
if debug : print ('Exception: {}' .format (ex ))
549
549
pass
550
-
551
550
self .__serial .read ()
552
551
elif recover and (not direct ):
553
552
if atneg :
@@ -576,15 +575,18 @@ def __run(self, file_path=None, baudrate=921600, port=None, resume=False, load_f
576
575
else :
577
576
if debug : print ('Starting STP mode...' )
578
577
self .__serial .write (b"AT+STP\n " )
579
- response = self .read_rsp (size = 2 )
578
+ response = self .read_rsp (size = 4 )
580
579
if not b'OK' in response :
581
580
print ('Failed to start STP mode!' )
582
581
reconnect_uart ()
583
582
return False
584
583
585
584
try :
586
585
if debug :
587
- if verbose : print ('Starting STP code upload' )
586
+ if verbose : print ('Starting STP code upload with pkgdebug={}' .format (pkgdebug ))
587
+ time .sleep (.1 )
588
+ self .__serial .read ()
589
+ time .sleep (.1 )
588
590
start = stp .start (blob , blobsize , self .__serial , baudrate , AT = False , debug = debug , pkgdebug = pkgdebug )
589
591
if debug : print ('start returned {} type {}' .format (start , type (start )))
590
592
if start == True :
0 commit comments