Skip to content

Commit

Permalink
riotboot: define if building the bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
basilfx committed Sep 24, 2019
1 parent 2e428e2 commit 58e2825
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bootloaders/riotboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions bootloaders/riotboot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 58e2825

Please sign in to comment.