File tree 2 files changed +8
-20
lines changed
2 files changed +8
-20
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ tools.esptool.upload.params.quiet=
149
149
# First, potentially perform an erase or nothing
150
150
# Next, do the binary upload
151
151
# Combined in one rule because Arduino doesn't suport upload.1.pattern/upload.3.pattern
152
- tools.esptool.upload.pattern="{cmd}" "{runtime.platform.path}/tools/upload.py" --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" {upload.erase_cmd} {upload.resetmethod} "{build.path}/{build.project_name}.bin"
152
+ tools.esptool.upload.pattern="{cmd}" "{runtime.platform.path}/tools/upload.py" --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" {upload.erase_cmd} {upload.resetmethod} write_flash 0x0 "{build.path}/{build.project_name}.bin"
153
153
154
154
tools.esptool.upload.network_pattern="{network_cmd}" "{runtime.platform.path}/tools/espota.py" -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin"
155
155
Original file line number Diff line number Diff line change 39
39
# https://github.com/esp8266/Arduino/issues/6755#issuecomment-553208688
40
40
if thisarg == "erase_flash" :
41
41
write_option = '--erase-all'
42
- thisarg = ''
43
-
44
- if thisarg == 'erase_region' :
42
+ elif thisarg == 'erase_region' :
45
43
erase_addr = sys .argv .pop (0 )
46
44
erase_len = sys .argv .pop (0 )
47
- thisarg = ''
48
-
49
- # Backwards compatibility with fs upload tools, eat --end
50
- if thisarg == '--end' :
51
- thisarg = ''
52
-
53
- # Backwards compatibility with fs upload tools, parse write_flash for later use
54
- if thisarg == 'write_flash' :
45
+ elif thisarg == '--end' :
46
+ # Backwards compatibility with fs upload tools, eat --end
47
+ pass
48
+ elif thisarg == 'write_flash' :
55
49
write_addr = sys .argv .pop (0 )
56
50
binary = sys .argv .pop (0 )
57
- thisarg = ''
58
-
59
- if os .path .isfile (thisarg ):
60
- binary = thisarg
61
- thisarg = ''
62
-
63
- if len (thisarg ):
51
+ elif len (thisarg ):
64
52
cmdline = cmdline + [thisarg ]
65
53
66
54
cmdline = cmdline + ['write_flash' ]
70
58
71
59
erase_file = ''
72
60
if len (erase_addr ):
73
- # generate temporary empty (0xff) file
61
+ # Generate temporary empty (0xff) file
74
62
eraser = tempfile .mkstemp ()
75
63
erase_file = eraser [1 ]
76
64
os .write (eraser [0 ], bytearray ([255 ] * int (erase_len , 0 )))
You can’t perform that action at this time.
0 commit comments