Description
The ESP8266 Arduino package 2.5.2 contains an invalid upload command template that fails the upload when using verbose mode.
The following line in platform.txt causes the problem:
tools.esptool.upload.pattern="{cmd}" "{runtime.platform.path}/tools/upload.py" --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" {upload.erase_cmd} --end --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" write_flash 0x0 "{build.path}/{build.project_name}.bin" --end
This expands to the following:
<...>\tools\python\3.7.2-post1\python "<...>\hardware\esp8266\2.5.2/tools/upload.py" --chip esp8266 --port "COM5" --baud "115200" "-vv" version --end --chip esp8266 --port "COM5" --baud "115200" "-vv" write_flash 0x0 "<...>.ino.bin" --end
The "-vv" ends up being passed to upload.py instead of the Python itself, causing the following error:
esptool: error: unrecognized arguments: -vv
Modifying the pattern as shown below solves the problem:
tools.esptool.upload.pattern="{cmd}" "{upload.verbose}" "{runtime.platform.path}/tools/upload.py" --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" {upload.erase_cmd} --end --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" write_flash 0x0 "{build.path}/{build.project_name}.bin" --end