Skip to content
Snippets Groups Projects
Commit 2ff280d5 authored by kYc0o's avatar kYc0o
Browse files

tests: add mcuboot test application

parent 1a52c80b
No related branches found
No related tags found
No related merge requests found
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
# 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.
/*
* 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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment