Skip to content

Commit

Permalink
fix powerfail test to actually trigger, previously
Browse files Browse the repository at this point in the history
the test has been doing nothing but trigger the update and then fallback over and over again
  • Loading branch information
jpbland1 committed Aug 15, 2023
1 parent 98cbde7 commit a774da4
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 a774da4

Please sign in to comment.