1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

10 Commits

Author SHA1 Message Date
Earle F. Philhower, III
8565ac8fbc
Update to pyserial 3.5, esptool 3.0 (#7737)
Recent releases may work better with some newer MacOS releases
according to their commit logs.

Ensure esptool detects the flash size and doesn't use the one hardcoded
in the bootloader.  Thanks to @d-a-v for noticing the esptool change.
2020-12-01 17:41:23 -08:00
Earle F. Philhower, III
9afb084159
Clean up minor warnings from LGTM.com (#7500)
* Clean up minor warnings from LGTM.com

LGTM (Semmie) is a tool, bought by GitHub last year, that conducts basic
linting tasks on code and HTML.

Clean up the warnings identified in the latest report:
https://lgtm.com/projects/g/esp8266/Arduino/?mode=list

No functionality should change, however this may fix some issues with
the perl utilities not exiting properly on a Ctrl-C from the command
line.

* Back out HTML changes and rerun boards.txt.py
2020-08-03 19:19:04 -07:00
Earle F. Philhower, III
56fe2bfe73
[BREAKING] Update FS plugin info for python3 compat (#6807)
The FS uploader plugins need to be updated to use python3 and not
python, or they will fail on Windows (or Linux boxes without an
installed python2 interpreter).

Update the documents to point to the new versions.
2019-11-26 08:43:18 -07:00
Earle F. Philhower, III
dabf4c53d4 Make upload.py compatible with existing FS upload (#6788)
* Make upload.py compatible with existing FS upload

PR #6765 introduced an incompatibility with the existing Java uploaders
for SPIFFS and LittleFS,  breaking them because of the upload.py
parameter format change to support single stage erase/upload.

Add in patch to silently eat the single --end and to parse the write
address and filename properly as generated by calls from the plugins,
while retaining compatibility with the current IDE changes.

* Clean upload.py, make platform use write_flash

Make upload.py more concise and pythonic.

Use the "write_flash" argument in platform.txt for uploads instead of
assuming anything that is a file is the bin to upload.
2019-11-17 19:05:43 -03:00
david gauchard
b52c52791a a single esptool command for erasing and flashing (#6765)
* esptool: a single command for erasing and flashing
(and update to esptool-2.8)

* fixes per review
2019-11-14 02:46:20 -03:00
Earle F. Philhower, III
0a031ce957
Move all scripts and documentation to Python3 (#6378)
* Move all scripts and documentation to Python3

Python 2 EOL is Jan 1, 2020.  Migrate scripts to run under Python 3.

Under Windows, we're already running Python 3.7, by dumb luck.  The
oddness is that the Windows standalone executable for Python 3 is called
"python" whereas under UNIX-like OSes it's called "python3" with
"python" always referring to the Python 2 executable.  The ZIP needs to
be updated to include a Python3.exe (copy of Python.exe) so that we can
use the same command lines under Linux and Windows, and to preserve my
sanity.

Fixes #6376

* Add new Windows ZIP with python3.exe file

* Sort options in boards.txt generation for repeatability

The order of the board opts dict changes depending on the Python version
and machine, so sort the options before printing them to get a stable
ordering.

* Re-add Python2 compatibility tweaks

Most scripts can run as Python 2 or Python 3 with minimal changes, so
re-add (and fix, as necessary) compatibility tweaks to the scripts.
2019-08-28 12:42:48 -07:00
Tomoatsu Shimada
192aaa4291 Adjust python module search path to avoid picking up pre-existing pyserial/esptool instead of one under tools/ (#5854) 2019-03-09 09:35:30 -08:00
Earle F. Philhower, III
53f51b5811
Clean up uploader.py, use implied paths (#5805)
No need to explicitly send in full paths for esptool and pyserial Python
libs because they're in well known locations relative to upload.py.

Make upload.py calculate these on-the-fly and clean up platform.txt.
2019-02-21 21:40:45 +00:00
Earle F. Philhower, III
472faf73a2
Use Pythonic way of calling esptool, avoid fork(#5797)
Simply import the pyserial and esptool modules directly into upload.py
instead of trying to fake things with os.fork()s.  Reduces code and is
more Pythonic.
2019-02-21 19:03:15 +00:00
Earle F. Philhower, III
9790e1cb7c Use esptool.py to handle sketch upload, make python available on Windows, too (#5635)
* Add esptool.py, pyserial, and python to JSON

Add installation of python on Win32/Win64, and on all systems install
esptool.py and pyserial.

* Initial esptool.py upload test

* First successfull esptool.py upload

* Patch in verbose flag operation

* Replace esptool-ck.exe with Python equivalent

Remove need for binary esptool-ck.exe by implementing the same logic as
esptool-ck uses in Python.  Only image creation is supported, and only
in the Arduino standard mode (with its custom bootloader and ROM
layout).

* Remove all esptool-ck.exe, hook Windows Python

Remove all references to esptool-ck and use Python on Windows and Linux
for all recipes where possible.

* Use python to make core_version as well

Avoid ugly bash and CMD.exe tricks in platform.txt by using python to
make the core_version header.

* Rename conflicting script, clean up packager

* Windows test passes

Need to make sure Python2 and Python3 compatible and paths are munged
properly to avoid eaccidentally escaping things when calling esptool.py

Able to compile, build a BIN and upload via esptool.py on a Windows
machine without Python installed globally, only as part of the Arduino
tools package.

* Use github sources for pyserial

* Erase calibration or all flash before programming

Add back in erase support by calling esptool.py twice (since it does not
support chained operations like esptool-ck.exe).

* Make 460K default speed, remove 961K

961K doesn't seem to work with esptool, so make 460K the default upload
speed and remove 961K.

Even at this lower speed, esptool.py is much faster to upload (even
before taking into account the compression when doing things like SPIFFS
and code upload).

* Make erase and upload work again

Arduino does not support a upload.#.cmd pattern, so we need to do
everything in a single command line.  Make it cleaner by introducing a
Python wrapper script which will run the same executable with different
sets of commands (since we need to erase a block w/a separate invocation
from the real upload).

Update boards.txt to use the new options format, placing the esptool
command as "version" when there is no "erase_flash" or "erase_region" to
be done to keep things simple.

* Move esptool/pyserial to submodules

Since esptool.py and pyserial are coming directly from github repos,
there is no need to include them as a tool in package.json.

* Restore 921K upload opt, silent downgrade to 460k

To enable full backward compatibility, restore the 921k option for
upload speed but silently change it to 460k in the upload.py script.

Add error checking on upload.py
2019-02-18 13:43:09 +01:00