-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
/
unvendor-esptool.patch
263 lines (260 loc) · 14.4 KB
/
unvendor-esptool.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
diff --git a/RNS/Utilities/rnodeconf.py b/RNS/Utilities/rnodeconf.py
index 566df60..8f6201d 100755
--- a/RNS/Utilities/rnodeconf.py
+++ b/RNS/Utilities/rnodeconf.py
@@ -1453,18 +1453,17 @@ def main():
print("\nReady to extract firmware images from the RNode")
print("Press enter to start the extraction process")
input()
- extract_recovery_esptool()
hash_f = open(EXT_DIR+"/extracted_rnode_firmware.version", "wb")
hash_f.write(v_str.encode("utf-8"))
hash_f.close()
extraction_parts = [
- ("bootloader", "python \""+CNF_DIR+"/recovery_esptool.py\" --chip esp32 --port "+port_path+" --baud "+args.baud_flash+" --before default_reset --after hard_reset read_flash 0x1000 0x4650 \""+EXT_DIR+"/extracted_rnode_firmware.bootloader\""),
- ("partition table", "python \""+CNF_DIR+"/recovery_esptool.py\" --chip esp32 --port "+port_path+" --baud "+args.baud_flash+" --before default_reset --after hard_reset read_flash 0x8000 0xC00 \""+EXT_DIR+"/extracted_rnode_firmware.partitions\""),
- ("app boot", "python \""+CNF_DIR+"/recovery_esptool.py\" --chip esp32 --port "+port_path+" --baud "+args.baud_flash+" --before default_reset --after hard_reset read_flash 0xe000 0x2000 \""+EXT_DIR+"/extracted_rnode_firmware.boot_app0\""),
- ("application image", "python \""+CNF_DIR+"/recovery_esptool.py\" --chip esp32 --port "+port_path+" --baud "+args.baud_flash+" --before default_reset --after hard_reset read_flash 0x10000 0x200000 \""+EXT_DIR+"/extracted_rnode_firmware.bin\""),
- ("console image", "python \""+CNF_DIR+"/recovery_esptool.py\" --chip esp32 --port "+port_path+" --baud "+args.baud_flash+" --before default_reset --after hard_reset read_flash 0x210000 0x1F0000 \""+EXT_DIR+"/extracted_console_image.bin\""),
+ ("bootloader", "@esptool@ --chip esp32 --port "+port_path+" --baud "+args.baud_flash+" --before default_reset --after hard_reset read_flash 0x1000 0x4650 \""+EXT_DIR+"/extracted_rnode_firmware.bootloader\""),
+ ("partition table", "@esptool@ --chip esp32 --port "+port_path+" --baud "+args.baud_flash+" --before default_reset --after hard_reset read_flash 0x8000 0xC00 \""+EXT_DIR+"/extracted_rnode_firmware.partitions\""),
+ ("app boot", "@esptool@ --chip esp32 --port "+port_path+" --baud "+args.baud_flash+" --before default_reset --after hard_reset read_flash 0xe000 0x2000 \""+EXT_DIR+"/extracted_rnode_firmware.boot_app0\""),
+ ("application image", "@esptool@ --chip esp32 --port "+port_path+" --baud "+args.baud_flash+" --before default_reset --after hard_reset read_flash 0x10000 0x200000 \""+EXT_DIR+"/extracted_rnode_firmware.bin\""),
+ ("console image", "@esptool@ --chip esp32 --port "+port_path+" --baud "+args.baud_flash+" --before default_reset --after hard_reset read_flash 0x210000 0x1F0000 \""+EXT_DIR+"/extracted_console_image.bin\""),
]
import subprocess, shlex
for part, command in extraction_parts:
@@ -2290,25 +2289,12 @@ def main():
graceful_exit()
elif platform == ROM.PLATFORM_ESP32:
numeric_version = float(selected_version)
- flasher_dir = UPD_DIR+"/"+selected_version
- flasher = flasher_dir+"/esptool.py"
- if not os.path.isfile(flasher):
- if os.path.isfile(CNF_DIR+"/recovery_esptool.py"):
- import shutil
- if not os.path.isdir(flasher_dir):
- os.makedirs(flasher_dir)
- shutil.copy(CNF_DIR+"/recovery_esptool.py", flasher)
- RNS.log("No flasher present, using recovery flasher to write firmware to device")
-
- if os.path.isfile(flasher):
- import stat
- os.chmod(flasher, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP)
- if which(flasher) is not None:
+ if True:
if fw_filename == "rnode_firmware_tbeam.zip":
if numeric_version >= 1.55:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2326,7 +2312,7 @@ def main():
]
else:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2344,7 +2330,7 @@ def main():
elif fw_filename == "rnode_firmware_tbeam_sx1262.zip":
if numeric_version >= 1.55:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2362,7 +2348,7 @@ def main():
]
else:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2380,7 +2366,7 @@ def main():
elif fw_filename == "rnode_firmware_lora32v10.zip":
if numeric_version >= 1.59:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2398,7 +2384,7 @@ def main():
]
else:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2416,7 +2402,7 @@ def main():
elif fw_filename == "rnode_firmware_lora32v20.zip":
if numeric_version >= 1.55:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2434,7 +2420,7 @@ def main():
]
else:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2452,7 +2438,7 @@ def main():
elif fw_filename == "rnode_firmware_lora32v21.zip":
if numeric_version >= 1.55:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2470,7 +2456,7 @@ def main():
]
else:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2487,7 +2473,7 @@ def main():
]
elif fw_filename == "rnode_firmware_lora32v21_tcxo.zip":
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2506,7 +2492,7 @@ def main():
elif fw_filename == "rnode_firmware_heltec32v2.zip":
if numeric_version >= 1.55:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2524,7 +2510,7 @@ def main():
]
else:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2541,7 +2527,7 @@ def main():
]
elif fw_filename == "rnode_firmware_heltec32v3.zip":
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32-s3",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2559,7 +2545,7 @@ def main():
elif fw_filename == "rnode_firmware_featheresp32.zip":
if numeric_version >= 1.55:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2577,7 +2563,7 @@ def main():
]
else:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2595,7 +2581,7 @@ def main():
elif fw_filename == "rnode_firmware_esp32_generic.zip":
if numeric_version >= 1.55:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2613,7 +2599,7 @@ def main():
]
else:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2631,7 +2617,7 @@ def main():
elif fw_filename == "rnode_firmware_ng20.zip":
if numeric_version >= 1.55:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2649,7 +2635,7 @@ def main():
]
else:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2667,7 +2653,7 @@ def main():
elif fw_filename == "rnode_firmware_ng21.zip":
if numeric_version >= 1.55:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2685,7 +2671,7 @@ def main():
]
else:
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2702,7 +2688,7 @@ def main():
]
elif fw_filename == "rnode_firmware_t3s3.zip":
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32s3",
"--port", args.port,
"--baud", args.baud_flash,
@@ -2720,7 +2706,7 @@ def main():
]
elif fw_filename == "extracted_rnode_firmware.zip":
return [
- sys.executable, flasher,
+ "@esptool@",
"--chip", "esp32",
"--port", args.port,
"--baud", args.baud_flash,