|
40 | 40 | COMMAND_BL_MY_NEW_COMMAND_LEN =8 |
41 | 41 |
|
42 | 42 |
|
43 | | -verbose_mode = 0 |
| 43 | +verbose_mode = 1 |
| 44 | +mem_write_active =0 |
44 | 45 |
|
45 | | -global mem_write_active |
46 | | -mem_write_active = 0 |
47 | 46 | #----------------------------- file ops---------------------------------------- |
48 | 47 |
|
49 | 48 | def calc_file_len(): |
@@ -146,7 +145,8 @@ def Write_to_serial_port(value, *length): |
146 | 145 | data = struct.pack('>B', value) |
147 | 146 | if (verbose_mode): |
148 | 147 | value = bytearray(data) |
149 | | - print(hex(value[0]), end=' ') |
| 148 | + #print(" "+hex(value[0]), end='') |
| 149 | + print(" "+"0x{:02x}".format(value[0]),end=' ') |
150 | 150 | if(mem_write_active and (not verbose_mode)): |
151 | 151 | print("#",end=' ') |
152 | 152 | ser.write(data) |
@@ -224,6 +224,8 @@ def process_COMMAND_BL_MEM_WRITE(length): |
224 | 224 | print("\n Write_status: FLASH_HAL_INV_ADDR") |
225 | 225 | else: |
226 | 226 | print("\n Write_status: UNKNOWN_ERROR") |
| 227 | + print("\n") |
| 228 | + |
227 | 229 |
|
228 | 230 | def process_COMMAND_BL_FLASH_MASS_ERASE(length): |
229 | 231 | pass |
@@ -446,6 +448,7 @@ def decode_menu_command_code(command): |
446 | 448 |
|
447 | 449 | base_mem_address = input("\n Enter the memory write address here :") |
448 | 450 | base_mem_address = int(base_mem_address, 16) |
| 451 | + global mem_write_active |
449 | 452 | while(bytes_remaining): |
450 | 453 | mem_write_active=1 |
451 | 454 | if(bytes_remaining >= 128): |
@@ -492,7 +495,7 @@ def decode_menu_command_code(command): |
492 | 495 |
|
493 | 496 | bytes_so_far_sent+=len_to_read |
494 | 497 | 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)) |
496 | 499 |
|
497 | 500 | ret_value = read_bootloader_reply(data_buf[1]) |
498 | 501 | mem_write_active=0 |
|
0 commit comments