summaryrefslogtreecommitdiff
path: root/esp8266/makeimg.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-11-27 20:30:33 +0000
committerDamien George <damien.p.george@gmail.com>2014-11-27 20:30:33 +0000
commit075d597464be619475535930de2f36abe69176f8 (patch)
tree286b765fb8e3c3dc1c741eb825fd7ef49e7e4946 /esp8266/makeimg.py
parent2399aa03b81e6a23f0b2719196c07101884222be (diff)
esp8266: New port of Micro Python to ESP8266 wifi module.
Diffstat (limited to 'esp8266/makeimg.py')
-rw-r--r--esp8266/makeimg.py21
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))