From 58e28250bd04c5b7af042b5108f04ca4b207f660 Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Mon, 22 Jul 2019 00:05:57 +0200 Subject: [PATCH] riotboot: define if building the bootloader --- bootloaders/riotboot/Makefile | 3 +++ bootloaders/riotboot/README.md | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/bootloaders/riotboot/Makefile b/bootloaders/riotboot/Makefile index b8398cc24a..0419c85017 100644 --- a/bootloaders/riotboot/Makefile +++ b/bootloaders/riotboot/Makefile @@ -7,6 +7,9 @@ BOARD ?= samr21-xpro # Select the boards with riotboot feature FEATURES_REQUIRED += riotboot +# Provide a define to detect if building the bootloader +CFLAGS += -DRIOTBOOT + # Disable unused modules CFLAGS += -DNDEBUG -DLOG_LEVEL=LOG_NONE DISABLE_MODULE += auto_init diff --git a/bootloaders/riotboot/README.md b/bootloaders/riotboot/README.md index 7e3827b6a4..66a3e792ae 100644 --- a/bootloaders/riotboot/README.md +++ b/bootloaders/riotboot/README.md @@ -60,6 +60,12 @@ A board capable to use riotboot must meet the following requirements: The above requirements are usually met if the board succeeds to execute the riotboot test in tests/. +When building the bootloader, the global define `RIOTBOOT` is available. You +can use this define to skip certain parts in `board_init()` (or `cpu_init()`) +that should not be executed during boot. Note that this define is different +from `MODULE_RIOTBOOT`, which is also defined when building an application that +utilizes riotboot. + # Single Slot Just compile your application with `FEATURES_REQUIRED += riotboot`. The header is generated automatically according to your `APP_VER`, which can be optionally