Initial commit
Initial commit.
This commit is contained in:
26
bootloader/mcuboot/samples/zephyr/hello-world/CMakeLists.txt
Normal file
26
bootloader/mcuboot/samples/zephyr/hello-world/CMakeLists.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
# Top-level CMakeLists.txt for the skeleton application.
|
||||
#
|
||||
# Copyright (c) 2017 Open Source Foundries Limited
|
||||
# Copyright (c) 2018 Foundries.io Ltd
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# This provides a basic application structure suitable for loading by
|
||||
# mcuboot, which is easy to customize on a per-board basis. It can be
|
||||
# used as a starting point for new applications.
|
||||
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
|
||||
# find_package(Zephyr) in order to load application boilerplate:
|
||||
# https://docs.zephyrproject.org/latest/develop/application/index.html
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(NONE)
|
||||
|
||||
# This string ends up getting printed in the device console
|
||||
if (NOT DEFINED FROM_WHO)
|
||||
set(FROM_WHO Zephyr)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(app PRIVATE "-DMCUBOOT_HELLO_WORLD_FROM=\"${FROM_WHO}\"")
|
||||
|
||||
target_sources(app PRIVATE src/main.c)
|
||||
6
bootloader/mcuboot/samples/zephyr/hello-world/README.rst
Normal file
6
bootloader/mcuboot/samples/zephyr/hello-world/README.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
This is a "Hello world" skeleton application which can be used as a
|
||||
starting point for Zephyr application development using mcuboot.
|
||||
|
||||
It includes the configuration "glue" needed to make the application
|
||||
loadable by mcuboot in addition to a basic Zephyr hello world
|
||||
application's code.
|
||||
1
bootloader/mcuboot/samples/zephyr/hello-world/boards/.gitignore
vendored
Normal file
1
bootloader/mcuboot/samples/zephyr/hello-world/boards/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*-local.conf
|
||||
@@ -0,0 +1,2 @@
|
||||
You can place per-board configuration here. See the comments in the
|
||||
CMakeLists.txt for more information.
|
||||
12
bootloader/mcuboot/samples/zephyr/hello-world/prj.conf
Normal file
12
bootloader/mcuboot/samples/zephyr/hello-world/prj.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
# Print a banner on the UART on startup.
|
||||
CONFIG_BOOT_BANNER=y
|
||||
|
||||
# Enable console and printk()
|
||||
CONFIG_PRINTK=y
|
||||
CONFIG_STDOUT_CONSOLE=y
|
||||
|
||||
# Enable Zephyr application to be booted by MCUboot
|
||||
CONFIG_BOOTLOADER_MCUBOOT=y
|
||||
|
||||
# Use the default MCUBoot PEM key file (BOOT_SIGNATURE_KEY_FILE)
|
||||
CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="bootloader/mcuboot/root-rsa-2048.pem"
|
||||
@@ -0,0 +1,9 @@
|
||||
sample:
|
||||
name: Application Skeleton
|
||||
description: Basic "hello world" application, but loadable by mcuboot
|
||||
platforms: all
|
||||
tests:
|
||||
- test:
|
||||
build_only: true
|
||||
tags: samples tests
|
||||
min_ram: 16
|
||||
@@ -0,0 +1 @@
|
||||
obj-y = main.o
|
||||
14
bootloader/mcuboot/samples/zephyr/hello-world/src/main.c
Normal file
14
bootloader/mcuboot/samples/zephyr/hello-world/src/main.c
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Linaro, Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/printk.h>
|
||||
|
||||
void main(void)
|
||||
{
|
||||
printk("Hello World from %s on %s!\n",
|
||||
MCUBOOT_HELLO_WORLD_FROM, CONFIG_BOARD);
|
||||
}
|
||||
Reference in New Issue
Block a user