Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: ESP32 support, version 2.0 refactoring #121

Merged
merged 103 commits into from Jan 10, 2017

Conversation

projectgus
Copy link
Contributor

@projectgus projectgus commented Sep 1, 2016

Work in progress to support ESP32 and a large amount of refactoring. Includes breaking changes compared to esptool.py v1.x (which will still be supported.)

New

  • Supports ESP32.
  • Compressed uploads on both ESP8266 & ESP32. Very fast!
  • Automated tests, both off-device elf2image tests and on-device tests using esptool.py
  • Software bootloader stub now speaks a variant of the ROM bootloader protocol. This means that the same esptool.py code can be used to talk to both ROM bootloaders and stubs. The --no-stub argument can be used to disable stub loading. Not all functionality is available without the stub (as the ROM bootloaders don't support all of esptool.py's commands.)
  • elf2image no longer shells out to binutils for ELF information, ELF headers are parsed directly.
  • elf2image no longer relies on special symbols like _data_start, or even names of ELF sections. Sections are identified based on their load addresses. This means linker scripts can be a lot more varied than was previously possible.
  • Flash sizes are specified in megabytes (ie -fs 4MB). Old megabit style (ie -fs 16m) prints a deprecation warning.

Still TODO for version 2:

  • Stub error handling needs work.
  • Stub doesn't correctly reset or run the program after esptool.py runs.
  • Stub code should be refactored into multiple files.
  • elf2image outputs have changed due to new ELF parsing. Work for ESP32 and ESP8266 in some simple tests, but need to be more completely tested and the test cases updated.
  • esptool.py --no-stub write_image -z uses zlib compression on ESP32. ESP32 & ESP8266 stubs do not yet support compressed writes.
  • ESP32 flash size options are a work in progress, currently all images get default sizes.
  • Class hierarchy of ESPROM/ESPxxxROM/ESPxxxStubLoader is clunky due to the patchwork set of features supported in each combination. Needs refactoring.
  • Split ELF & image generation features out of esptool.py into a new espimage.py
  • write_image should no longer edit the image header in flash by default. Either make a standalone command to write a new flash size, or require re-processing the binary via espimage.py.
  • Test cases for flash sizes. Need clear errors if data is too big for programmed flash size, etc.
  • Test cases for common error scenarios.
  • README is out of date.
  • Format "debug" messages in output better, better compressed ratio/performance output.
  • pep8 fails.

projectgus and others added 25 commits August 4, 2016 22:10
Test runner supports esp32 but currently not enabled.
This brings performance up to slightly better than V1.1 levels.
#else
#include <stdint.h>
#include <stdbool.h>
#define NULL ((void *)0) /*FIXME*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include <stddef.h>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I had a mental blank on what this header was called!

Works on ESP8266 & ESP32 (ESP32 has miniz in ROM, ESP8266 it's compiled
into the stub.)

Using compression is currently faster on ESP8266 but roughly same on
ESP32, due to slower ESP32 default clock speed.
@ghost
Copy link

ghost commented Dec 14, 2016

Is it still possible to rely on non-vendored versions of those modules third party modules?

The vendored modules are going to make it difficult to properly package esptool for various linux distributions like Debian, Ubuntu,and Fedora.

@projectgus
Copy link
Contributor Author

Is it still possible to rely on non-vendored versions of those modules third party modules?

Yes, at least this is intended (and I should explain this in the README, once I get around to updating it!)

The third-party modules are named in setup.py install_requires, with the idea being that if you install via pip, or setup.py install, then you can use Python "system" modules for these. If you run esptool by cloning the repo (which a lot of people do, and it's currently how we include it in esp-idf) then you use the vendored copies.

With Python 3 support coming, we may be able to some day reasonably expect that everyone has pip (hooray!) so it may be enough to have a requirements.txt and a note in the README. That would be nice.

@projectgus projectgus force-pushed the feature/esp32_v20_refactor branch 2 times, most recently from 42c2b0b to 02d23ce Compare December 20, 2016 07:02
Includes support for soft_reset aka "run user code" on ESP32.
In line with the revision numbers in the ESP32 ECO document.
Merge commit 'cda4f2b5e5bc09571b55c4b5e6b1c9f5ec349514' into feature/esp32_v20_refactor
@projectgus projectgus force-pushed the feature/esp32_v20_refactor branch 3 times, most recently from 4603c7a to 5f64329 Compare January 9, 2017 06:48
2.0-dev has been in use for some time, so this helps differentiate log
output.

Not actually a release.
@projectgus projectgus merged commit a0231c2 into master Jan 10, 2017
@projectgus projectgus deleted the feature/esp32_v20_refactor branch January 10, 2017 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants