Lines Matching refs:output_file

132     output_file = _set_input_and_output(ecst_args)
133 _check_chip(output_file, ecst_args)
136 _check_firmware_header_offset(output_file, ecst_args)
138 _copy_image(output_file, ecst_args)
139 _set_anchor(output_file, ecst_args)
140 _set_extended_anchor(output_file, ecst_args)
141 _set_spi_flash_maximum_clock(output_file, ecst_args)
142 _set_spi_flash_mode(output_file, ecst_args)
143 _set_error_detection_configuration(output_file, ecst_args)
144 _set_firmware_load_start_address(output_file, ecst_args)
145 _set_firmware_entry_point(output_file, ecst_args)
146 _set_firmware_crc_start_and_size(output_file, ecst_args)
147 _set_firmware_length(output_file, ecst_args)
148 _set_flash_size(output_file, ecst_args)
149 _set_reserved_bytes(output_file, ecst_args)
150 _set_firmware_header_crc_signature(output_file, ecst_args)
151 _set_firmware_image_crc_signature(output_file, ecst_args)
185 output_file = Path("out_" + input_file_path.name)
187 output_file = Path(output)
189 if output_file.exists():
190 if output_file.samefile(input_file_path):
194 output_file.unlink()
196 output_file.touch()
203 return output_file
227 with output.open("r+b") as output_file:
228 output_file.seek(HDR_ANCHOR_OFFSET + ecst_args.paste_firmware_header)
229 output_file.write(FW_HDR_ANCHOR.to_bytes(4, "little"))
234 output_file.close()
243 with output.open("r+b") as output_file:
244 output_file.seek(HDR_EXTENDED_ANCHOR_OFFSET + \
247 output_file.write(FW_HDR_EXT_ANCHOR_ENABLE.to_bytes(2, "little"))
250 output_file.write(FW_HDR_EXT_ANCHOR_DISABLE.to_bytes(2, "little"))
256 output_file.close()
315 with output.open("r+b") as output_file:
316 output_file.seek(HDR_SPI_MAX_CLK_OFFSET +
327 output_file.close()
331 output_file.close()
336 output_file.write(spi_max_clock_to_write.to_bytes(1, "little"))
340 output_file.write(spi_max_clock_to_write.to_bytes(1, "little"))
344 output_file.write(spi_max_clock_to_write.to_bytes(1, "little"))
348 output_file.write(spi_max_clock_to_write.to_bytes(1, "little"))
352 output_file.write(spi_max_clock_to_write.to_bytes(1, "little"))
355 output_file.close()
361 output_file.close()
368 output_file.close()
390 with output.open("r+b") as output_file:
391 output_file.seek(HDR_SPI_READ_MODE_OFFSET +
395 output_file.write(spi_read_mode_to_write.to_bytes(1, "little"))
398 output_file.write(spi_read_mode_to_write.to_bytes(1, "little"))
401 output_file.write(spi_read_mode_to_write.to_bytes(1, "little"))
404 output_file.write(spi_read_mode_to_write.to_bytes(1, "little"))
408 output_file.close()
416 output_file.close()
425 with output.open("r+b") as output_file:
426 output_file.seek(HDR_ERR_DETECTION_CONF_OFFSET +
430 output_file.write(FW_CRC_ENABLE.to_bytes(1, "little"))
433 output_file.write(FW_CRC_DISABLE.to_bytes(1, "little"))
440 output_file.close()
489 with output.open("r+b") as output_file:
490 output_file.seek(HDR_FW_LOAD_START_ADDR_OFFSET +
492 output_file.write(ecst_args.firmware_load_address.
495 output_file.seek(HDR_FW_LENGTH_OFFSET +
497 output_file.write(fw_length.to_bytes(4, "little"))
503 output_file.close()
531 with output.open("r+b") as output_file:
539 output_file.close()
549 output_file.seek(HDR_FW_ENTRY_POINT_OFFSET +
551 output_file.write(fw_entry_pt.to_bytes(4, "little"))
552 output_file.close()
610 with output.open("r+b") as output_file:
611 output_file.seek(HDR_FW_ERR_DETECT_START_ADDR_OFFSET +
613 output_file.write(fw_crc_start.to_bytes(4, "little"))
615 output_file.seek(HDR_FW_ERR_DETECT_END_ADDR_OFFSET +
617 output_file.write(fw_crc_end.to_bytes(4, "little"))
618 output_file.close()
641 with output.open("r+b") as output_file:
642 output_file.seek(HDR_FW_LENGTH_OFFSET +
644 output_file.write(fw_length.to_bytes(4, "little"))
649 output_file.close()
662 with output.open("r+b") as output_file:
663 output_file.seek(HDR_FLASH_SIZE_OFFSET +
668 output_file.write(FLASH_SIZE_1_MBYTES.to_bytes(4, "little"))
671 output_file.write(FLASH_SIZE_2_MBYTES.to_bytes(4, "little"))
674 output_file.write(FLASH_SIZE_4_MBYTES.to_bytes(4, "little"))
677 output_file.write(FLASH_SIZE_8_MBYTES.to_bytes(4, "little"))
680 output_file.write(FLASH_SIZE_16_MBYTES.to_bytes(4, "little"))
683 output_file.close()
689 output_file.close()
696 output_file.close()
705 with output.open("r+b") as output_file:
707 output_file.seek(RESERVED_BYTES_OFFSET +
709 output_file.write(PAD_BYTE)
710 output_file.close()
724 with output.open("r+b") as output_file:
729 output_file.seek(ecst_args.paste_firmware_header + i)
730 current = output_file.read(1)
737 output_file.seek(ecst_args.paste_firmware_header +
739 output_file.write(crc_to_write)
741 output_file.close()
759 with output.open("r+b") as output_file:
763 output_file.seek(FW_IMAGE_OFFSET + ecst_args.paste_firmware_header +
766 current = output_file.read(1)
773 output_file.seek(HDR_FW_IMAGE_SIG_OFFSET +
775 output_file.write(crc_to_write)
777 output_file.close()
793 with open(output, "r+b") as output_file:
795 output_file.seek(FW_IMAGE_OFFSET)
797 output_file.seek(0)
799 output_file.write(line)
800 output_file.close()
807 with open(output, "r+b") as output_file:
810 output_file.seek(0, 2) # seek end of file
811 output_file.write(PAD_BYTE)
813 output_file.close()
850 output_file = Path(ecst_args.output)
851 output_file.touch()
853 with output_file.open("r+b") as output_file:
854 file_name_to_print = output_file.name
856 output_file.write(line)
857 output_file.seek(bh_index)
858 output_file.write(HDR_PTR_SIGNATURE.to_bytes(4, "little"))
859 output_file.seek(bh_index + 4)
860 output_file.write(ecst_args.pointer.to_bytes(4, "little"))
861 output_file.close()
890 output_file = Path(ecst_args.output)
891 if not output_file.exists():
892 output_file.touch()
893 with open(output_file, "r+b") as boot_loader_header_file:
959 output_file = Path(output)
960 if output_file.exists():
961 output_file.unlink()