Skip to content

Commit 1db4189

Browse files
authored
Merge pull request #431 from danielinux/update-wolfssl-v5.7.0
Updated submodules: wolfSSL-v5.7.0 + wolfTPM latest
2 parents 1ba099a + 737ecaf commit 1db4189

File tree

16 files changed

+220
-26
lines changed

16 files changed

+220
-26
lines changed

.github/workflows/footprint.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ jobs:
1717

1818
# Get the arm-non-eabi-gcc toolchain
1919
- name: Install arm-none-eabi-gcc
20-
uses: fiam/arm-none-eabi-gcc@v1
21-
with:
22-
# The arm-none-eabi-gcc release to use.
23-
release: "9-2019-q4"
20+
run : |
21+
sudo apt-get install -y gcc-arm-none-eabi
2422
2523
- name: make clean
2624
run: |
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Wolfboot Reusable Build Workflow
2+
3+
on:
4+
5+
workflow_call:
6+
inputs:
7+
arch:
8+
required: true
9+
type: string
10+
config-file:
11+
required: true
12+
type: string
13+
make-args:
14+
required: false
15+
type: string
16+
17+
jobs:
18+
19+
build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
submodules: true
26+
27+
- name: Workaround for sources.list
28+
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list
29+
30+
- name: Update repository
31+
run: sudo apt-get update
32+
33+
- name: Install cross compilers
34+
run: |
35+
sudo apt-get install -y gcc-arm-none-eabi gcc-aarch64-linux-gnu gcc-powerpc-linux-gnu gnu-efi
36+
37+
- name: Create lib hash-sigs
38+
run: |
39+
mkdir -p lib/hash-sigs/lib
40+
41+
- name: Clone hash-sigs repository
42+
run: |
43+
git clone https://github.com/cisco/hash-sigs.git lib/hash-sigs/src && \
44+
cd lib/hash-sigs/src && git checkout b0631b8891295bf2929e68761205337b7c031726 && \
45+
git apply ../../../tools/lms/0001-Patch-to-support-wolfBoot-LMS-build.patch && \
46+
cd ../../..
47+
48+
- name: make clean
49+
run: |
50+
make distclean
51+
52+
- name: Select config
53+
run: |
54+
cp ${{inputs.config-file}} .config
55+
56+
- name: Build tools
57+
run: |
58+
make -C tools/keytools && make -C tools/bin-assemble
59+
60+
- name: Build wolfboot
61+
run: |
62+
make ${{inputs.make-args}}

.github/workflows/test-build-sim-tpm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626
jobs:
2727

2828
build:
29-
runs-on: ubuntu-20.04
29+
runs-on: ubuntu-latest
3030

3131
steps:
3232
# setup ibmswtpm2

.github/workflows/test-configs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,18 @@ jobs:
169169
arch: arm
170170
config-file: ./config/examples/stm32c0.config
171171

172+
stm32c0-rsa248:
173+
uses: ./.github/workflows/test-build.yml
174+
with:
175+
arch: arm
176+
config-file: ./config/examples/stm32c0-rsa2048.config
177+
178+
stm32c0-lms-8-10-1:
179+
uses: ./.github/workflows/test-build-lms.yml
180+
with:
181+
arch: arm
182+
config-file: ./config/examples/stm32c0-lms-8-10-1.config
183+
172184
stm32f4_small_blocks_uart_update_test:
173185
uses: ./.github/workflows/test-build.yml
174186
with:

.github/workflows/test-custom-tlv-simulator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
custom_tlv_simulator_tests:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-latest
1212

1313
steps:
1414
- uses: actions/checkout@v3

.github/workflows/test-powerfail-simulator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
powerfail_simulator_tests:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-latest
1212

