Skip to content

Commit

Permalink
test: Add debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Feb 12, 2025
1 parent 364eb23 commit 44148c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions espflash/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ impl TryFrom<Vec<u8>> for SecurityInfo {
type Error = crate::error::Error;

fn try_from(res: Vec<u8>) -> Result<Self, Self::Error> {
println!("res_len: {}", res.len());

let esp32s2 = res.len() == 16; // 12 bytes + 4-byte header

if res.len() < 12 {
Expand Down
1 change: 1 addition & 0 deletions espflash/src/flasher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion espflash/tests/scripts/board-info.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 44148c9

Please sign in to comment.