Skip to content

Commit

Permalink
Merge pull request #369 from danielinux/armv8m-asm
Browse files Browse the repository at this point in the history
Enable sp_math assembly optimizations for cortex-m33
  • Loading branch information
dgarske authored Sep 20, 2023
2 parents ec59410 + 1121a1c commit c337847
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
7 changes: 6 additions & 1 deletion arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ ifeq ($(ARCH),ARM)
CFLAGS += -mcmse
endif
ifeq ($(SPMATH),1)
MATH_OBJS += ./lib/wolfssl/wolfcrypt/src/sp_c32.o
ifeq ($(NO_ASM),1)
MATH_OBJS += ./lib/wolfssl/wolfcrypt/src/sp_c32.o
else
CFLAGS+=-DWOLFSSL_SP_ASM -DWOLFSSL_SP_ARM_CORTEX_M_ASM
MATH_OBJS += ./lib/wolfssl/wolfcrypt/src/sp_cortexm.o
endif
endif
else
ifeq ($(CORTEX_M7),1)
Expand Down
6 changes: 3 additions & 3 deletions config/examples/stm32l5-nonsecure-dualbank.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ V?=0
SPMATH?=1
RAM_CODE?=0
DUALBANK_SWAP?=1
WOLFBOOT_PARTITION_SIZE?=0x38000
WOLFBOOT_PARTITION_SIZE?=0x36000
WOLFBOOT_SECTOR_SIZE?=0x800
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08008000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08048000
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x0800a000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x0804a000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xFFFFFFFF
6 changes: 3 additions & 3 deletions config/examples/stm32u5-nonsecure-dualbank.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ V?=0
SPMATH?=1
RAM_CODE?=0
DUALBANK_SWAP?=1
WOLFBOOT_PARTITION_SIZE?=0x38000
WOLFBOOT_PARTITION_SIZE?=0x36000
WOLFBOOT_SECTOR_SIZE?=0x2000
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08008000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08108000
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x0800a000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x0810a000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xFFFFFFFF
14 changes: 11 additions & 3 deletions docs/Targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,18 @@ To run flash `./test-app/image.bin` to `0x08000000`.
Or program each partition using:
1. flash `wolfboot.bin` to 0x08000000:
- `STM32_Programmer_CLI -c port=swd -d ./wolfboot.elf`
2. flash wolfBoot.bin to 0x0c00 0000
- `STM32_Programmer_CLI -c port=swd -d ./test-app/image_v1_signed.bin 0x08008000`
2. flash main application to 0x0800 a000
- `STM32_Programmer_CLI -c port=swd -d ./test-app/image_v1_signed.bin 0x0800a000`

RED LD9 will be on indicating successful boot ().

Updates can be flashed at 0x0804a000:

- `STM32_Programmer_CLI -c port=swd -d ./test-app/image_v2_signed.bin 0x0804a000`

The two partition are logically remapped by using BANK_SWAP capabilities. This partition
swap is immediate and does not require a SWAP partition.

RED LD9 will be on indicating successful boot ()

### Debugging

Expand Down

0 comments on commit c337847

Please sign in to comment.