1313
steps:
1414
- uses: actions/checkout@v3
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
ARCH?=ARM
2+
TARGET?=stm32c0
3+
SIGN?=LMS
4+
LMS_LEVELS=1
5+
LMS_HEIGHT=10
6+
LMS_WINTERNITZ=8
7+
IMAGE_SIGNATURE_SIZE=1456
8+
IMAGE_HEADER_SIZE=2048
9+
HASH?=SHA256
10+
DEBUG?=0
11+
VTOR?=1
12+
CORTEX_M0?=1
13+
NO_ASM?=0
14+
NO_MPU?=1
15+
EXT_FLASH?=0
16+
SPI_FLASH?=0
17+
ALLOW_DOWNGRADE?=0
18+
NVM_FLASH_WRITEONCE?=1
19+
WOLFBOOT_VERSION?=0
20+
V?=0
21+
SPMATH?=1
22+
DUALBANK_SWAP?=0
23+
24+
# Enable this to support wolfBoot self-update
25+
RAM_CODE?=0
26+
27+
# Use slightly smaller SHA2-256
28+
CFLAGS_EXTRA+=-DUSE_SLOW_SHA256
29+
30+
# Enable this feature for secure memory support
31+
# Makes the flash sectors for the bootloader unaccessible from the application
32+
# Requires using the STM32CubeProgrammer to set FLASH_SECR -> SEC_SIZE pages
33+
#CFLAGS_EXTRA+=-DFLASH_SECURABLE_MEMORY_SUPPORT
34+
35+
36+
#Partition: Boot: 10KB, App, 10KB
37+
WOLFBOOT_PARTITION_SIZE?=0x2800
38+
WOLFBOOT_SECTOR_SIZE?=0x800
39+
#Max WOLFBOOT size is 10KB
40+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08002800
41+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x085000
42+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x08007800
43+
44+
#Example debugging partition for larger wolfBoot
45+
#Partition: Boot: 22KB, App, 4K
46+
#DEBUG?=1
47+
#WOLFBOOT_PARTITION_SIZE?=0x1000
48+
#WOLFBOOT_SECTOR_SIZE?=0x800
49+
#WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08005800
50+
#WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08006800
51+
#WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x08007800
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
ARCH?=ARM
2+
TARGET?=stm32c0
3+
SIGN?=RSA2048
4+
HASH?=SHA256
5+
DEBUG?=0
6+
VTOR?=1
7+
CORTEX_M0?=1
8+
NO_ASM?=0
9+
NO_MPU?=1
10+
EXT_FLASH?=0
11+
SPI_FLASH?=0
12+
ALLOW_DOWNGRADE?=0
13+
NVM_FLASH_WRITEONCE?=1
14+
WOLFBOOT_VERSION?=0
15+
V?=0
16+
SPMATH?=1
17+
DUALBANK_SWAP?=0
18+
19+
# Enable this to support wolfBoot self-update
20+
RAM_CODE?=0
21+
22+
# Use slightly smaller SHA2-256
23+
CFLAGS_EXTRA+=-DUSE_SLOW_SHA256
24+
25+
# Enable this feature for secure memory support
26+
# Makes the flash sectors for the bootloader unaccessible from the application
27+
# Requires using the STM32CubeProgrammer to set FLASH_SECR -> SEC_SIZE pages
28+
#CFLAGS_EXTRA+=-DFLASH_SECURABLE_MEMORY_SUPPORT
29+
30+
31+
#Partition: Boot: 12KB, App, 8KB
32+
WOLFBOOT_PARTITION_SIZE?=0x2000
33+
WOLFBOOT_SECTOR_SIZE?=0x800
34+
#Max WOLFBOOT size is 10KB
35+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08003000
36+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08005000
37+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x08007800
38+
39+
#Example debugging partition for larger wolfBoot
40+
#Partition: Boot: 22KB, App, 4K
41+
#DEBUG?=1
42+
#WOLFBOOT_PARTITION_SIZE?=0x1000
43+
#WOLFBOOT_SECTOR_SIZE?=0x800
44+
#WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08005800
45+
#WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08006800
46+
#WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x08007800

config/examples/stm32c0.config

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
ARCH?=ARM
22
TARGET?=stm32c0
3-
#Supports ED25519/SHA384 or RSA2048/SHA256
4-
SIGN?=RSA2048
5-
HASH?=SHA256
3+
SIGN?=ED25519
4+
HASH?=SHA384
65
DEBUG?=0
76
VTOR?=1
87
CORTEX_M0?=1

docs/Targets.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,13 @@ mon reset init
444444
Supports STM32C0x0/STM32C0x1. Instructions are for the STM Nucleo-C031C6 dev board.
445445

446446
Tested build configurations:
447-
* With RSA2048 and SHA2-256 the code size is 9724 and it boots in under 1 second.
447+
* With RSA2048 and SHA2-256 the code size is 10988 and it boots in under 1 second.
448448
* With ED25519 and SHA2-384 the code size is 10024 and takes about 10 seconds for the LED to turn on.
449+
* With LMS-8-10-1 and SHA2-256 the code size is 8164 on gcc-13 (could fit in 8KB partition)
449450

450-
Example 32KB partitioning on STM32-G070:
451+
### Example 32KB partitioning on STM32-G070
452+
453+
with ED25519 or LMS-8-10-1:
451454

452455
- Sector size: 2KB
453456
- Wolfboot partition size: 10KB
@@ -462,11 +465,28 @@ Example 32KB partitioning on STM32-G070:
462465
#define WOLFBOOT_PARTITION_SWAP_ADDRESS 0x08007800 /* at 30KB */
463466
```
464467

468+
with RSA2048:
469+
470+
- Sector size: 2KB
471+
- Wolfboot partition size: 12KB
472+
- Application partition size: 8 KB
473+
- Swap size 2KB
474+
475+
```C
476+
#define WOLFBOOT_SECTOR_SIZE 0x800 /* 2 KB */
477+
#define WOLFBOOT_PARTITION_BOOT_ADDRESS 0x08003000 /* at 12KB */
478+
#define WOLFBOOT_PARTITION_SIZE 0x2000 /* 8 KB */
479+
#define WOLFBOOT_PARTITION_UPDATE_ADDRESS 0x08005000 /* at 20KB */
480+
#define WOLFBOOT_PARTITION_SWAP_ADDRESS 0x08007800 /* at 30KB */
481+
```
482+
465483
### Building STM32C0
466484

467-
Reference configuration (see [/config/examples/stm32c0.config](/config/examples/stm32c0.config)).
485+
Reference configuration files (see [config/examples/stm32c0.config](/config/examples/stm32c0.config),
486+
[config/examples/stm32c0-rsa2048.config](/config/examples/stm32c0-rsa2048.config) and
487+
[config/examples/stm32c0-lms-8-10-1.config](/config/examples/stm32c0-lms-8-10-1.config)).
468488

469-
You can copy this to wolfBoot root as `.config`: `cp ./config/examples/stm32c0.config .config`.
489+
You can copy one of these to wolfBoot root as `.config`: `cp ./config/examples/stm32c0.config .config`.
470490
To build you can use `make`.
471491

472492
The TARGET for this is `stm32c0`: `make TARGET=stm32c0`.

0 commit comments

Comments
 (0)