Skip to content

Commit 6b3dfe2

Browse files
committed
Removed dependency on bootutil. Starting from a new clean-room update design
1 parent 281b460 commit 6b3dfe2

18 files changed

Lines changed: 15 additions & 3382 deletions

File tree

Makefile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@ LSCRIPT:=hal/$(TARGET).ld
1717

1818
OBJS:= \
1919
./hal/$(TARGET).o \
20-
./lib/bootutil/src/loader.o \
21-
./lib/bootutil/src/image_validate.o \
22-
./lib/bootutil/src/bootutil_misc.o \
20+
./src/loader.o \
2321
./src/mem.o \
24-
./src/keys.o \
2522
./src/crypto.o \
2623
./src/wolfboot.o \
27-
./src/main.o \
24+
./src/image.o \
2825
./lib/wolfssl/wolfcrypt/src/sha256.o \
2926
./lib/wolfssl/wolfcrypt/src/hash.o \
3027
./lib/wolfssl/wolfcrypt/src/wolfmath.o \
@@ -41,12 +38,12 @@ ifeq ($(SIGN),ED25519)
4138
./lib/wolfssl/wolfcrypt/src/ed25519.o \
4239
./lib/wolfssl/wolfcrypt/src/ge_low_mem.o \
4340
./src/ed25519_pub_key.o
44-
CFLAGS+=-DBOOT_SIGN_ED25519
41+
CFLAGS+=-DWOLFBOOT_SIGN_ED25519
4542
endif
4643

4744
ifeq ($(SIGN),EC256)
4845
OBJS+= ./ext/wolfssl/wolfcrypt/src/ecc.o
49-
CFLAGS+=-DBOOT_SIGN_EC256
46+
CFLAGS+=-DWOLFBOOT_SIGN_EC256
5047
endif
5148

5249
ifeq ($(DEBUG),1)

NOTICE

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
wolfSSL Secure Bootloader
33

44
wolfBoot is a portable, OS-agnostic, secure bootloader solution for 32-bit microcontrollers,
5-
relying on wolfCrypt for firmware authentication, and a modified version of
6-
[mcuboot](https://www.mcuboot.com/)'s *bootutil* library to implement firmware upgrade mechanisms.
5+
relying on wolfCrypt for firmware authentication, providing firmware upgrade mechanisms.
76

87
Due to the minimalist design of the bootloader and the tiny HAL API, wolfBoot is completely independent
98
from any OS or bare-metal application, and can be easily ported and integrated in existing embedded software
@@ -32,8 +31,9 @@ with no dynamic memory allocation mechanism or linkage to any standard C library
3231

3332
The core application depends on the following libraries:
3433
- wolfCrypt, which is used to verify the Ed25519 signature of the images
35-
- A modified version of mcuboot's bootutil, to handle the firmware image slots and the upgrade state-machine
3634
- A minimalist Hardware Abstraction Layer, with an implementation provided for the supported target, which is in charge for IAP flash access and clock setting on the specific MCU
35+
- The core bootloader
36+
- A small application library to interact with the bootloader
3737

3838
The goal of this application is to perform image verification and/or requested firmware upgrade tasks
3939
before chain-loading the actual firmware from a specific location in flash.

docs/HAL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In order to run wolfBoot on a target microcontroller, an implementation of the H
44
must be provided.
55

66
The HAL only purposes are allowing write/erase operations from the bootloader
7-
and the application initiating the firmware upgrade through the bootutil library, and
7+
and the application initiating the firmware upgrade through the application library, and
88
ensuring that the MCU is running at full speed during boot, to optimize the
99
verification of the signatures.
1010

include/bootutil.h

Lines changed: 0 additions & 69 deletions
This file was deleted.

include/flash.h

Lines changed: 0 additions & 136 deletions
This file was deleted.

include/target.h

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
11
#ifndef H_TARGETS_TARGET_
22
#define H_TARGETS_TARGET_
33

4-
#define FLASH_DEV_NAME "flash"
5-
#define FLASH_ALIGN 4
64

75
/* Example flash partitioning.
86
* Ensure that your firmware entry point is
97
* at FLASH_AREA_IMAGE_0_OFFSET + 0x100
108
*/
11-
#define FLASH_AREA_IMAGE_0_OFFSET 0x20000
12-
#define FLASH_AREA_IMAGE_0_SIZE 0x20000
13-
#define FLASH_AREA_IMAGE_1_OFFSET 0x40000
14-
#define FLASH_AREA_IMAGE_1_SIZE 0x20000
15-
#define FLASH_AREA_IMAGE_SCRATCH_OFFSET 0x60000
16-
#define FLASH_AREA_IMAGE_SCRATCH_SIZE 0x20000
9+
#define WOLFBOOT_SECTOR_SIZE 0x20000
10+
#define WOLFBOOT_PARTITION_SIZE 0x20000
1711

18-
/*
19-
* Sanity check the target support.
20-
*/
21-
#if !defined(FLASH_DEV_NAME) || \
22-
!defined(FLASH_ALIGN) || \
23-
!defined(FLASH_AREA_IMAGE_0_OFFSET) || \
24-
!defined(FLASH_AREA_IMAGE_0_SIZE) || \
25-
!defined(FLASH_AREA_IMAGE_1_OFFSET) || \
26-
!defined(FLASH_AREA_IMAGE_1_SIZE)
27-
#error "Target support is incomplete; cannot build wolfboot."
28-
#endif
12+
#define WOLFBOOT_PARTITION_BOOT_ADDRESS 0x20000
13+
#define WOLFBOOT_PARTITION_UPDATE_ADDRESS 0x40000
14+
#define WOLFBOOT_PARTITION_SWAP_ADDRESS 0x60000
2915

3016
#endif

0 commit comments

Comments
 (0)