Lines Matching +full:- +full:f

5 # SPDX-License-Identifier: Apache-2.0
10 # -i in_file.bin -o out_file.bin
11 # [-chip <name>] [-v]
61 INVALID_INPUT = -1
103 :returns: output file path object, or -1 if fails
110 exit_with_failure("Define input file, using -i flag")
115 exit_with_failure(f'Cannot open {input_file}')
117 exit_with_failure(f'BIN Input file ({input_file}) is empty')
128 exit_with_failure(f'Input file name {input_file} '
129 f'should be differed from'
130 f' Output file name {output}')
136 print(Fore.LIGHTCYAN_EX + f'\nBIN file: {input_file}, size:'
137 f' {input_file_size} bytes')
138 print(f'Output file name: {output_file.name} \n')
152 message = f'Invalid chip name, '
164 message = f'ANCHOR max support 8 bytes'
172 print(f'- HDR - FW Header ANCHOR - Offset '
173 f'{HDR_ANCHOR_OFFSET} - %s' % FW_HDR_ANCHOR)
199 message = f'Cannot read firmware length'
203 message = f'Cannot read FW Load start address'
207 message = f'Firmware load address ({fw_load_addr_to_print}) ' \
208 f'is not 16 bytes aligned'
212 message = f'Firmware load address ({fw_load_addr_to_print}) ' \
213 f'should be between start ({start_ram_to_print}) '\
214 f'and end ({end_ram_to_print}) of RAM'
230 message = f'Firmware end address ({fw_end_addr_to_print}) should be '
231 message += f'less than end of RAM address ({end_ram_to_print})'
254 print(f'- HDR - FW load start address - Offset '
255 f'{HDR_FW_LOAD_START_ADDR_OFFSET} - '
256 f'{_hex_print_format(fw_load_addr)}')
257 print(f'- HDR - flash load start address - Offset '
258 f'{HDR_FW_FLASH_ADDR_START_LOAD_OFFSET} - '
259 f'{_hex_print_format(start_flash_addr)}')
260 print(f'- HDR - flash load end address - Offset '
261 f'{HDR_FW_FLASH_ADDR_END_LOAD_OFFSET} - '
262 f'{_hex_print_format(end_flash_addr)}')
304 print(f'- HDR - FW Entry point - Offset '
305 f'{HDR_FW_ENTRY_POINT_OFFSET} - '
306 f'{_hex_print_format(fw_entry_pt)}')
309 """Computes the SHA-256 digest of a file using hashlib.
312 :return: The SHA-256 digest of the file as a bytearray.
315 with open(filepath, "rb") as f:
317 for byte_block in iter(lambda: f.read(4096), b""):
337 print(f'- HDR - FW Length - Offset '
338 f'{HDR_FW_LENGTH_OFFSET} - '
339 f'{fw_length_to_print}')
351 with output.open("r+b") as f:
352 f.seek(HEADER_SIZE)
354 for byte_block in iter(lambda: f.read(4096), b""):
410 print(f'- HDR - Segment1 start address - Offset '
411 f'{HDR_FW_SEG1_START_OFFSET} - '
412 f'{segment1_start_to_print}')
413 print(f'- HDR - Segment1 size - Offset '
414 f'{HDR_FW_SEG1_SIZE_OFFSET} - '
415 f'{segment1_size_to_print}')
416 print(f'- HDR - Segment2 start address - Offset '
417 f'{HDR_FW_SEG2_START_OFFSET} - '
418 f'{segment2_start_to_print}')
419 print(f'- HDR - Segment2 size - Offset '
420 f'{HDR_FW_SEG2_SIZE_OFFSET} - '
421 f'{segment2_size_to_print}')
422 print(f'- HDR - Segment3 start address - Offset '
423 f'{HDR_FW_SEG3_START_OFFSET} - '
424 f'{segment3_start_to_print}')
425 print(f'- HDR - Segment3 size - Offset '
426 f'{HDR_FW_SEG3_SIZE_OFFSET} - '
427 f'{segment3_size_to_print}')
428 print(f'- HDR - Segment4 start address - Offset '
429 f'{HDR_FW_SEG4_START_OFFSET} - '
430 f'{segment4_start_to_print}')
431 print(f'- HDR - Segment4 size - Offset '
432 f'{HDR_FW_SEG4_SIZE_OFFSET} - '
433 f'{segment4_size_to_print}')
519 input_file_size = Path(esiost_args.input).stat().st_size - HEADER_SIZE
588 message = f'unKnown flag: {err_arg}'