diff --git a/hal/stm32wb.ld b/hal/stm32wb.ld index 991b9f7a..14dd5aad 100644 --- a/hal/stm32wb.ld +++ b/hal/stm32wb.ld @@ -1,6 +1,6 @@ MEMORY { - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = @BOOTLOADER_PARTITION_SIZE@ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = @BOOTLOADER_PARTITION_SIZE@ RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000 } diff --git a/src/image.c b/src/image.c index 616128f1..0ff6015f 100644 --- a/src/image.c +++ b/src/image.c @@ -906,6 +906,7 @@ int wolfBoot_open_image(struct wolfBoot_image *img, uint8_t part) image = fetch_hdr_cpy(img); else image = (uint8_t *)img->hdr; + img->hdr_ok = 1; return wolfBoot_open_image_address(img, image); } diff --git a/src/uart_flash.c b/src/uart_flash.c index 4b159e7f..4aa24a6e 100644 --- a/src/uart_flash.c +++ b/src/uart_flash.c @@ -91,7 +91,7 @@ int ext_flash_write(uintptr_t address, const uint8_t *data, int len) if (wait_ack() != 0) return -1; } - return 0; + return len; } int ext_flash_read(uintptr_t address, uint8_t *data, int len) @@ -118,7 +118,7 @@ int ext_flash_read(uintptr_t address, uint8_t *data, int len) return 0; uart_tx(CMD_ACK); } - return 0; + return i; } int ext_flash_erase(uintptr_t address, int len) diff --git a/tools/scripts/prepare_encrypted_update.sh b/tools/scripts/prepare_encrypted_update.sh index 82b6eeac..1b3661ec 100755 --- a/tools/scripts/prepare_encrypted_update.sh +++ b/tools/scripts/prepare_encrypted_update.sh @@ -6,8 +6,8 @@ if [ -f "./tools/keytools/sign" ]; then fi # SIZE is WOLFBOOT_PARTITION_SIZE - 49 (44B: key + nonce, 5B: "pBOOT") -#SIZE=131023 -SIZE=65487 +SIZE=131023 +#SIZE=65487 VERSION=8 APP=test-app/image_v"$VERSION"_signed_and_encrypted.bin diff --git a/tools/test.mk b/tools/test.mk index cb7cf49b..80c8a995 100644 --- a/tools/test.mk +++ b/tools/test.mk @@ -883,27 +883,27 @@ test-all: clean test-size-all: make test-size SIGN=NONE LIMIT=4683 make keysclean - make test-size SIGN=ED25519 LIMIT=11308 + make test-size SIGN=ED25519 LIMIT=11312 make keysclean - make test-size SIGN=ECC256 LIMIT=22166 + make test-size SIGN=ECC256 LIMIT=22174 make keysclean - make test-size SIGN=ECC256 NO_ASM=1 LIMIT=13598 + make test-size SIGN=ECC256 NO_ASM=1 LIMIT=13608 make keysclean - make test-size SIGN=RSA2048 LIMIT=11094 + make test-size SIGN=RSA2048 LIMIT=11106 make keysclean - make test-size SIGN=RSA2048 NO_ASM=1 LIMIT=11066 + make test-size SIGN=RSA2048 NO_ASM=1 LIMIT=11074 make keysclean - make test-size SIGN=RSA4096 LIMIT=11454 + make test-size SIGN=RSA4096 LIMIT=11464 make keysclean - make test-size SIGN=RSA4096 NO_ASM=1 LIMIT=11374 + make test-size SIGN=RSA4096 NO_ASM=1 LIMIT=11384 make keysclean - make test-size SIGN=ECC384 LIMIT=17504 + make test-size SIGN=ECC384 LIMIT=17512 make keysclean - make test-size SIGN=ECC384 NO_ASM=1 LIMIT=15036 + make test-size SIGN=ECC384 NO_ASM=1 LIMIT=15044 make keysclean - make test-size SIGN=ED448 LIMIT=13346 + make test-size SIGN=ED448 LIMIT=13355 make keysclean - make test-size SIGN=RSA3072 LIMIT=11294 + make test-size SIGN=RSA3072 LIMIT=11304 make keysclean - make test-size SIGN=RSA3072 NO_ASM=1 LIMIT=11166 + make test-size SIGN=RSA3072 NO_ASM=1 LIMIT=11178 make keysclean