Skip to content

Conversation

icewind1991
Copy link
Member

Move the flash logic to a FlashTarget trait which can be customized per chip.

This is used to implement compression support for esp32 targets.

@jessebraham
Copy link
Member

Awesome! Just out of curiosity which devices has this been tested on, if any?

@icewind1991
Copy link
Member Author

it worked on my esp32 and c3

@MabezDev
Copy link
Member

MabezDev commented Sep 9, 2021

Before this PR:

cargo +esp-dev espflash --example blinky /dev/tty.usbserial-0001
    Finished dev [unoptimized + debuginfo] target(s) in 0.24s
[00:00:02] ########################################      27/27      segment 0x1000
[00:00:00] ########################################       3/3       segment 0x8000
[00:00:13] ########################################     139/139     segment 0x10000

With this PR:

cargo +esp-dev espflash --example blinky /dev/tty.usbserial-0001
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Serial port: /dev/tty.usbserial-0001
Connecting...

[00:00:01] ########################################      16/16      segment 0x1000
[00:00:00] ########################################       1/1       segment 0x8000
[00:00:05] ########################################      49/49      segment 0x10000

Nice!

Edit: this is with an esp32.

Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me overall, thank you again. I did leave one comment, but it's not a huge deal.

For the ESP32-C3:

jesse@mbp ~/W/esp32c3-experiments master ✚1…1
λ cargo espflash /dev/cu.usbserial-14210                                                                                                                       2021-09-10 09:05:04
   Compiling esp32c3 v0.1.0 (/Users/jesse/Work/esp32c3-experiments)
    Finished dev [unoptimized + debuginfo] target(s) in 0.55s
Serial port: /dev/cu.usbserial-14210
Connecting...

[00:00:02] ########################################      20/20      segment 0x0
[00:00:00] ########################################       3/3       segment 0x8000
[00:00:02] ########################################      28/28      segment 0x10000
jesse@mbp ~/W/esp32c3-experiments master ✚1…1
λ cargo espflash /dev/cu.usbserial-14210                                                                                                                       2021-09-10 09:05:14
   Compiling esp32c3 v0.1.0 (/Users/jesse/Work/esp32c3-experiments)
    Finished dev [unoptimized + debuginfo] target(s) in 0.40s
Serial port: /dev/cu.usbserial-14210
Connecting...

[00:00:01] ########################################      12/12      segment 0x0
[00:00:00] ########################################       1/1       segment 0x8000
[00:00:01] ########################################      13/13      segment 0x10000

I'm just assuming it's still working for the ESP8266; unfortunately esp8266-hal needs updating so I am not able to build a binary with the most recent toolchain.

@icewind1991 icewind1991 merged commit eae7b16 into master Sep 10, 2021
@icewind1991 icewind1991 deleted the flash-targets branch September 10, 2021 20:18
@jessebraham jessebraham mentioned this pull request Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants