Created
April 10, 2021 05:37
-
-
Save idlesign/0fbba8e03b8e499f3a0c8021b4c8029c to your computer and use it in GitHub Desktop.
bin в hex для прошивок к m86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python-скрипт преобразует прошивки с https://chiptuner.ru/content/ser_m86/ | |
# из двоичного представления (bin) в шестнадцатеричное (hex), которое используются | |
# в Infineon Memtool. | |
# | |
# Требуется установленный пакет intelhex: | |
# pip install intelhex | |
# | |
# Запуск: | |
# python m86bin2hex.py < I765BL57v3.bin > I765BL57v3.hex | |
# | |
import sys | |
from intelhex import IntelHex | |
from intelhex import compat | |
ihex = IntelHex() | |
ihex.loadbin(compat.get_binary_stdin(), offset=int('0x00C00000', 16)) | |
ihex.write_hex_file(sys.stdout, eolstyle='CRLF', byte_count=32) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment