A driver for the esp8266 onboard flash
  • Rust 83.1%
  • Shell 16.9%
Find a file
2020-08-30 02:42:00 +02:00
.cargo example and basic readme 2020-08-26 01:02:24 +02:00
examples use spi registers instead of rom functions 2020-08-30 02:42:00 +02:00
src use spi registers instead of rom functions 2020-08-30 02:42:00 +02:00
.gitignore init repo 2020-08-25 23:15:27 +02:00
Cargo.toml use spi registers instead of rom functions 2020-08-30 02:42:00 +02:00
flash_example example and basic readme 2020-08-26 01:02:24 +02:00
README.md example and basic readme 2020-08-26 01:02:24 +02:00
setenv example and basic readme 2020-08-26 01:02:24 +02:00

ESP8266-flash

A driver for the esp8266 onboard flash

Example

use esp8266_hal::target::Peripherals;
use esp8266_flash::ESPFlash;
use spi_memory::prelude::*;

let dp = unsafe { Peripherals::steal() };
let pins = dp.GPIO.split();
let mut flash = ESPFlash::new(dp.SPI0);

let mut buff = [0u8; 8];

flash.read(ADDR, &mut buff).unwrap();

buff[0] += 1;

flash.erase_sectors(ADDR, 1).unwrap();

flash.write_bytes(ADDR, &mut buff).unwrap();

Flashing the example

In order to flash the example program

  • Edit setenv to point to RUSTC
  • Connect the esp8266 over usb
  • run flash_example
  • check the output using picocom --baud 115200 /dev/ttyUSB0

See the xtensa-rust-quickstart for more information.