From f932552b995f20fb504b07d9153db8fe684a0d24 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 11 Jan 2024 14:38:15 +0100 Subject: [PATCH 1/2] sys/shell: add firmware version to version cmd --- sys/shell/cmds/sys.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; } From 235d3f059c24ad707b92a89e6302c000536ad676 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 11 Jan 2024 14:38:35 +0100 Subject: [PATCH 2/2] boards/samd2x-xpro: enable riotboot --- boards/samd20-xpro/Makefile.features | 2 ++ boards/samd21-xpro/Makefile.features | 1 + 2 files changed, 3 insertions(+) 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