Skip to content

Commit

Permalink
Build MCUboot using sysbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
leonrinkel committed Oct 16, 2023
1 parent d8fca30 commit b5af9df
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 28 deletions.
25 changes: 0 additions & 25 deletions BOOTLOADER.md

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ west update
## Building

```sh
west build -b sam_fd sam-fd-sdk/app
west build --sysbuild -b sam_fd sam-fd-sdk/app
```

## Flashing
Expand All @@ -28,13 +28,13 @@ west flash --runner pyocd

### Via Serial Recovery

Serial recovery mode can be entered by running a command like the following immediately after resetting. This requires a MCUboot bootloader. Please see [BOOTLOADER.md](BOOTLOADER.md) for instructions on building one.
Serial recovery mode can be entered by running a command like the following immediately after resetting.

```sh
mcumgr \
--conntype serial \
--connstring dev=/dev/cu.usbserial-110,baud=115200 \
image upload -e build/zephyr/zephyr.signed.bin
image upload -e build/app/zephyr/zephyr.signed.bin
```

## License
Expand Down
5 changes: 5 additions & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(app LANGUAGES C)

# Verify that this samnple is built through sysbuild to ensure MCUboot is
# automatically included and that sample specific MCUboot configurations are
# used when building MCUboot.
test_sysbuild()

target_sources(app PRIVATE src/main.c)
1 change: 1 addition & 0 deletions app/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sample:
description: Example application
name: example-application
common:
sysbuild: true
build_only: true
integration_platforms:
- sam_fd
Expand Down
2 changes: 2 additions & 0 deletions app/sysbuild.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SB_CONFIG_BOOTLOADER_MCUBOOT=y
SB_CONFIG_BOOT_SIGNATURE_TYPE_NONE=y
10 changes: 10 additions & 0 deletions app/sysbuild/mcuboot.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CONFIG_SINGLE_APPLICATION_SLOT=y
CONFIG_BOOT_SIGNATURE_TYPE_NONE=y
CONFIG_BOOT_VALIDATE_SLOT0=n
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_MCUBOOT_SERIAL=y
CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_BOOT_SERIAL_WAIT_FOR_DFU=y
CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT=500
CONFIG_BOOT_ERASE_PROGRESSIVELY=y

0 comments on commit b5af9df

Please sign in to comment.