Skip to content

About

Verified ESP32-S3 firmware flashing from Go and the browser, powered by a shared Rust core.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

CodeCraft Flash

简体中文 · Usage guide · Benchmarks

Flash an ESP32-S3 factory image from a Go CLI or a Chrome page. Both clients run the same Rust engine, check the image against its manifest and verify the device's MD5 before resetting the board.

Performance against stock flashers

On one Wio Tracker L2, each tool flashed the same 813,792-byte factory BIN three times over native USB at a configured 115200 baud. All runs verified the device MD5 and reset the board. Times are medians within each interface.

Interface Stock baseline CodeCraft Flash rc.8 Less elapsed time
Go CLI Espressif Python esptool 5.7.0 · 6.91 s Native Rust · 6.72 s 2.7%
Chrome Stock npm esptool-js 0.5.7 used by SenseCraft App · 9.08 s Rust WASM · 6.84 s 24.7%

The browser baseline loaded the original npm bundle. It was byte-identical to the installed SenseCraft App dependency, with no application acceleration patch loaded.

For the 385,008-byte Watcher desktop clock, median full-flash time across three runs at 3 Mbaud was 5.67 s in the native CLI and 5.56 s in Chrome. All six device MD5 checks passed. Espressif’s hosted web flasher and stock CLI did not finish the image on this Watcher. Desktop clock measurements

On the 12,482,033-byte Watcher image at 3 Mbaud, median full-flash time across three runs was 78.89 s in the native CLI and 80.99 s in Chrome. All six runs verified the device MD5. Espressif’s hosted web flasher at all four available rates and its stock Python CLI did not complete this image, so a relative Watcher speedup is unavailable. Measurements and reproduction

What you can do

  • Program a complete merged factory BIN, or select sector-aligned ranges for a partial update.
  • Verify selected ranges without writing. Enable full byte readback when you need evidence beyond device MD5.
  • Stream progress and structured diagnostics to a CLI or browser. Retry events identify the affected Flash interval and the protocol error.
  • Generate a manifest from a local BIN or paste a deployment JSON. Firmware that implements serial-json-v1 can accept typed settings after flashing and prove that they survived reboot.

Install v0.1.0

The Go SDK includes native cores for macOS and Linux on arm64 and amd64. Native flashing requires cgo and a C compiler. Linux also needs the libudev development files. Install the TypeScript package from the GitHub Release.

go get github.com/Seeed-Studio/codecraft-flash/go@v0.1.0
npm install https://github.com/Seeed-Studio/codecraft-flash/releases/download/v0.1.0/seeed-studio-codecraft-flash-0.1.0.tgz

Quick start

From a checkout on macOS arm64 with Rust, Go and a C linker:

bash scripts/build-native.sh
./dist/codecraft-flash targets
./dist/codecraft-flash describe --target esp-idf/wio-tracker-l2 firmware.bin > manifest.json
./dist/codecraft-flash plan manifest.json

After confirming the board and its serial port, set PORT and run:

./dist/codecraft-flash flash --port "$PORT" --progress manifest.json firmware.bin

The usage guide covers the browser test page, installation of @seeed-studio/codecraft-flash, the Go SDK, logging, readback and application configuration.

Device coverage

The catalog contains eight ESP32-S3 board profiles. Wio Tracker L2 and SenseCAP Watcher were tested on physical hardware. All eight profiles passed simulated ROM write and verify tests. Watcher uses the bottom USB-C ESP interface. SenseCAP Indicator requires an explicit dx or gx variant. The SDK accepts unsigned, unencrypted merged factory images. Application configuration depends on the firmware's own protocol support.

Manifest schema · Example deployment · Rust CLI · Espressif stub attribution

License

CodeCraft Flash is licensed under Apache-2.0. Third-party components retain their respective licenses. See the Espressif RAM stub attribution.

About

Verified ESP32-S3 firmware flashing from Go and the browser, powered by a shared Rust core.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages