Crates.io | d1-mini |
lib.rs | d1-mini |
version | 0.2.0 |
source | src |
created_at | 2020-08-23 21:23:33.545931 |
updated_at | 2020-09-23 19:08:24.33808 |
description | A Board Support Package (BSP) which provides a type-safe API for the WEMOS/LOLIN D1 mini |
homepage | |
repository | https://github.com/jessebraham/d1-mini |
max_upload_size | |
id | 279929 |
size | 33,312 |
A Board Support Package (BSP) which provides a type-safe API for the WEMOS/LOLIN D1 mini.
NOTE: This crate's dependencies are still in the early stages of development, and various features may be incomplete or missing altogether. With this being pre-1.0
software, the public API is subject to change at any time.
Because the Xtensa target is not officially supported, you must build a custom version of Rust. For more information on this process, please refer the the rust-xtensa project's README, which has detailed instructions for most popular operating systems.
There are currently three viable options for cross-compilation:
cargo
(using the unstable build-std
feature)Select one (or more) from the above list, and ensure they are installed.
To build the examples, you will need the Xtensa toolchain. You can download pre-built binaries from Espressif, or build them yourself using esp-open-sdk. In either case, make sure that the resulting binaries are in your $PATH
.
You can then build all examples at once, or just build one at a time:
$ xargo build --release --examples
$ xargo build --release --example=blinky
espflash is a community developed tool (written entirely in Rust) for flashing ESP32- and ESP8266-based devices. It provides a CLI tool for flashing the aforementioned devices as well as an additional crate, cargo-espflash, which provides a cargo subcommand which compiles and flashes your device with one command.
For more information on these tools, please refer to their respective README
s.
Make sure you replace <PORT>
with the appropriate value prior to running either of the below commands.
Using espflash
:
$ espflash <PORT> target/xtensa-esp8266-none/release/examples/blinky
Using cargo-espflash
:
$ cargo espflash --release --example=blinky --chip=esp8266 --tool=xargo <PORT>
You can use the official tool from Espressif, esptool.py, to flash the firmware to your device. Make sure this has been installed and esptool.py
is available in your $PATH
.
First convert the ELF-formatted binary to a flashable image:
$ esptool.py \
> --chip esp8266 \
> elf2image \
> target/xtensa-esp8266-none/release/examples/blinky
Then you're ready to flash the image to the device; make sure you replace <PORT>
with the appropriate value prior to running the command:
$ esptool.py \
> --port <PORT> \
> write_flash \
> -fm dio \
> -fs 32m \
> 0x00000 \
> target/xtensa-esp8266-none/release/examples/blinky-0x00000.bin
Licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.