mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:12:57 +01:00
tests: add mcuboot test application
This commit is contained in:
parent
1a52c80bf4
commit
2ff280d57f
14
tests/mcuboot/Makefile
Normal file
14
tests/mcuboot/Makefile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
APPLICATION = hello_mcuboot
|
||||||
|
|
||||||
|
BOARD ?= nrf52dk
|
||||||
|
|
||||||
|
include ../Makefile.tests_common
|
||||||
|
|
||||||
|
BOARD_WHITELIST := nrf52dk
|
||||||
|
|
||||||
|
export IMAGE_VERSION = 1.1.1+1
|
||||||
|
|
||||||
|
# this test is supposed to always build the mcuboot image
|
||||||
|
all: mcuboot
|
||||||
|
|
||||||
|
include $(RIOTBASE)/Makefile.include
|
20
tests/mcuboot/README.md
Normal file
20
tests/mcuboot/README.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# MCUBoot test application
|
||||||
|
This test is intended to compile a hello-world program taking into account
|
||||||
|
the existence of the MCUBoot bootloader at the first 32K in the ROM.
|
||||||
|
|
||||||
|
For this first support, a pre-compiled mynewt MCUBoot binary is downloaded at
|
||||||
|
compile time.
|
||||||
|
|
||||||
|
The goal is to produce an ELF file which is linked to be flashed at a
|
||||||
|
`BOOTLOADER_OFFSET` offset rather than the beginning of ROM. MCUBoot also
|
||||||
|
expects an image padded with some specific headers containing the version
|
||||||
|
information, and TLVs with hash and signing information. This is done through
|
||||||
|
the imgtool.py application, which is executed automatically by the build
|
||||||
|
system.
|
||||||
|
|
||||||
|
This test can be called using `make mcuboot` to produce such ELF file,
|
||||||
|
which can also be flashed using `make flash-mcuboot`.This command also flashes
|
||||||
|
the pre-compiled bootloader.
|
||||||
|
|
||||||
|
It's also possible to build and flash MCUBoot by following the instructions on
|
||||||
|
the MCUBoot repository either using mynewt or zephyr operating systems.
|
33
tests/mcuboot/main.c
Normal file
33
tests/mcuboot/main.c
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2017 Inria
|
||||||
|
*
|
||||||
|
* This file is subject to the terms and conditions of the GNU Lesser
|
||||||
|
* General Public License v2.1. See the file LICENSE in the top level
|
||||||
|
* directory for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup tests
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @brief MCUBoot compile test application
|
||||||
|
*
|
||||||
|
* @author Francisco Acosta <francisco.acosta@inria.fr>
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "cpu.h"
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
puts("Hello MCUBoot!");
|
||||||
|
|
||||||
|
printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
|
||||||
|
printf("This board features a(n) %s MCU.\n", RIOT_MCU);
|
||||||
|
printf("The startup address is: %p\n", (void*)SCB->VTOR);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user