Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change(legacy_stub): Update information about the legacy stub #68

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![MSRV](https://img.shields.io/badge/MSRV-1.76-blue?labelColor=1C2C2E&logo=Rust&style=flat-square)
[![Matrix](https://img.shields.io/matrix/esp-rs:matrix.org?label=join%20matrix&color=BEC5C9&labelColor=1C2C2E&logo=matrix&style=flat-square)](https://matrix.to/#/#esp-rs:matrix.org)

Rust implementation of flasher stub located in [esptool](https://github.com/espressif/esptool/).
Rust implementation of the [esptool flasher stub](https://github.com/espressif/esptool-legacy-flasher-stub/).

Supports the ESP32, ESP32-C2/C3/C6, ESP32-H2, and ESP32-S2/S3. Currently, `UART` and `USB Serial JTAG` are the supported transport modes, and support for other modes is planned.

Expand Down Expand Up @@ -64,9 +64,10 @@ In order to run `test_esptool.py` follow steps below:
```
- Copy the stub JSON files into `esptool` installation. You can use the following one-liner:
```bash
for n in esp*.json; do cp $n $ESPTOOL_PATH/esptool/targets/stub_flasher/stub_flasher_${n#esp}; done
for n in esp*.json; do cp $n $ESPTOOL_PATH/esptool/targets/stub_flasher/2/$n; done
```
where `ESPTOOL_PATH` is set to the location where you have cloned `esptool`.
- Set `ESPTOOL_STUB_VERSION` environment variable to `2`.
- Run tests
```bash
cd $ESPTOOL_PATH/test
Expand Down
2 changes: 1 addition & 1 deletion src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl<T: InputIO> Stub<T> {
}

fn process_begin(&mut self, cmd: &BeginCommand) -> Result<(), Error> {
// Align erase addreess to sector boundady.
// Align erase address to sector boundary.
self.erase_addr = cmd.offset & FLASH_SECTOR_MASK;
self.write_addr = cmd.offset;
self.end_addr = cmd.offset + cmd.total_size;
Expand Down
2 changes: 1 addition & 1 deletion src/targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct RomSpiFlashChip {

// ROM SPIFLASH functions can be found here:
// https://github.com/espressif/esp-idf/tree/master/components/esp_rom or
// https://github.com/espressif/esptool/tree/master/flasher_stub/ld
// https://github.com/espressif/esptool-legacy-flasher-stub/tree/master/flasher_stub/ld
#[allow(unused)]
extern "C" {
fn esp_rom_spiflash_erase_chip() -> i32;
Expand Down