Skip to content

Commit 6959aff

Browse files
committed
python script change print
1 parent 6d9f244 commit 6959aff

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

SourceCode/HOST/python/STM32_Programmer_V1.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@
4040
COMMAND_BL_MY_NEW_COMMAND_LEN =8
4141

4242

43-
verbose_mode = 0
43+
verbose_mode = 1
44+
mem_write_active =0
4445

45-
global mem_write_active
46-
mem_write_active = 0
4746
#----------------------------- file ops----------------------------------------
4847

4948
def calc_file_len():
@@ -146,7 +145,8 @@ def Write_to_serial_port(value, *length):
146145
data = struct.pack('>B', value)
147146
if (verbose_mode):
148147
value = bytearray(data)
149-
print(hex(value[0]), end=' ')
148+
#print(" "+hex(value[0]), end='')
149+
print(" "+"0x{:02x}".format(value[0]),end=' ')
150150
if(mem_write_active and (not verbose_mode)):
151151
print("#",end=' ')
152152
ser.write(data)
@@ -224,6 +224,8 @@ def process_COMMAND_BL_MEM_WRITE(length):
224224
print("\n Write_status: FLASH_HAL_INV_ADDR")
225225
else:
226226
print("\n Write_status: UNKNOWN_ERROR")
227+
print("\n")
228+
227229

228230
def process_COMMAND_BL_FLASH_MASS_ERASE(length):
229231
pass
@@ -446,6 +448,7 @@ def decode_menu_command_code(command):
446448

447449
base_mem_address = input("\n Enter the memory write address here :")
448450
base_mem_address = int(base_mem_address, 16)
451+
global mem_write_active
449452
while(bytes_remaining):
450453
mem_write_active=1
451454
if(bytes_remaining >= 128):
@@ -492,7 +495,7 @@ def decode_menu_command_code(command):
492495

493496
bytes_so_far_sent+=len_to_read
494497
bytes_remaining = t_len_of_file - bytes_so_far_sent
495-
print("\n bytes_so_far_sent:{0} -- bytes_remaining:{1}".format(bytes_so_far_sent,bytes_remaining))
498+
print("\n bytes_so_far_sent:{0} -- bytes_remaining:{1}\n".format(bytes_so_far_sent,bytes_remaining))
496499

497500
ret_value = read_bootloader_reply(data_buf[1])
498501
mem_write_active=0

0 commit comments

Comments
 (0)