Skip to content

Commit ffc7a43

Browse files
jpbland1danielinux
authored andcommitted
add powerfail during final sector erase, exposing
the problems of losing the encryption key when the power fails before the key can be written back, failing to select the correct NVM_FLASH_WRITEONCE sector when a sector is corrupt, and losing the testing state when the power fails before the partition state can be set. these issues are addressed in the next commit
1 parent d27fc91 commit ffc7a43

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tools/scripts/sim-update-powerfail-resume.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ fi
99
./wolfboot.elf powerfail 15000 get_version 2>/dev/null
1010
./wolfboot.elf powerfail 18000 get_version 2>/dev/null
1111
./wolfboot.elf powerfail 1a000 get_version 2>/dev/null
12+
# fail on the last sector to stop the encrypt key save and state update
13+
./wolfboot.elf powerfail 3e000 get_version 2>/dev/null
14+
./wolfboot.elf powerfail 3f000 get_version 2>/dev/null
1215

1316
V=`./wolfboot.elf get_version 2>/dev/null`
1417
if [ "x$V" != "x2" ]; then
@@ -20,6 +23,8 @@ fi
2023
./wolfboot.elf powerfail 11000 get_version 2>/dev/null
2124
./wolfboot.elf powerfail 14000 get_version 2>/dev/null
2225
./wolfboot.elf powerfail 1e000 get_version 2>/dev/null
26+
./wolfboot.elf powerfail 3e000 get_version 2>/dev/null
27+
./wolfboot.elf powerfail 3f000 get_version 2>/dev/null
2328

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

0 commit comments

Comments
 (0)