Coder Social home page Coder Social logo

flash-esp's Introduction

Automated Micropython flashing and WebREPL script

Tools and resources for flashing the newest micropython firmware on an ESP chips over ftdi.

It also creates a wifi hotspot on the esp, with micropythoN as wifi acces code, and python as password for the REPL.

Installation

  • pip install pyserial
  • git clone [this repo]
  • download latest micropython binary
  • Update PORT constant in flash.py to match the usb device for your FTDI cable

Usage

  • Connect the board with FTDI wire.
  • pipenv run python3 flash.py
  • Press reset on the board while pressing the boot button.
  • Reset board without boot button pressed when flashing is done. The script asks for it. You have three seconds.

Build micropython from source

micropython latest [source here]https://micropython.org/download/ AMH library latest source here https://github.com/espressif/idf-eclipse-plugin/blob/master/README.md

ESP32:

ESP32 requires https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/ Micropython Build notes - https://github.com/micropython/micropython/tree/master/ports/esp32

docker run --rm -v -it $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk

docker run --rm -v $PWD:/project -w /project espressif/idf make -C mpy-cross
cd ports/esp32
docker run --rm -v $PWD:/project -w /project espressif/idf make submodules
docker run --rm -v $PWD:/project -w /project espressif/idf make BOARD=GENERIC_SPIRAM

esptool.py --baud 115200 --port /dev/cu.usbserial-1410 read_flash 0x0 0x400000 fw-backup-AMH.bin esptool.py --port /dev/tty.usbserial-1420 --baud 460800 write_flash --flash_size=detect -fm dio 0 AMH-fw-backup.bin

ESP8266:

ESP8266 requires https://github.com/pfalcon/esp-open-sdk Micropython Build notes https://github.com/micropython/micropython/tree/master/ports/esp8266

example build commands using docker: micropython source to a build directory and enter working directory cp PORTSETTINGS to build directory ports/ cp AMH-MPY-libraries to build directory ports/esp8266/modules/

docker run --rm -v $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk make -C mpy-cross
cd ports/esp8266
docker run --rm -v $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk make submodules
docker run --rm -v $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk make

however in docker you will not be able to use your attached USB esptool.py --port /dev/tty.SLAB_USBtoUART --baud 460800 write_flash --flash_size=detect -fm dio 0 firmware.bin

flash-esp's People

Contributors

antonvh avatar spudgunman avatar ste7anste7an avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.