Загрузка данных


import os

hex_data = """:020000040000FA
:1000000020F0FF00004000001D0100000D01000095
:100010001E0100001F0100002001000021010000DC
:1000200022010000230100002401000025010000CC
:1000300026010000270100002801000029010000BC
:100040002A0100002B0100002C0100002D010000AC
:100050002E0100002F01000030010000310100009C
:10006000320100003301000034010000350100008C
:10007000360100003701000038010000390100007C
:100080003A0100003B0100003C0100003D0100006C
:100090003E0100003F01000040010000410100005C
:1000A000420100004301000044010000450100004C
:1000B000460100004701000048010000490100003C
:1000C0004A0100004B0100004C0100004D0100002C
:1000D0004E0100004F01000050010000510100001C
:1000E000520100005301000054010000550100000C
:1000F00056010000570100005801000059010000FC
:00000001FF"""

with open(os.path.expanduser("~/Desktop/test_mini.hex"), "w") as f:
    f.write(hex_data)

print("Файл создан на рабочем столе! Прошиваю...")
os.system('python -m esptool --chip esp32s3 --port COM4 --baud 921600 write_flash 0x0 ' + os.path.expanduser("~/Desktop/test_mini.hex"))