Coder Social home page Coder Social logo

esptool's Introduction

esptool

This is a work in progress and has not yet been fully tested I bundle my fluepdot firmware with this tool to ship a standalone update utility, which I prefer over remote code execution on customer HW OTA updates.

Compilation

go get github.com/fluepke/esptool
cd ${GOPATH-$HOME/go}/src/github.com/fluepke/esptool
go build
./esptool <args>

Usage

It only works on Linux as of right now, because Microsoft(r) Windows(tm)(c) does not support termios. Concerning MacOS: Buy me a macbook.

Esptool offers the following subcommands:

  • version: Show version info and exit
  • info: Retrieve various information from chip
  • flashRead: Read flash contents
  • flashWrite: Write flash contents

to see the help, type ./esptool <subcommand> -h

Examples

Read various information and the partition table from chip, then display them in JSON format:

./esptool info -serial.port /dev/ttyUSB0 -json
Click to see command output
{
  "ChipType": "ESP32D0WDQ6",
  "Revision": "1",
  "Features": [
    "240MHz",
    "WiFi",
    "Single Core",
    "VRef calibration in efuse",
    "Coding Scheme None",
    "Bluetooth"
  ],
  "MacAddress": "24:6f:28:92:ef:20",
  "Partitions": [
    {
      "name": "nvs",
      "type": "data",
      "subtype": "nvs",
      "Offset": 36864,
      "size": 16384
    },
    {
      "name": "otadata",
      "type": "data",
      "subtype": "factory",
      "Offset": 53248,
      "size": 8192
    },
    {
      "name": "phy_init",
      "type": "data",
      "subtype": "phy",
      "Offset": 61440,
      "size": 4096
    },
    {
      "name": "factory",
      "type": "app",
      "subtype": "factory",
      "Offset": 65536,
      "size": 3145728
    },
    {
      "name": "config",
      "type": "66",
      "subtype": "35",
      "Offset": 3211264,
      "size": 4096
    }
  ]
}

Write data to flash

./esptool flashWrite -flash.file=/home/fluepke/git/fluepdot/software/firmware/flipdot-firmware.bin -flash.offset=0x10000 -serial.port=/dev/ttyUSB0 -serial.baudrate.transfer=500000 -serial.baudrate.connect=115200

esptool's People

Contributors

fluepke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esptool's Issues

Question about porting

I took your code as a basis for my project of working with esp32 on different platforms.
I upped the version to 1.22 and used go.bug.st/serial to make it work with all platforms without any problems.
I work in linux and have checked autobuild in windows - everything works.

My questions:

  • Is there any reason (that I haven't come across yet) why you used github.com/pkg/term/termios?
  • Have you decrypted python esptool or used the documentation?

ESP8266 support

Hi, I'm currently studying the ESP chip serial protocol and I've found esptool to be a great reference.
Do you have any idea of implementation changes required to support ESP8266 with your tool.

Thanks

Compilation fails on FreeBSD

% go get github.com/fluepke/esptool
# github.com/fluepke/esptool/common/serial
go/src/github.com/fluepke/esptool/common/serial/ioctls.go:19:17: undefined: unix.TCSETS
go/src/github.com/fluepke/esptool/common/serial/serial_unix.go:95:17: undefined: unix.TCFLSH
go/src/github.com/fluepke/esptool/common/serial/serial_unix.go:119:12: undefined: unix.B500000
go/src/github.com/fluepke/esptool/common/serial/serial_unix.go:120:12: undefined: unix.B576000
go/src/github.com/fluepke/esptool/common/serial/serial_unix.go:122:12: undefined: unix.B1000000
go/src/github.com/fluepke/esptool/common/serial/serial_unix.go:123:12: undefined: unix.B1152000
go/src/github.com/fluepke/esptool/common/serial/serial_unix.go:124:12: undefined: unix.B1500000
go/src/github.com/fluepke/esptool/common/serial/serial_unix.go:125:12: undefined: unix.B2000000
go/src/github.com/fluepke/esptool/common/serial/serial_unix.go:126:12: undefined: unix.B2500000
go/src/github.com/fluepke/esptool/common/serial/serial_unix.go:127:12: undefined: unix.B3000000
go/src/github.com/fluepke/esptool/common/serial/serial_unix.go:127:12: too many errors

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.