We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efb8aa0 commit a621333Copy full SHA for a621333
esp8266/makeimg.py
@@ -1,4 +1,5 @@
1
import sys
2
+import struct
3
4
SEGS_MAX_SIZE = 0x9000
5
@@ -11,13 +12,16 @@
11
12
fout.write(data_flash)
13
print('flash ', len(data_flash))
14
15
+ with open(sys.argv[2], 'rb') as f:
16
+ data_rom = f.read()
17
+
18
pad = b'\xff' * (SEGS_MAX_SIZE - len(data_flash))
- fout.write(pad)
19
+ assert len(pad) >= 4
20
+ fout.write(pad[:-4])
21
+ fout.write(struct.pack("I", SEGS_MAX_SIZE + len(data_rom)))
22
print('padding ', len(pad))
23
- with open(sys.argv[2], 'rb') as f:
- data_rom = f.read()
- fout.write(data_rom)
- print('irom0text', len(data_rom))
24
+ fout.write(data_rom)
25
+ print('irom0text', len(data_rom))
26
27
print('total ', SEGS_MAX_SIZE + len(data_rom))
0 commit comments