From 44148c9238c930aa9a262ef5c67860442b73073b Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Wed, 12 Feb 2025 16:33:22 +0100 Subject: [PATCH] test: Add debug log --- espflash/src/connection/mod.rs | 2 ++ espflash/src/flasher/mod.rs | 1 + espflash/tests/scripts/board-info.sh | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/espflash/src/connection/mod.rs b/espflash/src/connection/mod.rs index b6e297a7..a780a54a 100644 --- a/espflash/src/connection/mod.rs +++ b/espflash/src/connection/mod.rs @@ -96,6 +96,8 @@ impl TryFrom> for SecurityInfo { type Error = crate::error::Error; fn try_from(res: Vec) -> Result { + println!("res_len: {}", res.len()); + let esp32s2 = res.len() == 16; // 12 bytes + 4-byte header if res.len() < 12 { diff --git a/espflash/src/flasher/mod.rs b/espflash/src/flasher/mod.rs index 8c8a969a..6152865b 100644 --- a/espflash/src/flasher/mod.rs +++ b/espflash/src/flasher/mod.rs @@ -1174,6 +1174,7 @@ impl Flasher { let response = connection.command(crate::command::Command::GetSecurityInfo)?; // Extract raw bytes and convert them into `SecurityInfo` if let crate::connection::CommandResponseValue::Vector(data) = response { + println!("{:?}", data); SecurityInfo::try_from(data) } else { Err(Error::InvalidResponse) diff --git a/espflash/tests/scripts/board-info.sh b/espflash/tests/scripts/board-info.sh index c28b11d5..5a74cdd9 100755 --- a/espflash/tests/scripts/board-info.sh +++ b/espflash/tests/scripts/board-info.sh @@ -1,12 +1,14 @@ #!/usr/bin/env bash +espflash reset + # Run the command and capture output and exit code result=$(espflash board-info) exit_code=$? echo "$result" # Extract chip type -chip_type=$(awk -F': *' '/Chip type:/ {print $2}' <<< "$result" | awk '{print $1}') +chip_type=$(awk -F': *' '/Chip type:/ {print $2}' <<<"$result" | awk '{print $1}') if [[ "$chip_type" == "esp32" ]]; then # ESP32 doesn't support get_security_info