add test to demonstrate that NVM_FLASH_WRITEONCE

is calling nvm_select_fresh_sector on a potentially external partition, which will fail and crashes the simulator. the next commit will hold the fix
pull/340/head
John Bland 2023-08-15 02:48:18 -04:00
parent db032d1461
commit 20184d2b24
2 changed files with 58 additions and 0 deletions

View File

@ -225,3 +225,41 @@ jobs:
run: |
tools/scripts/sim-update-powerfail-resume.sh
# TEST with encryption (aes128) and NVM_WRITEONCE
- name: make clean
run: |
make keysclean && make -C tools/keytools clean && rm -f include/target.h
- name: Select config with encrypted updates
run: |
cp config/examples/sim-encrypt-nvm-writeonce-update.config .config
- name: Build key tools
run: |
make -C tools/keytools
- name: Build bin assemble
run: |
make -C tools/bin-assemble
- name: Build wolfboot.elf
run: |
make clean && make test-sim-external-flash-with-enc-update
- name: Run sunny day update test (AES128 NVM_WRITEONCE)
run: |
tools/scripts/sim-sunnyday-update.sh
- name: Rebuild wolfboot.elf
run: |
make clean && make test-sim-external-flash-with-enc-update
- name: Run update-revert test (AES128 NVM_WRITEONCE)
run: |
tools/scripts/sim-update-fallback.sh
- name: Rebuild wolfboot.elf
run: |
make clean && make test-sim-external-flash-with-enc-update
- name: Run update-revert test with power failures (AES128 NVM_WRITEONCE)
run: |
tools/scripts/sim-update-powerfail-resume.sh
- name: Rebuild wolfboot.elf
run: |
make clean && make test-sim-external-flash-with-enc-update
- name: Run update-revert test with progressive power failures (AES128 NVM_WRITEONCE)
run: |
tools/scripts/sim-update-powerfail-resume-nvm-writeonce.sh

View File

@ -0,0 +1,20 @@
ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
SPI_FLASH=0
EXT_FLASH=1
ENCRYPT=1
ENCRYPT_WITH_AES128=1
DEBUG=1
# it should be multiple of system page size
NVM_FLASH_WRITEONCE=1
WOLFBOOT_PARTITION_SIZE=0x40000
WOLFBOOT_SECTOR_SIZE=0x1000
WOLFBOOT_PARTITION_BOOT_ADDRESS=0xC0020000
# if on external flash, it should be multiple of system page size
WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x00000
WOLFBOOT_PARTITION_SWAP_ADDRESS=0x40000
# required for keytools
WOLFBOOT_FIXED_PARTITIONS=1