diff options
Diffstat (limited to 'esp8266/makeimg.py')
| -rw-r--r-- | esp8266/makeimg.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/esp8266/makeimg.py b/esp8266/makeimg.py new file mode 100644 index 000000000..1ac681cb7 --- /dev/null +++ b/esp8266/makeimg.py @@ -0,0 +1,21 @@ +import sys + +assert len(sys.argv) == 4 + +with open(sys.argv[3], 'wb') as fout: + + with open(sys.argv[1], 'rb') as f: + data_flash = f.read() + fout.write(data_flash) + print('flash ', len(data_flash)) + + pad = b'\xff' * (0x10000 - len(data_flash)) + fout.write(pad) + print('padding ', len(pad)) + + with open(sys.argv[2], 'rb') as f: + data_rom = f.read() + fout.write(data_rom) + print('irom0text', len(data_rom)) + + print('total ', 0x10000 + len(data_rom)) |
