Skip to content

Commit

Permalink
Merge pull request #341 from jpbland1/powerfail-test-fix
Browse files Browse the repository at this point in the history
fix powerfail test to actually trigger, previously
  • Loading branch information
dgarske authored Aug 15, 2023
2 parents 98cbde7 + a774da4 commit 5bc1f09
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion hal/sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int hal_flash_erase(uintptr_t address, int len)
{
/* implicit cast abide compiler warning */
fprintf(stderr, "hal_flash_erase addr %p len %d\n", (void*)address, len);
if (address == erasefail_address) {
if (address == erasefail_address + WOLFBOOT_PARTITION_BOOT_ADDRESS) {
fprintf(stderr, "POWER FAILURE\n");
/* Corrupt page */
memset((void*)address, 0xEE, len);
Expand Down
2 changes: 0 additions & 2 deletions tools/scripts/sim-update-powerfail-resume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ fi
./wolfboot.elf powerfail 15000 get_version 2>/dev/null
./wolfboot.elf powerfail 18000 get_version 2>/dev/null
./wolfboot.elf powerfail 1a000 get_version 2>/dev/null
./wolfboot.elf get_version 2>/dev/null

V=`./wolfboot.elf get_version 2>/dev/null`
if [ "x$V" != "x2" ]; then
Expand All @@ -19,7 +18,6 @@ fi
./wolfboot.elf powerfail 11000 get_version 2>/dev/null
./wolfboot.elf powerfail 14000 get_version 2>/dev/null
./wolfboot.elf powerfail 1e000 get_version 2>/dev/null
./wolfboot.elf get_version 2>/dev/null

V=`./wolfboot.elf get_version 2>/dev/null`
if [ "x$V" != "x1" ]; then
Expand Down

0 comments on commit 5bc1f09

Please sign in to comment.