Skip to content

Commit 84a422e

Browse files
committed
Crude POC for flash ESP app images instead of ELF files (esp-rs#770)
1 parent a559957 commit 84a422e

File tree

6 files changed

+108
-19
lines changed

6 files changed

+108
-19
lines changed

Diff for: Cargo.lock

+104-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: espflash/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ defmt-parser = { version = "=0.4.1", features = ["unstable"], optional = true
3838
dialoguer = { version = "0.11.0", optional = true }
3939
directories = { version = "5.0.1", optional = true }
4040
env_logger = { version = "0.11.6", optional = true }
41-
esp-idf-part = "0.5.0"
41+
esp-idf-part = { version = "0.5.0", git = "https://github.com/esp-rs/esp-idf-part", rev = "8cb16c0254d8299fe5a4a692e460f73844e024bf" }
4242
flate2 = "1.0.35"
4343
hex = { version = "0.4.3", features = ["serde"] }
4444
indicatif = { version = "0.17.9", optional = true }

Diff for: espflash/src/bin/espflash.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use espflash::image_format;
12
use std::{
23
fs::{self, File},
34
io::Read,

Diff for: espflash/src/elf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use std::{
99
};
1010

1111
use xmas_elf::{
12-
program::Type,
1312
sections::{SectionData, ShType},
1413
ElfFile,
1514
};

Diff for: espflash/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub mod flasher;
3939
pub mod image_format;
4040
pub mod targets;
4141

42-
mod elf;
42+
pub mod elf;
4343
mod error;
4444

4545
// Command-line interface

Diff for: espflash/src/targets/flash_target/esp32.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use flate2::{
44
write::{ZlibDecoder, ZlibEncoder},
55
Compression,
66
};
7-
use log::{info, warn};
7+
use log::info;
88
use md5::{Digest, Md5};
99

1010
#[cfg(feature = "serialport")]
@@ -159,12 +159,6 @@ impl FlashTarget for Esp32Target {
159159
.try_into()
160160
})?;
161161

162-
if addr == 0x10000 {
163-
warn!("Writing!");
164-
std::fs::write("/home/avee/projects/xldata/flash/segment_md5_bin", &segment.data).unwrap();
165-
}
166-
info!("MD5 checksum: {:?}", checksum_md5);
167-
info!("Flash MD5 checksum: {:?}", flash_checksum_md5.to_be_bytes());
168162
if checksum_md5.as_slice() == flash_checksum_md5.to_be_bytes() {
169163
info!(
170164
"Segment at address '0x{:x}' has not changed, skipping write",

0 commit comments

Comments
 (0)