-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6b82b1
commit 45297fd
Showing
2 changed files
with
41 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
result=$(espflash erase-region 0x1000 0x1000 2>&1) | ||
echo "$result" | ||
if [[ ! $result =~ "Erasing region at" ]]; then | ||
exit 1 | ||
fi | ||
result=$(espflash read-flash 0x1000 0x2000 flash_content.bin 2>&1) | ||
echo "$result" | ||
if [[ ! $result =~ "Flash content successfully read and written to" ]]; then | ||
exit 1 | ||
fi | ||
# Check first 0x1000 bytes are FF | ||
if head -c 4096 flash_content.bin | hexdump -v -e '/1 "%02x"' | grep -qv '^ff*$'; then | ||
echo "First 0x1000 bytes should be empty (FF)" | ||
exit 1 | ||
fi | ||
# Check next 0x1000 bytes contain some non-FF bytes | ||
if ! tail -c 4096 flash_content.bin | hexdump -v -e '/1 "%02x"' | grep -q '[0-e]'; then | ||
echo "Next 0x1000 bytes should contain some non-FF bytes" | ||
exit 1 | ||
fi | ||
echo "Flash contents verified!" |