Fixes for stm32wb test

- added img->hdr_ok flag when opening external flash image
- correct return value for uart_flash ext_flash functions
- correct image size in prepare_encrypte_update.sh
pull/263/head
Daniele Lacamera 2022-12-16 16:13:16 +01:00 committed by Daniele Lacamera
parent b1d7c43043
commit 4ee867b2dd
5 changed files with 18 additions and 17 deletions

View File

@ -1,6 +1,6 @@
MEMORY MEMORY
{ {
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = @BOOTLOADER_PARTITION_SIZE@ FLASH (rx) : ORIGIN = 0x08000000, LENGTH = @BOOTLOADER_PARTITION_SIZE@
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
} }

View File

@ -906,6 +906,7 @@ int wolfBoot_open_image(struct wolfBoot_image *img, uint8_t part)
image = fetch_hdr_cpy(img); image = fetch_hdr_cpy(img);
else else
image = (uint8_t *)img->hdr; image = (uint8_t *)img->hdr;
img->hdr_ok = 1;
return wolfBoot_open_image_address(img, image); return wolfBoot_open_image_address(img, image);
} }

View File

@ -91,7 +91,7 @@ int ext_flash_write(uintptr_t address, const uint8_t *data, int len)
if (wait_ack() != 0) if (wait_ack() != 0)
return -1; return -1;
} }
return 0; return len;
} }
int ext_flash_read(uintptr_t address, uint8_t *data, int 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; return 0;
uart_tx(CMD_ACK); uart_tx(CMD_ACK);
} }
return 0; return i;
} }
int ext_flash_erase(uintptr_t address, int len) int ext_flash_erase(uintptr_t address, int len)

View File

@ -6,8 +6,8 @@ if [ -f "./tools/keytools/sign" ]; then
fi fi
# SIZE is WOLFBOOT_PARTITION_SIZE - 49 (44B: key + nonce, 5B: "pBOOT") # SIZE is WOLFBOOT_PARTITION_SIZE - 49 (44B: key + nonce, 5B: "pBOOT")
#SIZE=131023 SIZE=131023
SIZE=65487 #SIZE=65487
VERSION=8 VERSION=8
APP=test-app/image_v"$VERSION"_signed_and_encrypted.bin APP=test-app/image_v"$VERSION"_signed_and_encrypted.bin

View File

@ -883,27 +883,27 @@ test-all: clean
test-size-all: test-size-all:
make test-size SIGN=NONE LIMIT=4683 make test-size SIGN=NONE LIMIT=4683
make keysclean make keysclean
make test-size SIGN=ED25519 LIMIT=11308 make test-size SIGN=ED25519 LIMIT=11312
make keysclean make keysclean
make test-size SIGN=ECC256 LIMIT=22166 make test-size SIGN=ECC256 LIMIT=22174
make keysclean 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 keysclean
make test-size SIGN=RSA2048 LIMIT=11094 make test-size SIGN=RSA2048 LIMIT=11106
make keysclean 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 keysclean
make test-size SIGN=RSA4096 LIMIT=11454 make test-size SIGN=RSA4096 LIMIT=11464
make keysclean 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 keysclean
make test-size SIGN=ECC384 LIMIT=17504 make test-size SIGN=ECC384 LIMIT=17512
make keysclean 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 keysclean
make test-size SIGN=ED448 LIMIT=13346 make test-size SIGN=ED448 LIMIT=13355
make keysclean make keysclean
make test-size SIGN=RSA3072 LIMIT=11294 make test-size SIGN=RSA3072 LIMIT=11304
make keysclean make keysclean
make test-size SIGN=RSA3072 NO_ASM=1 LIMIT=11166 make test-size SIGN=RSA3072 NO_ASM=1 LIMIT=11178
make keysclean make keysclean