Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 2a59831

Browse files
committed
Fix the stub, FlashDeflateEnd was incorrectly sized
1 parent 93483e7 commit 2a59831

File tree

6 files changed

+16
-27
lines changed

6 files changed

+16
-27
lines changed

Cargo.lock

Lines changed: 0 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ exclude = [".github/", "esptool.patch"]
99

1010
[dependencies]
1111
critical-section = "1.1.1"
12-
esp-backtrace = { version = "0.4.0", optional = true, features = ["exception-handler", "panic-handler", "print-uart"] }
1312
esp32-hal = { version = "0.7.0", optional = true }
1413
esp32c2-hal = { version = "0.2.0", optional = true }
1514
esp32c3-hal = { version = "0.4.0", optional = true }
@@ -33,11 +32,11 @@ mockall = "0.11.3"
3332
mockall_double = "0.3.0"
3433

3534
[features]
36-
esp32 = ["esp32-hal", "esp-backtrace/esp32"]
37-
esp32s2 = ["esp32s2-hal", "esp-backtrace/esp32s2"]
38-
esp32s3 = ["esp32s3-hal", "esp-backtrace/esp32s3"]
39-
esp32c3 = ["esp32c3-hal", "esp-backtrace/esp32c3"]
40-
esp32c2 = ["esp32c2-hal", "esp-backtrace/esp32c2"]
35+
esp32 = ["esp32-hal"]
36+
esp32s2 = ["esp32s2-hal"]
37+
esp32s3 = ["esp32s3-hal"]
38+
esp32c3 = ["esp32c3-hal"]
39+
esp32c2 = ["esp32c2-hal"]
4140
dprint = []
4241

4342
[profile.release]

src/commands.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub struct DataCommand {
8989
#[repr(C, packed(1))]
9090
pub struct EndFlashCommand {
9191
pub base: CommandBase,
92-
pub run_user_code: u32,
92+
pub reboot: bool,
9393
}
9494

9595
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -221,6 +221,7 @@ impl<'a> Response<'a> {
221221
}
222222

223223
pub fn error(&mut self, error: Error) {
224+
crate::dprintln!("Error: {:?}", error);
224225
self.status = 1;
225226
self.error = error as u8;
226227
}

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![no_main]
22
#![no_std]
33

4-
use esp_backtrace as _;
54
#[cfg(feature = "dprint")]
65
use flasher_stub::hal::serial::{
76
config::{Config, DataBits, Parity, StopBits},
@@ -82,3 +81,9 @@ fn main() -> ! {
8281
stub.process_command(data);
8382
}
8483
}
84+
85+
#[panic_handler]
86+
fn panic(_info: &core::panic::PanicInfo) -> ! {
87+
flasher_stub::dprintln!("STUB Panic: {:?}", _info);
88+
loop {}
89+
}

src/miniz_types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(non_camel_case_types)]
2+
13
const TINFL_MAX_HUFF_TABLES: usize = 3;
24
const TINFL_MAX_HUFF_SYMBOLS_0: usize = 288;
35
const TINFL_MAX_HUFF_SYMBOLS_1: usize = 32;

src/protocol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl<'a> Stub<'a> {
163163

164164
self.in_flash_mode = false;
165165

166-
if cmd.run_user_code == 1 {
166+
if cmd.reboot {
167167
self.send_response(response);
168168
self.target.delay_us(10_000);
169169
self.target.soft_reset();

0 commit comments

Comments
 (0)