Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@idlesign
Created April 10, 2021 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idlesign/0fbba8e03b8e499f3a0c8021b4c8029c to your computer and use it in GitHub Desktop.
Save idlesign/0fbba8e03b8e499f3a0c8021b4c8029c to your computer and use it in GitHub Desktop.
bin в hex для прошивок к m86
# 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