@@ -52,12 +52,18 @@ test-update: test-app/image.bin FORCE
5252 (make test-reset && sleep 1 && st-flash --reset write test-update.bin 0x08040000)
5353
5454test-self-update : wolfboot.bin test-app/image.bin FORCE
55+ mv $(PRIVATE_KEY ) private_key.old
56+ @make clean
57+ @rm src/* _pub_key.c
58+ @make factory.bin RAM_CODE=1 WOLFBOOT_VERSION=$(WOLFBOOT_VERSION )
59+ @$(SIGN_TOOL ) test-app/image.bin $(PRIVATE_KEY ) $(TEST_UPDATE_VERSION )
60+ @st-flash --reset write test-app/image_v2_signed.bin 0x08020000 || \
61+ (make test-reset && sleep 1 && st-flash --reset write test-app/image_v2_signed.bin 0x08020000) || \
62+ (make test-reset && sleep 1 && st-flash --reset write test-app/image_v2_signed.bin 0x08020000)
5563 @dd if=/dev/zero bs=131067 count=1 2> /dev/null | tr " \000" " \377" > test-self-update.bin
56- @python3 $(SIGN_TOOL ) --wolfboot-update wolfboot.bin $( PRIVATE_KEY ) $(WOLFBOOT_VERSION )
64+ @python3 $(SIGN_TOOL ) --wolfboot-update wolfboot.bin private_key.old $(WOLFBOOT_VERSION )
5765 @dd if=wolfboot_v$(WOLFBOOT_VERSION ) _signed.bin of=test-self-update.bin bs=1 conv=notrunc
5866 @printf " pBOOT" >> test-self-update.bin
59- @make test-reset
60- @sleep 2
6167 @st-flash --reset write test-self-update.bin 0x08040000 || \
6268 (make test-reset && sleep 1 && st-flash --reset write test-self-update.bin 0x08040000) || \
6369 (make test-reset && sleep 1 && st-flash --reset write test-self-update.bin 0x08040000)
@@ -211,4 +217,19 @@ test-23-rollback-SPI: $(EXPVER) FORCE
211217 @make clean
212218 @echo TEST PASSED
213219
214- test-all : clean test-01-forward-update-no-downgrade test-02-forward-update-allow-downgrade test-03-rollback test-11-forward-update-no-downgrade-ECC test-13-rollback-ECC test-21-forward-update-no-downgrade-SPI test-23-rollback-SPI
220+ test-34-forward-self-update : $(EXPVER ) FORCE
221+ @make test-erase-ext
222+ @echo Creating and uploading factory image...
223+ @make test-factory RAM_CODE=1
224+ @echo Expecting version ' 1'
225+ @$$(test `$(EXPVER ) ` -eq 1 )
226+ @echo
227+ @echo Updating keys, firmware, bootloader
228+ @make test-self-update WOLFBOOT_VERSION=4 RAM_CODE=1
229+ @sleep 2
230+ @$$(test `$(EXPVER ) ` -eq 2 )
231+ @make clean
232+ @echo TEST PASSED
233+
234+
235+ test-all : clean test-01-forward-update-no-downgrade test-02-forward-update-allow-downgrade test-03-rollback test-11-forward-update-no-downgrade-ECC test-13-rollback-ECC test-21-forward-update-no-downgrade-SPI test-23-rollback-SPI test-34-forward-self-update
0 commit comments