-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The tests overrides the target all to be tested by the CI. All the instructions how to use it are in README.md The test is successful if the image boots and displays information about the image and running slot.
- Loading branch information
Showing
3 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
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,23 @@ | ||
include ../Makefile.tests_common | ||
|
||
# If no BOARD is found in the environment, use this default: | ||
BOARD ?= samr21-xpro | ||
|
||
# Select the boards that were tested and work with riotboot | ||
BOARD_WHITELIST += samr21-xpro iotlab-m3 | ||
|
||
# Include modules to test the bootloader | ||
USEMODULE += slot_util | ||
USEMODULE += riot_hdr | ||
|
||
# Comment this out to disable code in RIOT that does safety checking | ||
# which is not needed in a production environment but helps in the | ||
# development process: | ||
DEVELHELP ?= 1 | ||
|
||
# Change this to 0 show compiler invocation lines by default: | ||
QUIET ?= 1 | ||
|
||
all: riotboot | ||
|
||
include $(RIOTBASE)/Makefile.include |
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,18 @@ | ||
RIOT bootloader test | ||
==================== | ||
|
||
This is a basic example how to use RIOT bootloader in your embedded | ||
application. | ||
|
||
This test should foremost give you an overview how to use riotboot: | ||
|
||
- `make all` build the test using the target riotboot, which generates | ||
a binary file of the application with a header on top of it, used by | ||
the bootloader to recognise a bootable image. | ||
|
||
- `make riotboot/flash` creates the binary files and flashes both | ||
riotboot and the RIOT image with headers included. This should boot | ||
as a normal application. | ||
|
||
In this test two modules `riot_hdr` and `slot_util` are used to showcase | ||
the access to riotboot shared functions. |
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,41 @@ | ||
/* | ||
* Copyright (C) 2014 Freie Universität Berlin | ||
* | ||
* 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 examples | ||
* @{ | ||
* | ||
* @file | ||
* @brief Hello World application | ||
* | ||
* @author Kaspar Schleiser <kaspar@schleiser.de> | ||
* @author Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de> | ||
* | ||
* @} | ||
*/ | ||
|
||
#include <stdio.h> | ||
|
||
#include "slot_util.h" | ||
#include "riot_hdr.h" | ||
|
||
int main(void) | ||
{ | ||
puts("Hello riotboot!"); | ||
|
||
printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD); | ||
printf("This board features a(n) %s MCU.\n", RIOT_MCU); | ||
|
||
/* print some information about the running image */ | ||
unsigned current_slot = slot_util_current_slot(); | ||
riot_hdr_t *riot_hdr = slot_util_get_hdr(current_slot); | ||
printf("riot_hdr: running from slot %u\n", current_slot); | ||
riot_hdr_print(riot_hdr); | ||
|
||
return 0; | ||
} |