forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nrf fromlist] samples: Added a minimal MCUBoot integration test
From upstream zephyrproject-rtos#13672 Added a minimal integration test for MCUBoot. It has just enough coverage to catch build issues. Which is better than before (no coverage in the Zephyr CI). Signed-off-by: Sebastian Bøe <[email protected]> (cherry picked from commit 1937b41)
- Loading branch information
1 parent
b4d8e6d
commit 026bd21
Showing
8 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.13.1) | ||
|
||
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) | ||
project(mcuboot) | ||
|
||
target_sources(app PRIVATE src/main.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.. _mcuboot_sample: | ||
|
||
MCUBoot Sample | ||
############## | ||
|
||
Overview | ||
******** | ||
A simple hello world sample that is booted by the bootloader | ||
MCUBoot. This sample can be used with any platform that supports | ||
MCUBoot. | ||
|
||
Building and Running | ||
******************** | ||
|
||
This project outputs output from the bootloader and then 'Hello World' | ||
from the application. It can be built and executed on nRF52_pca10040 | ||
as follows: | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/mcuboot | ||
:host-os: unix | ||
:board: nrf52_pca10040 | ||
:goals: run | ||
:compact: | ||
|
||
Sample Output | ||
============= | ||
|
||
.. code-block:: console | ||
***** Booting Zephyr OS v1.14.0-rc1-447-gb30b83a6eb ***** | ||
[00:00:00.004,638] <inf> mcuboot: Starting bootloader | ||
[00:00:00.011,505] <inf> mcuboot: Image 0: magic=unset, copy_done=0x3, image_ok=0x3 | ||
[00:00:00.020,690] <inf> mcuboot: Scratch: magic=unset, copy_done=0xe0, image_ok=0x3 | ||
[00:00:00.029,998] <inf> mcuboot: Boot source: slot 0 | ||
[00:00:00.039,062] <inf> mcuboot: Swap type: none | ||
[00:00:00.132,904] <inf> mcuboot: Bootloader chainload address offset: 0xc000 | ||
[00:00:00.141,479] <inf> mcuboot: Jumping to the first image slot | ||
***** Booting Zephyr OS v1.14.0-rc1-447-gb30b83a6eb ***** | ||
Hello World! nrf52_pca10040 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_BOOTLOADER_MCUBOOT=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sample: | ||
name: mcuboot | ||
tests: | ||
boards.mcuboot: | ||
tags: mcuboot | ||
# All platforms supported by MCUBoot out-of-the-box are | ||
# supported. nRF52 is known to be supported. | ||
platform_whitelist: nrf52840_pca10056 nrf52_pca10040 | ||
harness: console | ||
harness_config: | ||
type: one_line | ||
regex: | ||
- "Hello World! (.*)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (c) 2012-2014 Wind River Systems, Inc. | ||
* Copyright (c) 2019 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr.h> | ||
#include <misc/printk.h> | ||
|
||
void main(void) | ||
{ | ||
printk("Hello World! %s\n", CONFIG_BOARD); | ||
} |