diff --git a/boards/samd20-xpro/Makefile.features b/boards/samd20-xpro/Makefile.features index 2e76376a5d..b4af126da1 100644 --- a/boards/samd20-xpro/Makefile.features +++ b/boards/samd20-xpro/Makefile.features @@ -11,3 +11,5 @@ FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart + +FEATURES_PROVIDED += riotboot diff --git a/boards/samd21-xpro/Makefile.features b/boards/samd21-xpro/Makefile.features index 1fb60b6259..2f7f225aa0 100644 --- a/boards/samd21-xpro/Makefile.features +++ b/boards/samd21-xpro/Makefile.features @@ -15,3 +15,4 @@ FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) FEATURES_PROVIDED += tinyusb_device +FEATURES_PROVIDED += riotboot diff --git a/sys/shell/cmds/sys.c b/sys/shell/cmds/sys.c index bf963d3c4c..6c4cb6ce9e 100644 --- a/sys/shell/cmds/sys.c +++ b/sys/shell/cmds/sys.c @@ -26,6 +26,9 @@ #ifdef MODULE_USB_BOARD_RESET #include "usb_board_reset.h" #endif +#ifdef MODULE_RIOTBOOT_SLOT +#include "riotboot/slot.h" +#endif static int _reboot_handler(int argc, char **argv) { @@ -60,6 +63,14 @@ static int _version_handler(int argc, char **argv) puts(RIOT_VERSION); +#ifdef MODULE_RIOTBOOT_SLOT + int slot = riotboot_slot_current(); + if (slot >= 0) { + const riotboot_hdr_t *hdr = riotboot_slot_get_hdr(slot); + printf("%s v%"PRIu32", slot %u\n", RIOT_APPLICATION, hdr->version, slot); + } +#endif + return 0; }