commit cda1472944648652764c6980f5ee3f3e91459ef3
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Mon Oct 28 11:15:03 2019 +0100

    Major SSSP overhaul:
    - SSSP no works even without Bootloader (AMiRo-OS implements startup and shutdown phases)
    - MSI and calendar synchronization are currently not available (WIP)
    - lots of minor changes

diff --git a/README.txt b/README.txt
index e0a020f..0757c3f 100644
--- a/README.txt
+++ b/README.txt
@@ -300,35 +300,35 @@ can be catched by any thread in the system.
 Next, you have to configure the main thread to whitelist the event flag (all I/O
 events are blacklisted by default). While system relevant events like power down
 are whitelisted by the OS, any custom events need to be added exl´plicitely.
-This is done via the optional AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK macro, which
-should be defined in the module.h file. Example:
-
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK                \
-    (AOS_IOEVENT_FLAG(padX) | AOS_IOEVENT_FLAG(padY) | AOS_IOEVENT_FLAG(padZ))
-
-When AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK has been defined correctly, the main
-thread will be notified by the according events and execute its event handling
-routine. Hence you have to implement another macro in module.h to handle the
-custom event(s) appropriately: MODULE_MAIN_LOOP_IO_EVENT(eventflags). As you can
-see, the variable 'eventflags' is propagated to the hook. This variable is a
-mask, that allows to identify the GPIO pad(s), which caused the event, by the
-bits set. Following the example above, you can check which GPIOs have caused
-events by using if-clauses in the implementation of the hook:
-
-  #define MODULE_MAIN_LOOP_IO_EVENT(eventflags) {           \
-    if (eventflags & AOS_IOEVENT_FLAG(padX)) {              \
+This is done via the optional AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK macro,
+which should be defined in the module.h file. Example:
+
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK         \
+    (AOS_GPIOEVENT_FLAG(padX) | AOS_GPIOEVENT_FLAG(padY) | AOS_GPIOEVENT_FLAG(padZ))
+
+When AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK has been defined correctly, the
+main thread will be notified by the according events and execute its event
+handling routine. Hence you have to implement another macro in module.h to
+handle the custom event(s) appropriately: MODULE_MAIN_LOOP_GPIOEVENT(eventflags).
+As you can see, the variable 'eventflags' is propagated to the hook. This
+variable is a mask, that allows to identify the GPIO pad(s), which caused the
+event, by the bits set. Following the example above, you can check which GPIOs
+have caused events by using if-clauses in the implementation of the hook:
+
+  #define MODULE_MAIN_LOOP_GPIOEVENT(eventflags) {          \
+    if (eventflags & AOS_GPIOEVENT_FLAG(padX)) {            \
       /* handle event */                                    \
     }                                                       \
     if (eventflags & (AOS_IOEVENT_FLAG(padY) |              \
-          AOS_IOEVENT_FLAG(padZ))) {                        \
+          AOS_GPIOEVENT_FLAG(padZ))) {                      \
       /* handle combined event */                           \
     }                                                       \
   }
 
 Summing up, you have to
 1) configure and enable the GPIO interrupt.
-2) define the AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK macro.
-3) implement the MODULE_MAIN_LOOP_IO_EVENT(eventflags) hook.
+2) define the AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK macro.
+3) implement the MODULE_MAIN_LOOP_GPIOEVENT(eventflags) hook.
 
 
 4.3  Implementing a New Low-Level Driver
diff --git a/amiroos.h b/amiroos.h
index 251d8d2..9e1a090 100644
--- a/amiroos.h
+++ b/amiroos.h
@@ -45,21 +45,32 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * @brief   The operating system minor version.
  * @note    A higher minor version implies new functionalty, but all old interfaces are still available.
  */
-#define AMIROOS_VERSION_MINOR         0
+#define AMIROOS_VERSION_MINOR         1
 
 /**
  * @brief   The operating system patch level.
  */
-#define AMIROOS_VERSION_PATCH         1
+#define AMIROOS_VERSION_PATCH         0
 
 /** @} */
 
 /******************************************************************************/
+/* CONFIGURATION                                                              */
+/******************************************************************************/
+
+#include <aosconf.h>
+#if !defined(_AMIRO_OS_CFG_)
+#error "invalid AMiRo-OS configuration file"
+#elif (AMIRO_OS_CFG_VERSION_MAJOR != AMIROOS_VERSION_MAJOR) || (AMIRO_OS_CFG_VERSION_MINOR < AMIROOS_VERSION_MINOR)
+#error "incompatible AMiRo-OS configuration file"
+#endif
+
+/******************************************************************************/
 /* SUBSYSTEMS                                                                 */
 /******************************************************************************/
 
-/* Bootloader (AMiRo-BLT) */
-#include <amiroblt.h>
+/* Bootloader */
+#include <aos_bootloader.h>
 
 /* System Kerne (ChibiOS)l */
 #include <hal.h>
@@ -72,27 +83,23 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* AMiRo-OS CORE                                                              */
 /******************************************************************************/
 
-/* configuration */
-#include <aosconf.h>
-#if !defined(_AMIRO_OS_CFG_)
-#error "invalid AMiRo-OS configuration file"
-#elif (AMIRO_OS_CFG_VERSION_MAJOR != AMIROOS_VERSION_MAJOR) || (AMIRO_OS_CFG_VERSION_MINOR < AMIROOS_VERSION_MINOR)
-#error "incompatible AMiRo-OS configuration file"
-#endif
 #include "core/inc/aos_confcheck.h"
 
-/* core headers */
 #include "core/inc/aos_types.h"
 #include "core/inc/aos_debug.h"
 #include "core/inc/aos_time.h"
 #include "core/inc/aos_timer.h"
 #include "core/inc/aos_iostream.h"
 #include "core/inc/aos_shell.h"
+#include "core/inc/aos_sssp.h"
 #include "core/inc/aos_system.h"
 #include "core/inc/aos_thread.h"
 #include "core/inc/aos_test.h"
 
-/* module specifications */
+/******************************************************************************/
+/* MODULE                                                                     */
+/******************************************************************************/
+
 #include <module.h>
 
 #endif /* AMIROOS_H */
diff --git a/bootloader/aos_bootloader.h b/bootloader/aos_bootloader.h
new file mode 100644
index 0000000..b18c5b2
--- /dev/null
+++ b/bootloader/aos_bootloader.h
@@ -0,0 +1,82 @@
+/*
+AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
+Copyright (C) 2016..2019  Thomas Schöpping et al.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file    aos_bootloader.h
+ * @brief   Bootloader wrapper header.
+ *
+ * @addtogroup aos_bootloader
+ * @{
+ */
+
+#ifndef AMIROOS_BOOTLOADER_H
+#define AMIROOS_BOOTLOADER_H
+
+#include <amiroos.h>
+
+/******************************************************************************/
+/* CONSTANTS                                                                  */
+/******************************************************************************/
+
+/**
+ * @brief   Identifier for the case that no bootloader is installed/available.
+ */
+#define AOS_BOOTLOADER_NONE                     0
+
+/**
+ * @brief   Identifier for AMiRo-BLT
+ * @note    The version of the installed AMiRo-BLT can be retreived via the AMiRo-BLT interface.
+ */
+#define AOS_BOOTLOADER_AMiRoBLT                 1
+
+/******************************************************************************/
+/* SETTINGS                                                                   */
+/******************************************************************************/
+
+#if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)
+#include <amiroblt.h>
+#endif
+
+/******************************************************************************/
+/* CHECKS                                                                     */
+/******************************************************************************/
+
+#if (AMIROOS_CFG_BOOTLOADER != AOS_BOOTLOADER_NONE) &&                        \
+    (AMIROOS_CFG_BOOTLOADER != AOS_BOOTLOADER_AMiRoBLT)
+  #error "AMIROOS_CFG_BOOTLOADER set to invalid value in aosconf.h"
+#endif
+
+/******************************************************************************/
+/* DATA STRUCTURES AND TYPES                                                  */
+/******************************************************************************/
+
+/******************************************************************************/
+/* MACROS                                                                     */
+/******************************************************************************/
+
+/******************************************************************************/
+/* EXTERN DECLARATIONS                                                        */
+/******************************************************************************/
+
+/******************************************************************************/
+/* INLINE FUNCTIONS                                                           */
+/******************************************************************************/
+
+#endif /* AMIROOS_BOOTLOADER_H */
+
+/** @} */
diff --git a/bootloader/bootloader.mk b/bootloader/bootloader.mk
index 7df00f0..e4104cb 100644
--- a/bootloader/bootloader.mk
+++ b/bootloader/bootloader.mk
@@ -30,7 +30,8 @@ AMIROOS_BOOTLOADER_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
 AMIROBLT := $(AMIROOS_BOOTLOADER_DIR)AMiRo-BLT
 
 # include paths
-AMIROOS_BOOTLOADER_INC = $(AMIROBLT)/Target/Source/AMiRo
+AMIROOS_BOOTLOADER_INC = $(AMIROOS_BOOTLOADER_DIR) \
+                         $(AMIROBLT)/Target/Source/AMiRo
 
 # load module ID constants
 include $(AMIROBLT)/Target/Modules/moduleids.mk
diff --git a/core/inc/aos_confcheck.h b/core/inc/aos_confcheck.h
index 5f9f5f1..1dde0cb 100644
--- a/core/inc/aos_confcheck.h
+++ b/core/inc/aos_confcheck.h
@@ -59,13 +59,51 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
   #error "AMIROOS_CFG_MAIN_LOOP_TIMEOUT not defined in aosconf.h"
 #endif /* !defined(AMIROOS_CFG_MAIN_LOOP_TIMEOUT) */
 
+/* bootloader parameters and options */
+
+#if !defined(AMIROOS_CFG_BOOTLOADER)
+  #error "AMIROOS_CFG_BOOTLOADER not defined in aosconf.h"
+#endif /* !defined(AMIROOS_CFG_BOOTLOADER)*/
+
 /* SSSP parameters and options */
 
 #if !defined(AMIROOS_CFG_SSSP_ENABLE)
   #error "AMIROOS_CFG_SSSP_ENABLE not defined in aosconf.h"
 #endif /* !defined(AMIROOS_CFG_SSSP_ENABLE) */
 
-# if (AMIROOS_CFG_SSSP_ENABLE == true)
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
+
+  #if !defined(AMIROOS_CFG_SSSP_STARTUP)
+    #error "AMIROOS_CFG_SSSP_STARTUP not defined in aosconf.h"
+  #else /* !defined(AMIROOS_CFG_SSSP_STARTUP) */
+    #if (AMIROOS_CFG_SSSP_STARTUP == true)
+      #if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)
+        #error "AMIROOS_CFG_SSSP_STARTUP is enabled in aosconf.h, but SSSP startup phase is already handled by AMiRo-BLT."
+      #endif /* (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT) */
+    #else /* (AMIROOS_CFG_SSSP_STARTUP == true) */
+      #if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE)
+        #error "AMIROOS_CFG_SSSP_STARTUP is disabled in aosconf.h, but no bootloader is defined to handle SSSP startup phase instead."
+      #endif /* (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE) */
+    #endif /* (AMIROOS_CFG_SSSP_STARTUP == true) */
+  #endif /* !defined(AMIROOS_CFG_SSSP_STARTUP) */
+
+  #if !defined(AMIROOS_CFG_SSSP_SHUTDOWN)
+    #error "AMIROOS_CFG_SSSP_SHUTDOWN not defined in aosconf.h"
+  #else /* !defined(AMIROOS_CFG_SSSP_SHUTDOWN) */
+    #if (AMIROOS_CFG_SSSP_SHUTDOWN != true)
+      #if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE)
+        #error "AMIROOS_CFG_SSSP_SHUTDOWN is disabled in aosconf.h, but no bootloader is defined to handle SSSP shutdown phase instead."
+      #endif /* (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE) */
+    #endif /* (AMIROOS_CFG_SSSP_SHUTDOWN != true) && (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE) */
+  #endif /* !defined(AMIROOS_CFG_SSSP_SHUTDOWN) */
+
+  #if !defined(AMIROOS_CFG_SSSP_MSI)
+    #error "AMIROOS_CFG_SSSP_MSI not defined in aosconf.h"
+  #endif /* !defined(AMIROOS_CFG_SSSP_MSI) */
+
+  #if !defined(AMIROOS_CFG_SSSP_MODULEIDWIDTH)
+    #error "AMIROOS_CFG_SSSP_MODULEIDWIDTH not defined in aosconf.h"
+  #endif /* !defined(AMIROOS_CFG_SSSP_MODULEIDWIDTH) */
 
   #if !defined(AMIROOS_CFG_SSSP_MASTER)
     #error "AMIROOS_CFG_SSSP_MASTER not defined in aosconf.h"
@@ -94,6 +132,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
     #error "AMIROOS_CFG_SSSP_SYSSYNCPERIOD not defined in aosconf.h"
   #endif /* !defined(AMIROOS_CFG_SSSP_SYSSYNCPERIOD) */
 
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
+  #if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)
+    #warning "SSSP is disabled in aosconf.h, but AMiRo-BLT implements it nevertheless."
+  #endif /* (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT) */
+
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /* system shell options */
@@ -123,7 +167,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #else /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
   #if (AMIROOS_CFG_TESTS_ENABLE == true)
-    #pragma message "AMiRo-OS shell enabled implicitely via AMIROOS_CFG_TESTS_ENABLE"
+    #error "Enabling AMIROOS_CFG_TESTS_ENABLE in aosconf.h requires AMIROOS_CFG_SHELL_ENABLE to be enabled as well."
   #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
 #endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
diff --git a/core/inc/aos_shell.h b/core/inc/aos_shell.h
index b54f46b..901eb5a 100644
--- a/core/inc/aos_shell.h
+++ b/core/inc/aos_shell.h
@@ -29,7 +29,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <amiroos.h>
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 
 /******************************************************************************/
 /* CONSTANTS                                                                  */
@@ -418,7 +418,7 @@ extern "C" {
 /* INLINE FUNCTIONS                                                           */
 /******************************************************************************/
 
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 #endif /* AMIROOS_SHELL_H */
 
diff --git a/core/inc/aos_sssp.h b/core/inc/aos_sssp.h
new file mode 100644
index 0000000..5a729da
--- /dev/null
+++ b/core/inc/aos_sssp.h
@@ -0,0 +1,181 @@
+/*
+AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
+Copyright (C) 2016..2019  Thomas Schöpping et al.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file    aos_sssp.h
+ * @brief   SSSP related macros, structures and functions.
+ *
+ * @addtogroup aos_sssp
+ * @{
+ */
+
+#ifndef AMIROOS_SSSP_H
+#define AMIROOS_SSSP_H
+
+#include <amiroos.h>
+
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
+/******************************************************************************/
+/* CONSTANTS                                                                  */
+/******************************************************************************/
+
+/**
+ * @brief   Major version of the implemented SSSP.
+ */
+#define AOS_SSSP_VERSION_MAJOR                  1
+
+/**
+ * @brief   Minor version of the implemented SSSP.
+ */
+#define AOS_SSSP_VERSION_MINOR                  4
+
+/**
+ * @brief   Time of delays in microseconds.
+ */
+#define AOS_SSSP_DELAY                          AMIROOS_CFG_SSSP_SIGNALDELAY
+
+/**
+ * @brief   Timeout delay in microseconds according to SSSP.
+ * @details SSSP 1.x defines timeouts to be ten times longer than the signal delay time.
+ */
+#define AOS_SSSP_TIMEOUT                        (10 * AOS_SSSP_DELAY)
+
+/**
+ * @brief   Value to indicate an invalid module ID.
+ */
+#define AOS_SSSP_MODULEID_INVALID               ((aos_ssspmoduleid_t)0)
+
+/**
+ * @brief   Value for broadcasting, adressing all modules.
+ * @note    This value is identical to @p AOS_SSSP_MODULEID_INVALID since in the case that no module IDs were applied, addressing of specific modules is not possible, thus every communication would be a broadcast.
+ */
+#define AOS_SSSP_MODULEID_BROADCAST             ((aos_ssspmoduleid_t)0)
+
+/******************************************************************************/
+/* SETTINGS                                                                   */
+/******************************************************************************/
+
+/******************************************************************************/
+/* CHECKS                                                                     */
+/******************************************************************************/
+
+#if (AMIROOS_CFG_SSSP_MSI == true)
+  #error "SSSP module stack initialization (MSI not implemented yet"
+#endif
+
+/******************************************************************************/
+/* DATA STRUCTURES AND TYPES                                                  */
+/******************************************************************************/
+
+/**
+ * @brief   Enumeration of the several stages of SSSP.
+ */
+typedef enum {
+  AOS_SSSP_STAGE_UNDEFINED    = 0x0000, /**< Identifier of yet undefined stage variable.  */
+  AOS_SSSP_STAGE_STARTUP      = 0x1000, /**< Identifier of SSSP startup phase.            */
+  AOS_SSSP_STAGE_STARTUP_1    = 0x1100, /**< Identifier of SSSP startup phase stage 1.    */
+  AOS_SSSP_STAGE_STARTUP_1_1  = 0x1110, /**< Identifier of SSSP startup phase stage 1-1.  */
+  AOS_SSSP_STAGE_STARTUP_1_2  = 0x1120, /**< Identifier of SSSP startup phase stage 1-2.  */
+  AOS_SSSP_STAGE_STARTUP_1_3  = 0x1130, /**< Identifier of SSSP startup phase stage 1-3.  */
+  AOS_SSSP_STAGE_STARTUP_2    = 0x1200, /**< Identifier of SSSP startup phase stage 2.    */
+  AOS_SSSP_STAGE_STARTUP_2_1  = 0x1210, /**< Identifier of SSSP startup phase stage 2-1.  */
+  AOS_SSSP_STAGE_STARTUP_2_2  = 0x1220, /**< Identifier of SSSP startup phase stage 2-2.  */
+  AOS_SSSP_STAGE_STARTUP_3    = 0x1300, /**< Identifier of SSSP startup phase stage 3.    */
+  AOS_SSSP_STAGE_STARTUP_3_1  = 0x1310, /**< Identifier of SSSP startup phase stage 3-1.  */
+  AOS_SSSP_STAGE_STARTUP_3_2  = 0x1320, /**< Identifier of SSSP startup phase stage 3-2.  */
+  AOS_SSSP_STAGE_STARTUP_3_3  = 0x1330, /**< Identifier of SSSP startup phase stage 3-3.  */
+  AOS_SSSP_STAGE_STARTUP_3_4  = 0x1340, /**< Identifier of SSSP startup phase stage 3-4.  */
+  AOS_SSSP_STAGE_OPERATION    = 0x2000, /**< Identifier of SSSP operation pahse.          */
+  AOS_SSSP_STAGE_SHUTDOWN     = 0x3000, /**< Identifier of SSSP shutdown phase.           */
+  AOS_SSSP_STAGE_SHUTDOWN_1   = 0x3100, /**< Identifier of SSSP shutdown phase stage 1.   */
+  AOS_SSSP_STAGE_SHUTDOWN_1_1 = 0x3110, /**< Identifier of SSSP shutdown phase stage 1-1. */
+  AOS_SSSP_STAGE_SHUTDOWN_1_2 = 0x3120, /**< Identifier of SSSP shutdown phase stage 1-2. */
+  AOS_SSSP_STAGE_SHUTDOWN_1_3 = 0x3130, /**< Identifier of SSSP shutdown phase stage 1-3. */
+  AOS_SSSP_STAGE_SHUTDOWN_2   = 0x3200, /**< Identifier of SSSP shutdown phase stage 2.   */
+  AOS_SSSP_STAGE_SHUTDOWN_2_1 = 0x3210, /**< Identifier of SSSP shutdown phase stage 2-1. */
+  AOS_SSSP_STAGE_SHUTDOWN_2_2 = 0x3220, /**< Identifier of SSSP shutdown phase stage 2-2. */
+  AOS_SSSP_STAGE_SHUTDOWN_2_3 = 0x3230, /**< Identifier of SSSP shutdown phase stage 2-3. */
+} aos_ssspstage_t;
+
+/**
+ * @brief   Type to represent module IDs.
+ */
+#if (AMIROOS_CFG_SSSP_MODULEIDWIDTH == 8)
+typedef uint8_t aos_ssspmoduleid_t;
+#elif (AMIROOS_CFG_SSSP_MODULEIDWIDTH == 16) || defined(__DOXYGEN__)
+typedef uint16_t aos_ssspmoduleid_t;
+#elif (AMIROOS_CFG_SSSP_MODULEIDWIDTH == 32)
+typedef uint32_t aos_ssspmoduleid_t;
+#else
+#error "AMIROOS_CFG_SSSP_MODULEIDWIDTH set to an invalid value."
+#endif
+
+/**
+ * @brief   Data structure holding module-wide SSSP information.
+ */
+typedef struct {
+  /**
+   * @brief   Current execution stage of SSSP.
+   */
+  aos_ssspstage_t stage;
+
+#if (AMIROOS_CFG_SSSP_MSI == true) || defined(__DOXYGEN__)
+
+  /**
+   * @brief   Module identifier.
+   * @details A value of @p AOS_SSSP_MODULEID_INVALID indicates an uninitialized ID.
+   *          The values @p AOS_SSSP_MODULEID_INVALID and @p AOS_SSSP_MODULEID_ALL are reserved and must not be set.
+   */
+  aos_ssspmoduleid_t moduleId;
+
+#endif /* (AMIROOS_CFG_SSSP_MSI == true) */
+
+} aos_ssspdata_t;
+
+/******************************************************************************/
+/* MACROS                                                                     */
+/******************************************************************************/
+
+/******************************************************************************/
+/* EXTERN DECLARATIONS                                                        */
+/******************************************************************************/
+
+#if defined(__cplusplus)
+extern "C" {
+#endif /* defined(__cplusplus) */
+  void aosSsspInit(void);
+  aos_status_t aosSsspProceed(event_listener_t* listener, eventflags_t flags, eventmask_t mask, eventmask_t* received);
+  void aosSsspShutdownInit(void);
+#if (AMIROOS_CFG_SSSP_SHUTDOWN == true) || defined(__DOXYGEN__)
+  void aosSsspShutdownBroadcastIdentifier(unsigned int identifier);
+  eventmask_t aosSsspShutdownWaitForIdentifierPulse(event_listener_t* gpiolistener, eventflags_t sflags, eventmask_t timermask, unsigned int* identifier);
+#endif /* (AMIROOS_CFG_SSSP_SHUTDOWN == true) */
+#if defined(__cplusplus)
+}
+#endif /* defined(__cplusplus) */
+
+/******************************************************************************/
+/* INLINE FUNCTIONS                                                           */
+/******************************************************************************/
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
+#endif /* AMIROOS_SSSP_H */
+
+/** @} */
diff --git a/core/inc/aos_system.h b/core/inc/aos_system.h
index 890a91a..e2d77b6 100644
--- a/core/inc/aos_system.h
+++ b/core/inc/aos_system.h
@@ -40,49 +40,34 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define AOS_SYSTEM_TIME_RESOLUTION              ((MICROSECONDS_PER_SECOND + CH_CFG_ST_FREQUENCY - 1) / CH_CFG_ST_FREQUENCY)
 
 /**
- * @brief   System event flag which is emitted when a shutdown was initiated.
+ * @brief   System event flag mask for shutdown related events.
  */
-#define AOS_SYSTEM_EVENTFLAGS_SHUTDOWN          (eventflags_t)(1 << 0)
+#define AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_MASK     ((eventflags_t)0x1F)
+
+/**
+ * @brief   System event flag which is emitted when a passive shutdown was initiated.
+ */
+#define AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_PASSIVE  ((eventflags_t)(1 << 0))
 
 /**
  * @brief   System event flag which is emitted when a shutdown to transportation mode was initiated.
  */
-#define AOS_SYSTEM_EVENTFLAGS_TRANSPORTATION    (AOS_SYSTEM_EVENTFLAGS_SHUTDOWN | (eventflags_t)(1 << 1))
+#define AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_TRANSPORTATION ((eventflags_t)(1 << 1))
 
 /**
  * @brief   System event flag which is emitted when a shutdown to deepsleep mode was initiated.
  */
-#define AOS_SYSTEM_EVENTFLAGS_DEEPSLEEP         (AOS_SYSTEM_EVENTFLAGS_SHUTDOWN | (eventflags_t)(1 << 2))
+#define AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_DEEPSLEEP ((eventflags_t)(1 << 2))
 
 /**
  * @brief   System event flag which is emitted when a shutdown to hibernate mode was initiated.
  */
-#define AOS_SYSTEM_EVENTFLAGS_HIBERNATE         (AOS_SYSTEM_EVENTFLAGS_SHUTDOWN | (eventflags_t)(1 << 3))
+#define AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_HIBERNATE ((eventflags_t)(1 << 3))
 
 /**
  * @brief   System event flag which is emitted when a system restart was initiated.
  */
-#define AOS_SYSTEM_EVENTFLAGS_RESTART           (AOS_SYSTEM_EVENTFLAGS_SHUTDOWN | (eventflags_t)(1 << 4))
-
-#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
-
-/**
- * @brief   Major version of the implemented SSSP.
- */
-#define AOS_SYSTEM_SSSP_VERSION_MAJOR           1
-
-/**
- * @brief   Minor version of the implemented SSSP.
- */
-#define AOS_SYSTEM_SSSP_VERSION_MINOR           4
-
-/**
- * @brief   Timeout delay according to SSSP.
- * @details SSSP defines timeouts to be ten times longer than the signal delay time.
- */
-#define AOS_SYSTEM_SSSP_TIMEOUT                 (10 * AMIROOS_CFG_SSSP_SIGNALDELAY)
-
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+#define AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_RESTART ((eventflags_t)(1 << 4))
 
 /******************************************************************************/
 /* SETTINGS                                                                   */
@@ -101,66 +86,24 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 typedef enum aos_shutdown {
   AOS_SHUTDOWN_NONE,            /**< Default value if no shutdown action was initiated */
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
   AOS_SHUTDOWN_PASSIVE,         /**< Passive shutdown (initiated by another module). */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+#if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE) || defined (__DOXYGEN__)
+  AOS_SHUTDOWN_ACTIVE,          /**< Active shutdown. */
+#endif /* (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE) */
+#if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT) || defined (__DOXYGEN__)
   AOS_SHUTDOWN_HIBERNATE,       /**< Active shutdown to hibernate mode. */
   AOS_SHUTDOWN_DEEPSLEEP,       /**< Active shutdown to deepsleep mode. */
   AOS_SHUTDOWN_TRANSPORTATION,  /**< Active shutdown to transportation mode. */
   AOS_SHUTDOWN_RESTART,         /**< Active saystem restart request. */
+#endif /* (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT) */
 } aos_shutdown_t;
 
-#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
-
-/**
- * @brief   Enumerator of the several stages of SSSP.
- */
-typedef enum aos_ssspstage {
-  AOS_SSSP_STARTUP_1_1  = 0x10, /**< Identifier of SSSP startup phase stage 1-1. */
-  AOS_SSSP_STARTUP_1_2  = 0x11, /**< Identifier of SSSP startup phase stage 1-2. */
-  AOS_SSSP_STARTUP_1_3  = 0x12, /**< Identifier of SSSP startup phase stage 1-3. */
-  AOS_SSSP_STARTUP_2_1  = 0x14, /**< Identifier of SSSP startup phase stage 2-1. */
-  AOS_SSSP_STARTUP_2_2  = 0x15, /**< Identifier of SSSP startup phase stage 2-2. */
-  AOS_SSSP_STARTUP_3_1  = 0x18, /**< Identifier of SSSP startup phase stage 3-1. */
-  AOS_SSSP_STARTUP_3_2  = 0x19, /**< Identifier of SSSP startup phase stage 3-2. */
-  AOS_SSSP_STARTUP_3_3  = 0x1A, /**< Identifier of SSSP startup phase stage 3-3. */
-  AOS_SSSP_STARTUP_3_4  = 0x1B, /**< Identifier of SSSP startup phase stage 3-4. */
-  AOS_SSSP_OPERATION    = 0x20, /**< Identifier of SSSP operation pahse. */
-  AOS_SSSP_SHUTDOWN_1_1 = 0x30, /**< Identifier of SSSP shutdown phase stage 1-1. */
-  AOS_SSSP_SHUTDOWN_1_2 = 0x31, /**< Identifier of SSSP shutdown phase stage 1-2. */
-  AOS_SSSP_SHUTDOWN_1_3 = 0x32, /**< Identifier of SSSP shutdown phase stage 1-3. */
-  AOS_SSSP_SHUTDOWN_2_1 = 0x34, /**< Identifier of SSSP shutdown phase stage 2-1. */
-  AOS_SSSP_SHUTDOWN_2_2 = 0x35, /**< Identifier of SSSP shutdown phase stage 2-2. */
-  AOS_SSSP_SHUTDOWN_3   = 0x38, /**< Identifier of SSSP shutdown phase stage 3. */
-} aos_ssspstage_t;
-
-/**
- * @brief   Type to represent module IDs.
- */
-typedef uint16_t aos_ssspmoduleid_t;
-
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
-
 /**
  * @brief   AMiRo-OS base system structure.
  */
 typedef struct aos_system {
-#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
-  /**
-   * @brief   SSSP relevant data.
-   */
-  struct {
-    /**
-     * @brief   Current SSSP stage of the system.
-     */
-    aos_ssspstage_t stage;
-
-    /**
-     * @brief   Module identifier.
-     * @details A value of 0 indicates an uninitialized ID.
-     *          The vlaues 0 and ~0 are reserved und must not be set.
-     */
-    aos_ssspmoduleid_t moduleId;
-  } sssp;
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   /**
    * @brief   System I/O stream.
@@ -173,9 +116,9 @@ typedef struct aos_system {
   struct {
 
     /**
-     * @brief   I/O event source.
+     * @brief   GPIO event source.
      */
-    event_source_t io;
+    event_source_t gpio;
 
     /**
      * @brief   OS event source.
@@ -183,14 +126,23 @@ typedef struct aos_system {
     event_source_t os;
   } events;
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 
   /**
    * @brief   Pointer to the shell object.
    */
   aos_shell_t shell;
 
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
+
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
+  /**
+   * @brief   SSSP relevant data.
+   */
+  aos_ssspdata_t sssp;
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 } aos_system_t;
 
@@ -217,25 +169,29 @@ extern aos_system_t aos;
 #if defined(__cplusplus)
 extern "C" {
 #endif /* defined(__cplusplus) */
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
   void aosSysInit(const char* shellPrompt);
-#else /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#else /* (AMIROOS_CFG_SHELL_ENABLE == true) */
   void aosSysInit(void);
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
   void aosSysStart(void);
 #if (AMIROOS_CFG_SSSP_ENABLE == true) || defined (__DOXYGEN__)
-  eventmask_t aosSysSsspStartupOsInitSyncCheck(event_listener_t* syncEvtListener);
+  void aosSysStartUptime(void);
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   void aosSysGetUptimeX(aos_timestamp_t* ut);
-#if (HAL_USE_RTC == TRUE)
+#if (HAL_USE_RTC == TRUE) || defined(__DOXYGEN__)
   void aosSysGetDateTime(struct tm* dt);
   void aosSysSetDateTime(struct tm* dt);
 #endif /* (HAL_USE_RTC == TRUE) */
   void aosSysShutdownInit(aos_shutdown_t shutdown);
   void aosSysStop(void);
   void aosSysDeinit(void);
-  void aosSysShutdownFinal(aos_shutdown_t shutdown);
-  palcallback_t aosSysGetStdExtiCallback(void);
+#if ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_SHUTDOWN != true)) ||               \
+    ((AMIROOS_CFG_SSSP_ENABLE != true) && (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)) || \
+    defined(__DOXYGEN__)
+  void aosSysShutdownToBootloader(aos_shutdown_t shutdown);
+#endif /* ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_SHUTDOWN != true)) || ((AMIROOS_CFG_SSSP_ENABLE != true) && (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)) */
+  palcallback_t aosSysGetStdGpioCallback(void);
 #if defined(__cplusplus)
 }
 #endif /* defined(__cplusplus) */
diff --git a/core/inc/aos_thread.h b/core/inc/aos_thread.h
index 4a1946d..a81e12e 100644
--- a/core/inc/aos_thread.h
+++ b/core/inc/aos_thread.h
@@ -122,7 +122,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 extern "C" {
 #endif /* defined(_cplusplus) */
   void aosThdSleepUntilS(const aos_timestamp_t t);
-#if (AMIROOS_CFG_DBG == true) && (CH_DBG_FILL_THREADS == TRUE)
+#if ((AMIROOS_CFG_DBG == true) && (CH_DBG_FILL_THREADS == TRUE)) || defined(__DOXYGEN__)
   size_t aosThdGetStackPeakUtilization(thread_t* thread);
 #endif /* (AMIROOS_CFG_DBG == true) && (CH_DBG_FILL_THREADS == TRUE) */
 #if defined(__cplusplus)
diff --git a/core/inc/aos_types.h b/core/inc/aos_types.h
index f0546d5..c934a54 100644
--- a/core/inc/aos_types.h
+++ b/core/inc/aos_types.h
@@ -87,7 +87,7 @@ typedef uint8_t aos_status_t;
 /**
  * @brief   Converts a GPIO pad number to a unique event flag.
  */
-#define AOS_IOEVENT_FLAG(pad)                   ((eventflags_t)1 << pad)
+#define AOS_GPIOEVENT_FLAG(pad)                 ((eventflags_t)1 << pad)
 
 /******************************************************************************/
 /* EXTERN DECLARATIONS                                                        */
diff --git a/core/src/aos_main.cpp b/core/src/aos_main.cpp
index 37a8c1c..d404768 100644
--- a/core/src/aos_main.cpp
+++ b/core/src/aos_main.cpp
@@ -19,8 +19,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /**
  * @file    aos_main.cpp
  * @brief   Main function.
- * @details Main function with SSSP and initialization,
- *          extendable via hooks.
  *
  * @addtogroup aos_system
  * @{
@@ -40,69 +38,24 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /******************************************************************************/
 
 /**
- * @brief   Event mask to identify I/O events.
+ * @brief   Event mask to identify GPIO events.
  */
-#define IOEVENT_MASK                            EVENT_MASK(0)
+#define EVENTMASK_GPIO                          EVENT_MASK(0)
 
 /**
  * @brief   Event mask to identify OS events.
  */
-#define OSEVENT_MASK                            EVENT_MASK(1)
+#define EVENTMASK_OS                            EVENT_MASK(1)
 
-/**
- * @brief   Event mask to idetify CAN events.
- */
-#define CANEVENT_MASK                           EVENT_MASK(2)
-
-/**
- * @brief   Event mask to idetify timeout events.
- */
-#define TIMEOUTEVENT_MASK                       EVENT_MASK(3)
-
-/**
- * @brief   Event mask to idetify signal delay events.
- */
-#define DELAYEVENT_MASK                         EVENT_MASK(4)
-
-#if ((AMIROOS_CFG_SSSP_ENABLE == true) && (HAL_USE_CAN == TRUE)) || defined(__DOXYGEN__)
-#define SSSP_STAGE3_ENABLE                      true
-#else /* (AMIROOS_CFG_SSSP_ENABLE == true) && (HAL_USE_CAN == TRUE) */
-#define SSSP_STAGE3_ENABLE                      false
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (HAL_USE_CAN == TRUE) */
-
-#if (SSSP_STAGE3_ENABLE == true) || defined(__DOXYGEN__)
-
-/**
- * @brief   CAN message identifier for initialization of the SSSP stack initialization sequence.
- */
-#define SSSP_STACKINIT_CANMSGID_INIT            0x003
-
-/**
- * @brief   CAN message identifier for transmitting module IDs during the SSSP stack initialization sequence.
- */
-#define SSSP_STACKINIT_CANMSGID_MODULEID        0x002
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
 
 /**
- * @brief   CAN message identifier for abortion of the SSSP stack initialization sequence.
+ * @brief   Event mask to identify SSSP timer events.
  */
-#define SSSP_STACKINIT_CANMSGID_ABORT           0x001
+#define EVENTMASK_SSSPTIMER                     EVENT_MASK(2)
 
-#endif /* (SSSP_STAGE3_ENABLE == true) */
-
-#if (AMIROOS_CFG_SSSP_ENABLE != true) || defined(__DOXYGEN__)
-/**
- * @brief   Default shutdown mode if SSSP is unavailable.
- */
-#define AOS_SHUTDOWN_DEFAULT                    AOS_SHUTDOWN_DEEPSLEEP
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
-#if (HAL_USE_CAN == TRUE) || defined(__DOXYGEN__)
-/**
- * @brief   CAN message identifier for calender synchronization message.
- */
-#define CALENDERSYNC_CANMSGID                   0x004
-#endif /* (HAL_USE_CAN == TRUE) */
-
 /******************************************************************************/
 /* EXPORTED VARIABLES                                                         */
 /******************************************************************************/
@@ -116,9 +69,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /******************************************************************************/
 
 /**
- * @brief   Listener object for I/O events.
+ * @brief   Listener object for GPIO events.
  */
-static event_listener_t _eventListenerIO;
+static event_listener_t _eventListenerGPIO;
 
 /**
  * @brief   Listener object for OS events.
@@ -126,17 +79,21 @@ static event_listener_t _eventListenerIO;
 static event_listener_t _eventListenerOS;
 
 #if defined(MODULE_HAL_PROGIF) || defined(__DOXYGEN__)
+
 /**
  * @brief   I/O channel for the programmer interface.
  */
 static AosIOChannel _stdiochannel;
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
+
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   I/O shell channel for the programmer interface.
  */
 static AosShellChannel _stdshellchannel;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)*/
+
 #endif /* defined(MODULE_HAL_PROGIF) */
 
 /*
@@ -167,24 +124,6 @@ static inline void _unexpectedEventError(const eventmask_t mask, const eventflag
   return;
 }
 
-#if (SSSP_STAGE3_ENABLE == true) || defined(__DOXYGEN__)
-/**
- * @brief   Callback function to be used during SSSP stack initialization sequence.
- *
- * @param[in] par   A pointer to an @p event_source_t to be fired.
- */
-static void _ssspTimerCallback(void* par)
-{
-  aosDbgCheck(par != NULL);
-
-  chSysLockFromISR();
-  chEvtBroadcastI((event_source_t*)par);
-  chSysUnlockFromISR();
-
-  return;
-}
-#endif /* (SSSP_STAGE3_ENABLE == true) */
-
 /**
  * @brief   Helper function to serialize data.
  *
@@ -286,615 +225,6 @@ inline void _U642TM(struct tm* dst, const uint64_t src)
 
 #endif /* (HAL_USE_RTC == TRUE) */
 
-#if (SSSP_STAGE3_ENABLE) || defined(__DOXYGEN__)
-/**
- * @brief   Implementation of the SSSP module stack initialization sequence (startup phase 3).
- *
- * @return Shutdown value.
- * @retval AOS_SHUTDOWN_NONE      No shutdown signal received
- * @retval AOS_SHUTDOWN_PASSIVE   Shutdown signal received.
- */
-aos_shutdown_t _ssspModuleStackInitialization(void)
-{
-  // local types
-  /**
-   * @brief   States for the internal state machine to implement SSSP startup stage 3.
-   */
-  typedef enum {
-    STAGE_3_1,                  /**< Initiation of SSSP startup stage 3. */
-    STAGE_3_2,                  /**< Starting the sequence and broadcasting the first ID. */
-    STAGE_3_3_WAITFORFIRSTID,   /**< Waiting for first ID after initiation. */
-    STAGE_3_3_WAITFORIDORSIG,   /**< Waiting for next ID or activation of neighbor signal. */
-    STAGE_3_3_WAITFORID,        /**< Waiting for next ID (after the module has set its own ID). */
-    STAGE_3_4_FINISH,           /**< Successful finish of stage 3. */
-    STAGE_3_4_ABORT_ACTIVE,     /**< Aborting stage 3 (active). */
-    STAGE_3_4_ABORT,            /**< Aborting stage 3 (passive). */
-  } sssp_modulestackinitstage_t;
-
-  typedef struct {
-    bool loop     : 1;
-    bool wfe      : 1;
-    bool wfe_next : 1;
-  } flags_t;
-
-  // local variables
-  aos_shutdown_t shutdown = AOS_SHUTDOWN_NONE;
-  sssp_modulestackinitstage_t stage = STAGE_3_1;
-  eventmask_t eventmask = 0;
-  eventflags_t ioflags = 0;
-  event_source_t eventSourceTimeout;
-  event_source_t eventSourceDelay;
-  event_listener_t eventListenerTimeout;
-  event_listener_t eventListenerDelay;
-  event_listener_t eventListenerCan;
-  virtual_timer_t timerTimeout;
-  virtual_timer_t timerDelay;
-  CANTxFrame canTxFrame;
-  CANRxFrame canRxFrame;
-#if (AMIROOS_CFG_SSSP_STACK_START != true) || (AMIROOS_CFG_DBG == true)
-  aos_ssspmoduleid_t lastid = 0;
-#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) || (AMIROOS_CFG_DBG == true) */
-  flags_t flags;
-  aos_timestamp_t uptime;
-
-  // initialize local varibles
-  chEvtObjectInit(&eventSourceTimeout);
-  chEvtObjectInit(&eventSourceDelay);
-  chVTObjectInit(&timerTimeout);
-  chVTObjectInit(&timerDelay);
-  canTxFrame.RTR = CAN_RTR_DATA;
-  canTxFrame.IDE = CAN_IDE_STD;
-  flags.loop = true;
-  flags.wfe = false; // do not wait for events in the initial iteration of the FSM loop
-  flags.wfe_next = true;
-
-  // initialize system variables
-  aos.sssp.stage = AOS_SSSP_STARTUP_3_1;
-  aos.sssp.moduleId = 0;
-
-  // listen to events (timout, delay, CAN receive)
-  chEvtRegisterMask(&eventSourceTimeout, &eventListenerTimeout, TIMEOUTEVENT_MASK);
-  chEvtRegisterMask(&eventSourceDelay, &eventListenerDelay, DELAYEVENT_MASK);
-  chEvtRegisterMask(&MODULE_HAL_CAN.rxfull_event, &eventListenerCan, CANEVENT_MASK);
-
-  /*
-   * FSM in a loop.
-   *
-   * This is a fully event-based FSM for the module stack initialization
-   * sequence, defined by SSSP as startup stage 3. There are five different
-   * events that can occur at this point:
-   *  I/O events: The input level of an input pin has changed. Such events must
-   *              be handled differently depending on the current state. Most
-   *              of the time, however, such events can be ignored.
-   *  OS events:  Such events are only available after this stage completed and
-   *              thus should never occur. However, there is an optional hook
-   *              to handle such events, nevertheless.
-   *  CAN events: At least one CAN message was received. Note that this event
-   *              will only fire again if all input buffers have been cleared.
-   *  timeouts:   If some module does not support the sequence of there is any
-   *              issue, such a case is detected via timeouts and must be
-   *              handled accordingly (see abort state). In some cases, it is
-   *              possible that a timeout event occurres 'simultaneously' with
-   *              some other event. This can be caused by several timing issues
-   *              and is a valid situation. As a result, any other events
-   *              should be handled before the timeout event. If the other
-   *              events are expected and valid, this implementation requires
-   *              the timeout event flag to be cleared explicitely. Otherwise
-   *              it is evaluated at the end of each iteration of the loop.
-   *  delays:     Depending on the current state, delays are required by SSSP
-   *              for timing of the sequential activation of signals.
-   */
-  aosDbgPrintf("SSSP stack initialization sequence:\n");
-  while (flags.loop) {
-#if (AMIROOS_CFG_DBG == true)
-    switch (stage) {
-      case STAGE_3_1:
-        aosDbgPrintf(">>> 3-1\n");
-        break;
-      case STAGE_3_2:
-        aosDbgPrintf(">>> 3-2\n");
-        break;
-      case STAGE_3_3_WAITFORFIRSTID:
-        aosDbgPrintf(">>> 3-3 (1st ID)\n");
-        break;
-      case STAGE_3_3_WAITFORIDORSIG:
-        aosDbgPrintf(">>> 3-3 (ID/sig)\n");
-        break;
-      case STAGE_3_3_WAITFORID:
-        aosDbgPrintf(">>> 3-3 (ID)\n");
-        break;
-      case STAGE_3_4_FINISH:
-        aosDbgPrintf(">>> 3-4 (finish)\n");
-        break;
-      case STAGE_3_4_ABORT_ACTIVE:
-        aosDbgPrintf(">>> 3-4 (active abort)\n");
-        break;
-      case STAGE_3_4_ABORT:
-        aosDbgPrintf(">>> 3-4 (abort)\n");
-        break;
-    }
-#endif /* (AMIROOS_CFG_DBG == true) */
-
-    // reset wfe flag for the next iteration
-    flags.wfe_next = true;
-
-    // waiting for events (may be skipped)
-    if (flags.wfe) {
-      // wait for any event to occur
-      aosDbgPrintf("WFE...");
-      eventmask = chEvtWaitAnyTimeout(ALL_EVENTS, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT));
-      aosDbgPrintf("\t0x%08X", eventmask);
-    } else {
-      aosDbgPrintf("WFE skipped");
-      eventmask = 0;
-    }
-    aosSysGetUptime(&uptime);
-    aosDbgPrintf("\t%04ums\n", (uint32_t)(uptime / MICROSECONDS_PER_MILLISECOND));
-
-    /*
-     * execute some general tasks and high priority events
-     */
-    // no event occurred at all
-    if ((flags.wfe) && (eventmask == 0)) {
-      aosDbgPrintf("ERR: no evt\n");
-      // enforce timeout event
-      chEvtBroadcast(&eventSourceTimeout);
-      continue;
-    }
-    // if an IO event occurred
-    if (eventmask & _eventListenerIO.events) {
-      ioflags = chEvtGetAndClearFlags(&_eventListenerIO);
-      aosDbgPrintf("INFO: IO evt (0x%08X)\n", ioflags);
-      // a power-down event occurred
-      if (ioflags & MODULE_SSSP_EVENTFLAGS_PD) {
-        aosDbgPrintf("PD evt\n");
-        // deactivate S and UP
-        aosDbgPrintf("disabling S\n");
-        apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
-#if (AMIROOS_CFG_SSSP_STACK_END != true)
-        aosDbgPrintf("disabling UP\n");
-        apalControlGpioSet(&moduleSsspGpioUp, APAL_GPIO_OFF);
-#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
-        // set shutdown flag and exit the loop
-        shutdown = AOS_SHUTDOWN_PASSIVE;
-        break;
-      }
-      // the S signal was deactivated
-      if (ioflags & MODULE_SSSP_EVENTFLAGS_SYNC) {
-        apalControlGpioState_t sstate;
-        apalControlGpioGet(&moduleSsspGpioSync, &sstate);
-        if (sstate == APAL_GPIO_ON) {
-          aosDbgPrintf("S evt (enabled)\n");
-        } else {
-          aosDbgPrintf("S evt (disabled)\n");
-          // either finish or abort
-          if ((stage == STAGE_3_3_WAITFORID) && (aos.sssp.moduleId != 0)) {
-            stage = STAGE_3_4_FINISH;
-          } else if (stage != STAGE_3_4_ABORT) {
-            stage = STAGE_3_4_ABORT_ACTIVE;
-          }
-        }
-      }
-    }
-    // an OS event occurred
-    if (eventmask & _eventListenerOS.events) {
-      aosDbgPrintf("WARN: OS evt\n");
-      // get the flags
-      eventflags_t oseventflags = chEvtGetAndClearFlags(&_eventListenerOS);
-      // there should be no OS events at this point
-#if defined(MODULE_SSSP_STARTUP_3_OSEVENT_HOOK)
-      MODULE_SSSP_STARTUP_3_OSEVENT_HOOK(eventmask, eventflags);
-#else /* defined(MODULE_SSSP_STARTUP_3_OSEVENT_HOOK) */
-      _unexpectedEventError(eventmask, oseventflags);
-#endif /* defined(MODULE_SSSP_STARTUP_3_OSEVENT_HOOK) */
-    }
-    // if a CAN event occurred
-    if ((eventmask & eventListenerCan.events)) {
-      aosDbgPrintf("CAN evt\n");
-      // fetch message
-      if (flags.wfe) {
-        canReceiveTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &canRxFrame, TIME_IMMEDIATE);
-        aosDbgPrintf("CAN <- 0x%03X\n", canRxFrame.SID);
-      }
-      // identify and handle abort messgaes
-      if (canRxFrame.SID == SSSP_STACKINIT_CANMSGID_ABORT) {
-        stage = STAGE_3_4_ABORT;
-      }
-      // warn if a unexpected message was received
-      else if ((canRxFrame.SID != SSSP_STACKINIT_CANMSGID_INIT) &&
-               (canRxFrame.SID != SSSP_STACKINIT_CANMSGID_MODULEID)) {
-        aosDbgPrintf("WARN: unknown msg\n");
-      }
-      // any further pending messages are fetched at the end of the loop
-    }
-    // if a timeout event occurred
-    if (eventmask & eventListenerTimeout.events) {
-      aosDbgPrintf("timeout evt\n");
-      // is handled at the end of the loop (or must be cleared by FSM)
-    }
-    // if a delay event occurred
-    if (eventmask & eventListenerDelay.events) {
-      aosDbgPrintf("delay evt\n");
-      // is handled by FSM
-    }
-
-    /*
-     * this is the actual FSM
-     */
-    switch (stage) {
-      case STAGE_3_1:
-      {
-        aos.sssp.stage = AOS_SSSP_STARTUP_3_1;
-
-        // there was no event at all (skipped wfe)
-        if (eventmask == 0 && flags.wfe == false) {
-#if (AMIROOS_CFG_SSSP_MASTER == true)
-          // initialize the stage by transmitting an according CAN message
-          aosDbgPrintf("CAN -> init\n");
-          canTxFrame.DLC = 0;
-          canTxFrame.SID = SSSP_STACKINIT_CANMSGID_INIT;
-          if (canTransmitTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &canTxFrame, TIME_IMMEDIATE) != MSG_OK) {
-            chEvtBroadcast(&eventSourceTimeout);
-            break;
-          }
-          // activate S
-          aosDbgPrintf("enabling S\n");
-          apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_ON);
-#if (AMIROOS_CFG_SSSP_STACK_START == true)
-          // proceed immediately
-          stage = STAGE_3_2;
-          flags.wfe_next = false;
-#else /* (AMIROOS_CFG_SSSP_STACK_START == true) */
-          // set the timeout timer
-          chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
-          // proceed
-          stage = STAGE_3_3_WAITFORFIRSTID;
-#endif /* (AMIROOS_CFG_SSSP_STACK_START == true) */
-#else /* (AMIROOS_CFG_SSSP_MASTER == true) */
-          // set the timeout timer
-          chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
-#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
-        }
-
-#if (AMIROOS_CFG_SSSP_MASTER != true)
-        // a CAN message was received
-        else if (eventmask & eventListenerCan.events) {
-          // if an initiation message was received
-          if (canRxFrame.DLC == 0 &&
-              canRxFrame.RTR == CAN_RTR_DATA &&
-              canRxFrame.IDE == CAN_IDE_STD &&
-              canRxFrame.SID == SSSP_STACKINIT_CANMSGID_INIT) {
-            aosDbgPrintf("init msg\n");
-            // reset the timeout timer and clear pending flags
-            chVTReset(&timerTimeout);
-            chEvtWaitAnyTimeout(eventListenerTimeout.events, TIME_IMMEDIATE);
-            eventmask &= ~(eventListenerTimeout.events);
-            // activate S
-            aosDbgPrintf("enabling S\n");
-            apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_ON);
-#if (AMIROOS_CFG_SSSP_STACK_START == true)
-            // proceed
-            stage = STAGE_3_2;
-            flags.wfe_next = false;
-#else /* (AMIROOS_CFG_SSSP_STACK_START == true) */
-            // set the timeout timer
-            chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
-            // proceed
-            stage = STAGE_3_3_WAITFORFIRSTID;
-#endif /* (AMIROOS_CFG_SSSP_STACK_START == true) */
-          }
-        }
-#endif /* (AMIROOS_CFG_SSSP_MASTER != true) */
-
-        break;
-      } /* end of STAGE_3_1 */
-
-      case STAGE_3_2:
-      {
-#if (AMIROOS_CFG_SSSP_STACK_START == true)
-        aos.sssp.stage = AOS_SSSP_STARTUP_3_2;
-
-        // if this stage was just entered
-        if (flags.wfe == false) {
-          // set the module ID
-          aos.sssp.moduleId = 1;
-          // broadcast module ID
-          aosDbgPrintf("CAN -> ID (%u)\n", aos.sssp.moduleId);
-          canTxFrame.DLC = 4;
-          canTxFrame.SID = SSSP_STACKINIT_CANMSGID_MODULEID;
-          _serialize(canTxFrame.data8, aos.sssp.moduleId, 4);
-          if (canTransmitTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &canTxFrame, TIME_IMMEDIATE) != MSG_OK) {
-            chEvtBroadcast(&eventSourceTimeout);
-            break;
-          }
-#if (AMIROOS_CFG_DBG == true)
-          lastid = aos.sssp.moduleId;
-#endif /* (AMIROOS_CFG_DBG == true) */
-#if (AMIROOS_CFG_SSSP_STACK_END == true)
-          // sequence is already over
-          // deactivate S
-          aosDbgPrintf("disabling S\n");
-          apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
-          // proceed
-          stage = STAGE_3_3_WAITFORID;
-#else /* (AMIROOS_CFG_SSSP_STACK_END == true) */
-          // set the delay timer so the UP signal is activated later
-          chVTSet(&timerDelay, chTimeUS2I(AMIROOS_CFG_SSSP_SIGNALDELAY), _ssspTimerCallback, &eventSourceDelay);
-#endif /* (AMIROOS_CFG_SSSP_STACK_END == true) */
-        }
-
-        // if a delay event occurred
-        if (eventmask & eventListenerDelay.events) {
-          // activate UP
-          aosDbgPrintf("enabling UP\n");
-          apalControlGpioSet(&moduleSsspGpioUp, APAL_GPIO_ON);
-          // deactivate S
-          aosDbgPrintf("disabling S\n");
-          apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
-          // explicitely clear timeout event flag
-          chEvtWaitAnyTimeout(eventListenerTimeout.events, TIME_IMMEDIATE);
-          eventmask &= ~(eventListenerTimeout.events);
-          // proceed
-          stage = STAGE_3_3_WAITFORID;
-        }
-#endif /* (AMIROOS_CFG_SSSP_STACK_START == true) */
-
-        break;
-      } /* end of STAGE_3_2 */
-
-      case STAGE_3_3_WAITFORFIRSTID:
-      {
-#if (AMIROOS_CFG_SSSP_STACK_START != true)
-        aos.sssp.stage = AOS_SSSP_STARTUP_3_3;
-
-        // a CAN message was received
-        if (eventmask & eventListenerCan.events) {
-          // if an ID message was received
-          if (canRxFrame.DLC == 4 &&
-              canRxFrame.RTR == CAN_RTR_DATA &&
-              canRxFrame.IDE == CAN_IDE_STD &&
-              canRxFrame.SID == SSSP_STACKINIT_CANMSGID_MODULEID) {
-            aosDbgPrintf("ID (%u)\n", (uint32_t)_deserialize(canRxFrame.data8, 4));
-            // validate received ID
-            if (lastid < _deserialize(canRxFrame.data8, 4)) {
-              // store received ID
-              lastid = _deserialize(canRxFrame.data8, 4);
-              // restart timeout timer
-              chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
-              // proceed
-              stage = STAGE_3_3_WAITFORIDORSIG;
-            } else {
-              aosDbgPrintf("ERR: invalid ID\n");
-              // abort
-              stage = STAGE_3_4_ABORT_ACTIVE;
-              flags.wfe_next = false;
-            }
-            // explicitely clear timeout event flag
-            chEvtWaitAnyTimeout(eventListenerTimeout.events, TIME_IMMEDIATE);
-            eventmask &= ~(eventListenerTimeout.events);
-          }
-        }
-#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */
-        break;
-      } /* end of STAGE_3_3_WAITFORFIRSTID */
-
-      case STAGE_3_3_WAITFORIDORSIG:
-      {
-#if (AMIROOS_CFG_SSSP_STACK_START != true)
-        aos.sssp.stage = AOS_SSSP_STARTUP_3_3;
-
-        // a CAN message was received
-        if (eventmask & eventListenerCan.events) {
-          // if an ID message was received
-          if (canRxFrame.DLC == 4 &&
-              canRxFrame.RTR == CAN_RTR_DATA &&
-              canRxFrame.IDE == CAN_IDE_STD &&
-              canRxFrame.SID == SSSP_STACKINIT_CANMSGID_MODULEID) {
-            aosDbgPrintf("ID (%u)\n", (uint32_t)_deserialize(canRxFrame.data8, 4));
-            // validate received ID
-            if (lastid < _deserialize(canRxFrame.data8, 4)) {
-              // store received ID
-              lastid = _deserialize(canRxFrame.data8, 4);
-              // restart timeout timer
-              chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
-            } else {
-              aosDbgPrintf("ERR: invalid ID\n");
-              // abort
-              stage = STAGE_3_4_ABORT_ACTIVE;
-              flags.wfe_next = false;
-            }
-            // explicitely clear timeout event flag
-            chEvtWaitAnyTimeout(eventListenerTimeout.events, TIME_IMMEDIATE);
-            eventmask &= ~(eventListenerTimeout.events);
-          }
-        }
-
-        // if an IO event was received (DN signal)
-        if ((eventmask & _eventListenerIO.events) && (ioflags & MODULE_SSSP_EVENTFLAGS_DN)) {
-          aosDbgPrintf("DN evt\n");
-          // reset timeout timer
-          chVTReset(&timerTimeout);
-          chEvtWaitAnyTimeout(eventListenerTimeout.events, TIME_IMMEDIATE);
-          eventmask &= ~(eventListenerTimeout.events);
-          // increment and broadcast ID
-          aos.sssp.moduleId = lastid + 1;
-          aosDbgPrintf("CAN -> ID (%u)\n", aos.sssp.moduleId);
-          canTxFrame.DLC = 4;
-          canTxFrame.SID = SSSP_STACKINIT_CANMSGID_MODULEID;
-          _serialize(canTxFrame.data8, aos.sssp.moduleId, 4);
-          if (canTransmitTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &canTxFrame, TIME_IMMEDIATE) != MSG_OK) {
-            chEvtBroadcast(&eventSourceTimeout);
-            break;
-          }
-          // set delay timer
-          chVTSet(&timerDelay, chTimeUS2I(AMIROOS_CFG_SSSP_SIGNALDELAY), _ssspTimerCallback, &eventSourceDelay);
-        }
-
-        // if a delay event occurred
-        if (eventmask & eventListenerDelay.events) {
-#if (AMIROOS_CFG_SSSP_STACK_END != true)
-          // activate UP
-          aosDbgPrintf("enabling UP\n");
-          apalControlGpioSet(&moduleSsspGpioUp, APAL_GPIO_ON);
-#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
-          // deactivate S
-          aosDbgPrintf("disabling S\n");
-          apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
-          // reset the timeout timer
-          chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
-          chEvtWaitAnyTimeout(eventListenerTimeout.events, TIME_IMMEDIATE);
-          eventmask &= ~(eventListenerTimeout.events);
-          // proceed
-          stage = STAGE_3_3_WAITFORID;
-        }
-#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */
-
-        break;
-      } /* end of STAGE_3_3_WAITFORIDORSIG */
-
-      case STAGE_3_3_WAITFORID:
-      {
-        aos.sssp.stage = AOS_SSSP_STARTUP_3_3;
-
-#if (AMIROOS_CFG_SSSP_STACK_END != true)
-        // a CAN message was received
-        if (eventmask & eventListenerCan.events) {
-          // if an ID message was received
-          if (canRxFrame.DLC == 4 &&
-              canRxFrame.RTR == CAN_RTR_DATA &&
-              canRxFrame.IDE == CAN_IDE_STD &&
-              canRxFrame.SID == SSSP_STACKINIT_CANMSGID_MODULEID) {
-#if (AMIROOS_CFG_SSSP_STACK_START != true) || (AMIROOS_CFG_DBG == true)
-            // Plausibility of the received ID is not checked at this point but is done by other modules still in a previous stage.
-            lastid = _deserialize(canRxFrame.data8, 4);
-            aosDbgPrintf("ID (%u)\n", lastid);
-#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) || (AMIROOS_CFG_DBG == true) */
-            // restart timeout timer
-            chVTSet(&timerTimeout, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceTimeout);
-            chEvtWaitAnyTimeout(eventListenerTimeout.events, TIME_IMMEDIATE);
-            eventmask &= ~(eventListenerTimeout.events);
-          }
-        }
-#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
-
-        break;
-      } /* end of STAGE_3_3_WAITFORID */
-
-      case STAGE_3_4_FINISH:
-      {
-        aos.sssp.stage = AOS_SSSP_STARTUP_3_4;
-
-        // if an IO event was received (S signal)
-        if ((eventmask & _eventListenerIO.events) && (ioflags & MODULE_SSSP_EVENTFLAGS_SYNC)) {
-          // reset the timeout timer
-          chVTReset(&timerTimeout);
-          chEvtWaitAnyTimeout(eventListenerTimeout.events, TIME_IMMEDIATE);
-          eventmask &= ~(eventListenerTimeout.events);
-          //set the delay timer
-          chVTSet(&timerDelay, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT), _ssspTimerCallback, &eventSourceDelay);
-        }
-
-        // if a CAN event was received
-        if (eventmask & eventListenerCan.events) {
-          // if an abort message was received
-          if (canRxFrame.SID == SSSP_STACKINIT_CANMSGID_ABORT) {
-            aosDbgPrintf("abort msg\n");
-            // reset the delay timer
-            chVTReset(&timerDelay);
-            chEvtWaitAnyTimeout(eventListenerDelay.events, TIME_IMMEDIATE);
-            eventmask &= ~(eventListenerDelay.events);
-            // proceed
-            stage = STAGE_3_4_ABORT;
-          }
-        }
-
-        // if a delay timer event occurred
-        if (eventmask & eventListenerDelay.events) {
-          aosDbgPrintf("sequence sucessful\n");
-          // sequence finished sucessfully
-          flags.loop = false;
-        }
-
-        break;
-      } /* end of STAGE_3_4_FINISH */
-
-      case STAGE_3_4_ABORT_ACTIVE:
-      {
-        aos.sssp.stage = AOS_SSSP_STARTUP_3_4;
-
-        // emit abort message
-        canTxFrame.DLC = 0;
-        canTxFrame.SID = SSSP_STACKINIT_CANMSGID_ABORT;
-        canTransmitTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &canTxFrame, TIME_INFINITE);
-        aosDbgPrintf("CAN -> abort\n");
-        // clear timeout flag
-        eventmask &= ~(eventListenerTimeout.events);
-        // proceed immediately
-        stage = STAGE_3_4_ABORT;
-        flags.wfe_next = false;
-        break;
-      } /* end of STAGE_3_4_ABORT_ACTIVE */
-
-      case STAGE_3_4_ABORT:
-      {
-        aos.sssp.stage = AOS_SSSP_STARTUP_3_4;
-
-        // deactivate S
-        aosDbgPrintf("disabling SYNC\n");
-        apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
-        // invalidate module ID
-        aos.sssp.moduleId = 0;
-
-        // if an IO event was received (S signal)
-        if ((eventmask & _eventListenerIO.events) && (ioflags & MODULE_SSSP_EVENTFLAGS_SYNC)) {
-          aosDbgPrintf("sequence aborted\n");
-          // exit the sequence
-          flags.loop = false;
-        }
-
-        break;
-      } /* end of STAGE_3_4_ABORT */
-    } /* end of switch(stage) */
-
-    // fetch pending CAN message (if any)
-    if ((eventmask & eventListenerCan.events) && (canReceiveTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &canRxFrame, TIME_IMMEDIATE) == MSG_OK)) {
-      aosDbgPrintf("CAN <- 0x%03X\n", canRxFrame.SID);
-      flags.wfe_next = false;
-    }
-
-    // handle unhandled timeout events
-    if (eventmask & eventListenerTimeout.events) {
-      aosDbgPrintf("ERR: timeout evt\n");
-      // abort
-      flags.wfe_next = false;
-      stage = STAGE_3_4_ABORT_ACTIVE;
-    }
-
-    // apply wfe value for next iteration
-    flags.wfe = flags.wfe_next;
-  } /* end of FSM loop */
-
-  // unregister all events (timeout, delay, CAN receive)
-  chEvtUnregister(&eventSourceTimeout, &eventListenerTimeout);
-  chEvtUnregister(&eventSourceDelay, &eventListenerDelay);
-  chEvtUnregister(&MODULE_HAL_CAN.rxfull_event, &eventListenerCan);
-  // clear any pending events (timeout, delay, CAN receive)
-  chEvtWaitAllTimeout(TIMEOUTEVENT_MASK | DELAYEVENT_MASK | CANEVENT_MASK, TIME_IMMEDIATE);
-
-  // reset all control signals
-#if (AMIROOS_CFG_SSSP_STACK_END != true)
-  aosDbgPrintf("disabling UP\n");
-  apalControlGpioSet(&moduleSsspGpioUp, APAL_GPIO_OFF);
-#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
-  aosDbgPrintf("disabling S\n");
-  apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
-  aosSysGetUptime(&uptime);
-  aosDbgPrintf("done\t%04ums\n", (uint32_t)(uptime / MICROSECONDS_PER_MILLISECOND));
-
-  return shutdown;
-}
-#endif /* (SSSP_STAGE3_ENABLE == true) */
-
 /**
  * @brief   Application entry point.
  */
@@ -903,7 +233,6 @@ int main(void)
   // local variables
   eventmask_t eventmask = 0;
   eventflags_t eventflags = 0;
-  eventflags_t ioeventflagsmask = AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK;
   aos_shutdown_t shutdown = AOS_SHUTDOWN_NONE;
 #if defined(AMIROOS_CFG_MAIN_EXTRA_THREAD_VARIABLES)
   AMIROOS_CFG_MAIN_EXTRA_THREAD_VARIABLES
@@ -915,14 +244,6 @@ int main(void)
    * ##########################################################################
    */
 
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_0)
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_0_ARGS)
-  AMIROOS_CFG_MAIN_INIT_HOOK_0(AMIROOS_CFG_MAIN_INIT_HOOK_0_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_0_ARGS) */
-  AMIROOS_CFG_MAIN_INIT_HOOK_0();
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_0_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_0) */
-
   /* hardware, kernel, and operating system initialization */
   // ChibiOS/HAL and custom hal additions (if any)
   halInit();
@@ -930,34 +251,18 @@ int main(void)
   MODULE_INIT_HAL_EXTRA();
 #endif /* defined(MODULE_INIT_HAL_EXTRA) */
 
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_1)
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS)
-  AMIROOS_CFG_MAIN_INIT_HOOK_1(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS) */
-  AMIROOS_CFG_MAIN_INIT_HOOK_1();
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_1) */
-
   // ChibiOS/RT kernel and custom kernel additions (if any)
   chSysInit();
 #if defined(MODULE_INIT_KERNEL_EXTRA)
   MODULE_INIT_KERNEL_EXTRA();
 #endif /* defined(MODULE_INIT_KERNEL_EXTRA) */
 
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_2)
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS)
-  AMIROOS_CFG_MAIN_INIT_HOOK_2(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS) */
-  AMIROOS_CFG_MAIN_INIT_HOOK_2();
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2) */
-
   // AMiRo-OS, additional interrupts and custom OS additions (if any)
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
+#if (AMIROOS_CFG_SHELL_ENABLE == true)
   aosSysInit(moduleShellPrompt);
-#else /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#else /* (AMIROOS_CFG_SHELL_ENABLE == true) */
   aosSysInit();
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 #if defined(MODULE_INIT_INTERRUPTS)
   MODULE_INIT_INTERRUPTS();
 #endif
@@ -965,68 +270,213 @@ int main(void)
   MODULE_INIT_OS_EXTRA();
 #endif /* defined(MODULE_INIT_OS_EXTRA) */
 
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_3)
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS)
-  AMIROOS_CFG_MAIN_INIT_HOOK_3(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS) */
-  AMIROOS_CFG_MAIN_INIT_HOOK_3();
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_3) */
-
   /* event associations */
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
-  ioeventflagsmask |= MODULE_SSSP_EVENTFLAGS_PD | MODULE_SSSP_EVENTFLAGS_SYNC;
+  {
+    eventflags_t flagsmask = AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK | MODULE_SSSP_EVENTFLAG_PD | MODULE_SSSP_EVENTFLAG_S;
 #if (AMIROOS_CFG_SSSP_STACK_START != true)
-  ioeventflagsmask |= MODULE_SSSP_EVENTFLAGS_DN;
+    flagsmask |= MODULE_SSSP_EVENTFLAG_DN;
 #endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */
 #if (AMIROOS_CFG_SSSP_STACK_END != true)
-  ioeventflagsmask |= MODULE_SSSP_EVENTFLAGS_UP;
+    flagsmask |= MODULE_SSSP_EVENTFLAG_UP;
 #endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
+    chEvtRegisterMaskWithFlags(&aos.events.gpio, &_eventListenerGPIO, EVENTMASK_GPIO, flagsmask);
+  }
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+  if (AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) {
+    chEvtRegisterMaskWithFlags(&aos.events.gpio, &_eventListenerGPIO, EVENTMASK_GPIO, AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK);
+  }
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
-  if (ioeventflagsmask != 0) {
-    chEvtRegisterMaskWithFlags(&aos.events.io, &_eventListenerIO, IOEVENT_MASK, ioeventflagsmask);
+  chEvtRegisterMask(&aos.events.os, &_eventListenerOS, EVENTMASK_OS);
+
+#if (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_STARTUP == true)
+
+  /* perform SSSP basic initialization stage */
+
+#if defined(MODULE_SSSP_BASICINIT_HOOK)
+#if defined(MODULE_SSSP_BASICINIT_HOOK_ARGS)
+  MODULE_SSSP_BASICINIT_HOOK(MODULE_SSSP_BASICINIT_HOOK_ARGS);
+#else /* defined(MODULE_SSSP_BASICINIT_HOOK_ARGS) */
+  MODULE_SSSP_BASICINIT_HOOK();
+#endif /* defined(MODULE_SSSP_BASICINIT_HOOK_ARGS) */
+#endif /* defined(MODULE_SSSP_BASICINIT_HOOK) */
+
+  // proceed to startup stage 1.2
+#if (AMIROOS_CFG_SSSP_MASTER == true)
+  while ((shutdown == AOS_SHUTDOWN_NONE) && (aosSsspProceed(NULL, 0, EVENTMASK_SSSPTIMER, &eventmask) != AOS_SUCCESS)) {
+    /*
+     * This code is executed if the received event was not about the delay.
+     * The received event could be casued by any listener.
+     */
+    // GPIO event
+    if (eventmask & _eventListenerGPIO.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerGPIO);
+      // PD event
+      if (eventflags & MODULE_SSSP_EVENTFLAG_PD) {
+        shutdown = AOS_SHUTDOWN_PASSIVE;
+      } else {
+#if defined(MODULE_SSSP_STARTUP_1_1_GPIOEVENT_HOOK)
+        MODULE_SSSP_STARTUP_1_1_GPIOEVENT_HOOK(eventmask, eventflags);
+#else /* defined(MODULE_SSSP_STARTUP_1_1_GPIOEVENT_HOOK) */
+        /* silently ignore any other GPIO events */
+#endif /* defined(MODULE_SSSP_STARTUP_1_1_GPIOEVENT_HOOK) */
+      }
+    }
+    // OS event
+    else if (eventmask & _eventListenerOS.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerOS);
+      _unexpectedEventError(eventmask, eventflags);
+    }
+    // unknown event
+    else {
+      _unexpectedEventError(eventmask, 0);
+    }
   }
-  chEvtRegisterMask(&aos.events.os, &_eventListenerOS, OSEVENT_MASK);
+  if (shutdown == AOS_SHUTDOWN_NONE) {
+    aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_STARTUP_1_2);
+  }
+#else /* (AMIROOS_CFG_SSSP_MASTER == true) */
+  if (shutdown == AOS_SHUTDOWN_NONE) {
+    aosSsspProceed(NULL, 0, 0, NULL);
+    aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_STARTUP_1_2);
+  }
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
 
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_4)
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS)
-  AMIROOS_CFG_MAIN_INIT_HOOK_4(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS) */
-  AMIROOS_CFG_MAIN_INIT_HOOK_4();
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_4) */
+  // proceed to startup stage 1.3
+  while ((shutdown == AOS_SHUTDOWN_NONE) && (aosSsspProceed(&_eventListenerGPIO, MODULE_SSSP_EVENTFLAG_S, EVENTMASK_GPIO, &eventmask) != AOS_SUCCESS)) {
+    /*
+     * This code is executed if the received event was not about a deactivation of the snychronization signal.
+     * The received event could be caused by any listener.
+     */
+    // GPIO event
+    if (eventmask & _eventListenerGPIO.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerGPIO);
+      // PD event
+      if (eventflags & MODULE_SSSP_EVENTFLAG_PD) {
+        shutdown = AOS_SHUTDOWN_PASSIVE;
+      } else {
+#if defined(MODULE_SSSP_STARTUP_1_2_GPIOEVENT_HOOK)
+        MODULE_SSSP_STARTUP_1_2_GPIOEVENT_HOOK(eventmask, eventflags);
+#else /* defined(MODULE_SSSP_STARTUP_1_2_GPIOEVENT_HOOK) */
+        /* silently ignore any other GPIO events */
+#endif /* defined(MODULE_SSSP_STARTUP_1_2_GPIOEVENT_HOOK) */
+      }
+    }
+    // OS event
+    else if (eventmask & _eventListenerOS.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerOS);
+      _unexpectedEventError(eventmask, eventflags);
+    }
+    // unknown event
+    else {
+      _unexpectedEventError(eventmask, 0);
+    }
+  }
+  if (shutdown == AOS_SHUTDOWN_NONE) {
+    aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_STARTUP_1_3);
+  }
+
+  // proceed to startup stage 2.1
+#if (AMIROOS_CFG_SSSP_MASTER == true)
+  while ((shutdown == AOS_SHUTDOWN_NONE) && (aosSsspProceed(NULL, 0, EVENTMASK_SSSPTIMER, &eventmask) != AOS_SUCCESS)) {
+    /*
+     * This code is executed if the received event was not about the delay.
+     * The received event could be caused by any listener.
+     */
+    // GPIO event
+    if (eventmask & _eventListenerGPIO.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerGPIO);
+      // PD event
+      if (eventflags & MODULE_SSSP_EVENTFLAG_PD) {
+        shutdown = AOS_SHUTDOWN_PASSIVE;
+      } else {
+#if defined(MODULE_SSSP_STARTUP_1_3_GPIOEVENT_HOOK)
+        MODULE_SSSP_STARTUP_1_3_GPIOEVENT_HOOK(eventmask, eventflags);
+#else /* defined(MODULE_SSSP_STARTUP_1_3_GPIOEVENT_HOOK) */
+        /* silently ignore any other GPIO events */
+#endif /* defined(MODULE_SSSP_STARTUP_1_3_GPIOEVENT_HOOK) */
+      }
+    }
+    // OS event
+    else if (eventmask & _eventListenerOS.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerOS);
+      _unexpectedEventError(eventmask, eventflags);
+    }
+    // unknown event
+    else {
+      _unexpectedEventError(eventmask, 0);
+    }
+  }
+#else /* (AMIROOS_CFG_SSSP_MASTER == true) */
+  while ((shutdown == AOS_SHUTDOWN_NONE) && (aosSsspProceed(&_eventListenerGPIO, MODULE_SSSP_EVENTFLAG_S, EVENTMASK_GPIO, &eventmask) != AOS_SUCCES)) {
+    /*
+     * This code is executed if the received event was not about a deactivation of the snychronization signal.
+     * The received event could be caused by any listener.
+     */
+    // GPIO event
+    if (eventmask & _eventListenerGPIO.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerGPIO);
+      // PD event
+      if (eventflags & MODULE_SSSP_EVENTFLAG_PD) {
+        shutdown = AOS_SHUTDOWN_PASSIVE;
+      } else {
+#if defined(MODULE_SSSP_STARTUP_1_2_GPIOEVENT_HOOK)
+        MODULE_SSSP_STARTUP_1_2_GPIOEVENT_HOOK(eventmask, eventflags);
+#else /* defined(MODULE_SSSP_STARTUP_1_2_GPIOEVENT_HOOK) */
+        /* silently ignore any other GPIO events */
+#endif /* defined(MODULE_SSSP_STARTUP_1_2_GPIOEVENT_HOOK) */
+      }
+    }
+    // OS event
+    else if (eventmask & _eventListenerOS.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerOS);
+      _unexpectedEventError(eventmask, eventflags);
+    }
+    // unknown event
+    else {
+      _unexpectedEventError(eventmask, 0);
+    }
+  }
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
+  if (shutdown == AOS_SHUTDOWN_NONE) {
+    aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_STARTUP_2_1);
+  }
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_STARTUP == true) */
+
+#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_1)
+#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS)
+  AMIROOS_CFG_MAIN_INIT_HOOK_1(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS);
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS) */
+  AMIROOS_CFG_MAIN_INIT_HOOK_1();
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_1_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_1) */
 
   /* periphery communication interfaces initialization */
-  // module specific initialization (if any)
 #if defined(MODULE_INIT_PERIPHERY_IF)
+  // module specific initialization
   MODULE_INIT_PERIPHERY_IF();
 #endif /* defined(MODULE_INIT_PERIPHERY_IF) */
-#if ((SSSP_STAGE3_ENABLE == true) && (HAL_USE_CAN == TRUE))
-  // CAN
-  if (MODULE_HAL_CAN.state == CAN_STOP) {
-    canStart(&MODULE_HAL_CAN, &moduleHalCanConfig);
-  }
-#endif /* (SSSP_STAGE3_ENABLE == true) && (HAL_USE_CAN == TRUE) */
-  // user interface (if any)
 #if defined(MODULE_HAL_PROGIF)
+  // user interface
   aosIOChannelInit(&_stdiochannel, (BaseAsynchronousChannel*)&MODULE_HAL_PROGIF);
   aosIOChannelOutputEnable(&_stdiochannel);
   aosIOStreamAddChannel(&aos.iostream, &_stdiochannel);
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
+#if (AMIROOS_CFG_SHELL_ENABLE == true)
   aosShellChannelInit(&_stdshellchannel, (BaseAsynchronousChannel*)&MODULE_HAL_PROGIF);
   aosShellChannelInputEnable(&_stdshellchannel);
   aosShellChannelOutputEnable(&_stdshellchannel);
   aosShellStreamAddChannel(&aos.shell.stream, &_stdshellchannel);
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 #endif /* defined(MODULE_HAL_PROGIF) */
 
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_5)
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS)
-  AMIROOS_CFG_MAIN_INIT_HOOK_5(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS) */
-  AMIROOS_CFG_MAIN_INIT_HOOK_5();
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_5) */
+#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_2)
+#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS)
+  AMIROOS_CFG_MAIN_INIT_HOOK_2(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS);
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS) */
+  AMIROOS_CFG_MAIN_INIT_HOOK_2();
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2) */
 
   /* module is ready -> print welcome prompt */
   aosprintf("\n");
@@ -1045,13 +495,13 @@ int main(void)
   aosprintf("######################################################################\n");
   aosprintf("\n");
 
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_6)
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_6_ARGS)
-  AMIROOS_CFG_MAIN_INIT_HOOK_6(AMIROOS_CFG_MAIN_INIT_HOOK_6_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_6_ARGS) */
-  AMIROOS_CFG_MAIN_INIT_HOOK_6();
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_6_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_6) */
+#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_3)
+#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS)
+  AMIROOS_CFG_MAIN_INIT_HOOK_3(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS);
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS) */
+  AMIROOS_CFG_MAIN_INIT_HOOK_3();
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_3_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_3) */
 
 #if (AMIROOS_CFG_TESTS_ENABLE == true)
 #if defined(MODULE_INIT_TESTS)
@@ -1061,33 +511,35 @@ int main(void)
 #endif /* defined(MODULE_INIT_TESTS) */
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_7)
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_7_ARGS)
-  AMIROOS_CFG_MAIN_INIT_HOOK_7(AMIROOS_CFG_MAIN_INIT_HOOK_7_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_7_ARGS) */
-  AMIROOS_CFG_MAIN_INIT_HOOK_7();
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_7_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_7) */
+#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_4)
+#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS)
+  AMIROOS_CFG_MAIN_INIT_HOOK_4(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS);
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS) */
+  AMIROOS_CFG_MAIN_INIT_HOOK_4();
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_4_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_4) */
 
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
-  /* SSSP startup OS synchronization phase (end of startup stage 2) */
-  while ((shutdown == AOS_SHUTDOWN_NONE) && (eventmask = aosSysSsspStartupOsInitSyncCheck(&_eventListenerIO)) != 0) {
+
+  // proceed to startup stage 2.2
+#if (AMIROOS_CFG_SSSP_MASTER == true)
+  while ((shutdown == AOS_SHUTDOWN_NONE) && (aosSsspProceed(NULL, 0, EVENTMASK_SSSPTIMER, &eventmask) != AOS_SUCCESS)) {
     /*
-     * This code is executed if the received event was not about the SYS_SYNC control signal.
-     * The returned event could be caused by any listener (not only the argument).
+     * This code is executed if the received event was not about the delay.
+     * The received event could be caused by any listener.
      */
-    // IO event
-    if (eventmask & _eventListenerIO.events) {
-      eventflags = chEvtGetAndClearFlags(&_eventListenerIO);
+    // GPIO event
+    if (eventmask & _eventListenerGPIO.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerGPIO);
       // PD event
-      if (eventflags & MODULE_SSSP_EVENTFLAGS_PD) {
+      if (eventflags & MODULE_SSSP_EVENTFLAG_PD) {
         shutdown = AOS_SHUTDOWN_PASSIVE;
       } else {
-#if defined(MODULE_SSSP_STARTUP_2_2_IOEVENT_HOOK)
-        MODULE_SSSP_STARTUP_2_2_IOEVENT_HOOK(eventmask, eventflags);
-#else /* defined(MODULE_SSSP_STARTUP_2_2_IOEVENT_HOOK) */
-        // ignore any other IO events
-#endif /* defined(MODULE_SSSP_STARTUP_2_2_IOEVENT_HOOK) */
+#if defined(MODULE_SSSP_STARTUP_1_3_GPIOEVENT_HOOK)
+        MODULE_SSSP_STARTUP_1_3_GPIOEVENT_HOOK(eventmask, eventflags);
+#else /* defined(MODULE_SSSP_STARTUP_1_3_GPIOEVENT_HOOK) */
+        /* silently ignore any other GPIO events */
+#endif /* defined(MODULE_SSSP_STARTUP_1_3_GPIOEVENT_HOOK) */
       }
     }
     // OS event
@@ -1100,104 +552,81 @@ int main(void)
       _unexpectedEventError(eventmask, 0);
     }
   }
-
-#if (HAL_USE_CAN == TRUE)
-
-  /*
-   * There must be no delays at this point, thus no hook is allowed.
-   */
-
-  /* SSSP startup stage 3 (module stack initialization) */
   if (shutdown == AOS_SHUTDOWN_NONE) {
-    shutdown = _ssspModuleStackInitialization();
+    aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_STARTUP_2_2);
   }
-
-  /*
-   * There must be no delays at this point, thus no hook is allowed.
-   */
-
-#if (HAL_USE_RTC == TRUE)
-  /* synchronize calendars */
-  if (shutdown == AOS_SHUTDOWN_NONE) {
-#if (AMIROOS_CFG_SSSP_MASTER == true)
-    CANTxFrame frame;
-    struct tm t;
-    uint64_t encoded;
-
-    frame.DLC = 8;
-    frame.RTR = CAN_RTR_DATA;
-    frame.IDE = CAN_IDE_STD;
-    frame.SID = CALENDERSYNC_CANMSGID;
-
-    aosDbgPrintf("transmitting current date/time...\t");
-    // get current date & time
-    aosSysGetDateTime(&t);
-    // encode
-    encoded = _TM2U64(&t);
-    // serialize
-    _serialize(frame.data8, encoded, 8);
-    // transmit
-    canTransmitTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &frame, TIME_IMMEDIATE);
-
-    aosDbgPrintf("done\n");
 #else /* (AMIROOS_CFG_SSSP_MASTER == true) */
-    CANRxFrame frame;
-    uint64_t encoded;
-    struct tm t;
+  if (shutdown == AOS_SHUTDOWN_NONE) {
+    aosSsspProceed(NULL, 0, 0, NULL);
+    aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_STARTUP_2_2);
+  }
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
 
-    aosDbgPrintf("receiving current date/time...\t");
-    // receive message
-#if (AMIROOS_CFG_DBG == true)
-    // increase timeout in debug mode due to additional delays introduced by the many prinf() calls
-    if (canReceiveTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &frame, chTimeUS2I(10 * AOS_SYSTEM_SSSP_TIMEOUT)) == MSG_OK) {
-#else /* (AMIROOS_CFG_DBG == true) */
-    if (canReceiveTimeout(&MODULE_HAL_CAN, CAN_ANY_MAILBOX, &frame, chTimeUS2I(AOS_SYSTEM_SSSP_TIMEOUT)) == MSG_OK) {
-#endif /* (AMIROOS_CFG_DBG == true) */
-      // validate message
-      if (frame.DLC == 8 &&
-          frame.RTR == CAN_RTR_DATA &&
-          frame.IDE == CAN_IDE_STD &&
-          frame.SID == CALENDERSYNC_CANMSGID) {
-        // deserialize
-        encoded = _deserialize(frame.data8, 8);
-        // decode
-        _U642TM(&t, encoded);
-        // set current date & time
-        aosSysSetDateTime(&t);
-        aosDbgPrintf("success\n");
+  // proceed to startup stage 3 (MSI is enabled), or to operation phase (no MSI)
+  while ((shutdown == AOS_SHUTDOWN_NONE) && (aosSsspProceed(&_eventListenerGPIO, MODULE_SSSP_EVENTFLAG_S, EVENTMASK_GPIO, &eventmask) != AOS_SUCCESS)) {
+    /*
+     * This code is executed if the received event was not about a deactivation of the snychronization signal.
+     * The received event could be caused by any listener.
+     */
+    // GPIO event
+    if (eventmask & _eventListenerGPIO.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerGPIO);
+      // PD event
+      if (eventflags & MODULE_SSSP_EVENTFLAG_PD) {
+        shutdown = AOS_SHUTDOWN_PASSIVE;
       } else {
-        aosDbgPrintf("fail (invalid message)\n");
+#if defined(MODULE_SSSP_STARTUP_2_2_GPIOEVENT_HOOK)
+        MODULE_SSSP_STARTUP_2_2_GPIOEVENT_HOOK(eventmask, eventflags);
+#else /* defined(MODULE_SSSP_STARTUP_2_2_GPIOEVENT_HOOK) */
+        /* silently ignore any other GPIO events */
+#endif /* defined(MODULE_SSSP_STARTUP_2_2_GPIOEVENT_HOOK) */
       }
-    } else {
-      aosDbgPrintf("fail (timeout)\n");
     }
-#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
-    aosDbgPrintf("\n");
+    // OS event
+    else if (eventmask & _eventListenerOS.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerOS);
+      _unexpectedEventError(eventmask, eventflags);
+    }
+    // unknown event
+    else {
+      _unexpectedEventError(eventmask, 0);
+    }
+  }
+  if (shutdown == AOS_SHUTDOWN_NONE) {
+#if (AMIROOS_CFG_SSSP_MSI == true)
+    aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_STARTUP_3_1);
+#else /* (AMIROOS_CFG_SSSP_MSI == true) */
+    aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_OPERATION);
+#endif /* (AMIROOS_CFG_SSSP_MSI == true) */
   }
-#endif /* (HAL_USE_RTC == TRUE) */
-#endif /* (HAL_USE_CAN == TRUE) */
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_8)
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_8_ARGS)
-  AMIROOS_CFG_MAIN_INIT_HOOK_8(AMIROOS_CFG_MAIN_INIT_HOOK_8_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_8_ARGS) */
-  AMIROOS_CFG_MAIN_INIT_HOOK_8();
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_8_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_8) */
+  // start the internal system uptime counter
+  aosSysStartUptime();
+
+  /*
+   * There must be no delays at this point, thus no hook allowed.
+   */
+
+#if (AMIROOS_CFG_SSSP_MSI == true)
+
+  //TODO
+
+#endif /* (AMIROOS_CFG_SSSP_MSI == true) */
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   /* completely start AMiRo-OS */
   if (shutdown == AOS_SHUTDOWN_NONE) {
     aosSysStart();
   }
 
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_9)
-#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_9_ARGS)
-  AMIROOS_CFG_MAIN_INIT_HOOK_9(AMIROOS_CFG_MAIN_INIT_HOOK_9_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_9_ARGS) */
-  AMIROOS_CFG_MAIN_INIT_HOOK_9();
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_9_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_9) */
+#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_5)
+#if defined(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS)
+  AMIROOS_CFG_MAIN_INIT_HOOK_5(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS);
+#else /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS) */
+  AMIROOS_CFG_MAIN_INIT_HOOK_5();
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_5_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_5) */
 
   /*
    * ##########################################################################
@@ -1214,60 +643,64 @@ int main(void)
     eventmask = chEvtWaitOne(ALL_EVENTS);
 #endif /* (AMIROOS_CFG_MAIN_LOOP_TIMEOUT != 0) */
 
-#if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_0)
-#if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_0_ARGS)
-    AMIROOS_CFG_MAIN_LOOP_HOOK_0(AMIROOS_CFG_MAIN_LOOP_HOOK_0_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_0_ARGS) */
-    AMIROOS_CFG_MAIN_LOOP_HOOK_0();
-#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_0_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_0) */
+#if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1)
+#if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS)
+    AMIROOS_CFG_MAIN_LOOP_HOOK_1(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS);
+#else /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS) */
+    AMIROOS_CFG_MAIN_LOOP_HOOK_1();
+#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1) */
 
     switch (eventmask) {
-      // if this was an I/O event
-      case IOEVENT_MASK:
+      // if this was an GPIO event
+      case EVENTMASK_GPIO:
         // evaluate flags
-        eventflags = chEvtGetAndClearFlags(&_eventListenerIO);
+        eventflags = chEvtGetAndClearFlags(&_eventListenerGPIO);
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
         // PD event
-        if (eventflags & MODULE_SSSP_EVENTFLAGS_PD) {
+        if (eventflags & MODULE_SSSP_EVENTFLAG_PD) {
+          aosSsspShutdownInit();
           shutdown = AOS_SHUTDOWN_PASSIVE;
         }
         // all other events
-#if defined(MODULE_MAIN_LOOP_IO_EVENT)
+#if defined(MODULE_MAIN_LOOP_GPIOEVENT)
         else {
-          MODULE_MAIN_LOOP_IO_EVENT(eventflags);
+          MODULE_MAIN_LOOP_GPIOEVENT(eventflags);
         }
-#endif /* defined(MODULE_MAIN_LOOP_IO_EVENT) */
+#endif /* defined(MODULE_MAIN_LOOP_GPIOEVENT) */
 #else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
-#if defined(MODULE_MAIN_LOOP_IO_EVENT)
-        MODULE_MAIN_LOOP_IO_EVENT(eventflags);
-#endif /* defined(MODULE_MAIN_LOOP_IO_EVENT) */
+#if defined(MODULE_MAIN_LOOP_GPIOEVENT)
+        MODULE_MAIN_LOOP_GPIOEVENT(eventflags);
+#endif /* defined(MODULE_MAIN_LOOP_GPIOEVENT) */
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
         break;
 
       // if this was an OS event
-      case OSEVENT_MASK:
+      case EVENTMASK_OS:
         // evaluate flags
         eventflags = chEvtGetAndClearFlags(&_eventListenerOS);
         switch (eventflags) {
-#if (AMIROOS_CFG_SSSP_ENABLE == true)
-          case AOS_SYSTEM_EVENTFLAGS_HIBERNATE:
+#if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE)
+          case AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_MASK:
+            shutdown = AOS_SHUTDOWN_ACTIVE;
+            break;
+#elif (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)
+          case AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_HIBERNATE:
             shutdown = AOS_SHUTDOWN_HIBERNATE;
             break;
-          case AOS_SYSTEM_EVENTFLAGS_DEEPSLEEP:
+          case AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_DEEPSLEEP:
             shutdown = AOS_SHUTDOWN_DEEPSLEEP;
             break;
-          case AOS_SYSTEM_EVENTFLAGS_TRANSPORTATION:
+          case AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_TRANSPORTATION:
             shutdown = AOS_SHUTDOWN_TRANSPORTATION;
             break;
-          case AOS_SYSTEM_EVENTFLAGS_RESTART:
+          case AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_RESTART:
             shutdown = AOS_SHUTDOWN_RESTART;
             break;
-#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
-          case AOS_SYSTEM_EVENTFLAGS_SHUTDOWN:
-            shutdown = AOS_SHUTDOWN_DEFAULT;
+          case AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_PASSIVE:
+            _unexpectedEventError(eventmask, eventflags);
             break;
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+#endif /* (AMIROOS_CFG_BOOTLOADER == X) */
           default:
             _unexpectedEventError(eventmask, eventflags);
             break;
@@ -1283,13 +716,13 @@ int main(void)
         break;
     }
 
-#if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1)
-#if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS)
-    AMIROOS_CFG_MAIN_LOOP_HOOK_1(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS) */
-    AMIROOS_CFG_MAIN_LOOP_HOOK_1();
-#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_1) */
+#if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_2)
+#if defined(AMIROOS_CFG_MAIN_LOOP_HOOK_2_ARGS)
+    AMIROOS_CFG_MAIN_LOOP_HOOK_2(AMIROOS_CFG_MAIN_LOOP_HOOK_2_ARGS);
+#else /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_2_ARGS) */
+    AMIROOS_CFG_MAIN_LOOP_HOOK_2();
+#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_2_ARGS) */
+#endif /* defined(AMIROOS_CFG_MAIN_LOOP_HOOK_2) */
   }
 
   /*
@@ -1298,33 +731,30 @@ int main(void)
    * ##########################################################################
    */
 
-#if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0)
-#if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0_ARGS)
-    AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0_ARGS);
-#else /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0_ARGS) */
-    AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0();
-#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0_ARGS) */
-#endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_0) */
+  aosDbgAssert(shutdown != AOS_SHUTDOWN_NONE);
 
   // initialize/acknowledge shutdown
   aosSysShutdownInit(shutdown);
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
+  aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_SHUTDOWN_1_2);
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1_ARGS)
-    AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1_ARGS);
+  AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1_ARGS);
 #else /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1_ARGS) */
-    AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1();
+  AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1();
 #endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1_ARGS) */
 #endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_1) */
 
-  // stop system threads
+  // wait for all threads to terminate
   aosSysStop();
 
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2_ARGS)
-    AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2_ARGS);
+  AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2_ARGS);
 #else /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2_ARGS) */
-    AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2();
+  AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2();
 #endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2_ARGS) */
 #endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_2) */
 
@@ -1333,9 +763,9 @@ int main(void)
 
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3_ARGS)
-    AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3_ARGS);
+  AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3_ARGS);
 #else /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3_ARGS) */
-    AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3();
+  AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3();
 #endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3_ARGS) */
 #endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_3) */
 
@@ -1343,35 +773,155 @@ int main(void)
 #if defined(MODULE_SHUTDOWN_PERIPHERY_IF)
   MODULE_SHUTDOWN_PERIPHERY_IF();
 #endif /* defined(MODULE_SHUTDOWN_PERIPHERY_IF) */
-#if (HAL_USE_CAN == TRUE)
-  if (MODULE_HAL_CAN.state != CAN_STOP) {
-    canStop(&MODULE_HAL_CAN);
-  }
-#endif /* (HAL_USE_CAN == TRUE) */
 
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4)
 #if defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4_ARGS)
-    AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4_ARGS);
+  AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4_ARGS);
 #else /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4_ARGS) */
-    AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4();
+  AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4();
 #endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4_ARGS) */
 #endif /* defined(AMIROOS_CFG_MAIN_SHUTDOWN_HOOK_4) */
 
-  // finally hand over to bootloader
-  aosSysShutdownFinal(shutdown);
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
+
+  // proceed to SSSP shutdown stage 1.3
+  aosSsspProceed(NULL, 0, 0, NULL);
+  aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_SHUTDOWN_1_3);
+
+#if (AMIROOS_CFG_SSSP_SHUTDOWN == true)
+
+  /* AMiRo-OS performs SSSP shutdown phase
+   * NOTE:
+   * The initiating module could deactivate PD at this point to indicate a restart rather than a shutdown request.
+   * AMiRo-OS does not support restart though, thus the signal is not changed.
+   */
+
+  // proceed to SSSP shutdown stage 2.1
+  while (aosSsspProceed(&_eventListenerGPIO, MODULE_SSSP_EVENTFLAG_S, EVENTMASK_GPIO, &eventmask) != AOS_SUCCESS) {
+    /*
+     * This code is executed if the received event was not about a deactivation of the synchronization signal.
+     * The received event could be caused by any listener.
+     */
+    // GPIO event
+    if (eventmask & _eventListenerGPIO.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerGPIO);
+#if defined(MODULE_SSSP_SHUTDOWN_1_3_GPIOEVENT_HOOK)
+        MODULE_SSSP_SHUTDOWN_1_3_GPIOEVENT_HOOK(eventmask, eventflags);
+#else /* defined(MODULE_SSSP_SHUTDOWN_1_3_GPIOEVENT_HOOK) */
+        /* silently ignore any other GPIO events */
+#endif /* defined(MODULE_SSSP_SHUTDOWN_1_3_GPIOEVENT_HOOK) */
+    }
+    // OS event
+    else if (eventmask & _eventListenerOS.events) {
+      eventflags = chEvtGetAndClearFlags(&_eventListenerOS);
+      _unexpectedEventError(eventmask, eventflags);
+    }
+    // unknown event
+    else {
+      _unexpectedEventError(eventmask, 0);
+    }
+  }
+  aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_SHUTDOWN_2_1);
+
+  // proceed to SSSP shutdown stage 2.2
+  aosSsspProceed(NULL, 0, 0, &eventmask);
+  aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_SHUTDOWN_2_2);
+  if (shutdown == AOS_SHUTDOWN_PASSIVE) {
+    aosDbgPrintf("%s request received\n", eventmask ? "shutdown" : "restart");
+  }
+  /* NOTE:
+   * Actually the call of aosSsspProceed() returned an indicator, whether a shutdown or restart has been initiated.
+   * Since AMiRo-OS does not support restart, this return value is ignored and shutdown is assumed.
+   */
+
+  // the initiating module broadcasts the shutdown identifier
+  if (shutdown != AOS_SHUTDOWN_PASSIVE) {
+    // since AMiRo-OS does not support multiple ways to shutdown or restart, the special identifier 0 is broadcasted.
+    aosSsspShutdownBroadcastIdentifier(0);
+  }
+  // passive modules receive the broadcasted identifier
+  else {
+    unsigned int identifier = 0;
+
+    // receive the identifier, which specifies the type of shutdown/restart
+    while ((eventmask = aosSsspShutdownWaitForIdentifierPulse(&_eventListenerGPIO, MODULE_SSSP_EVENTFLAG_S, EVENTMASK_SSSPTIMER, &identifier)) != EVENTMASK_SSSPTIMER) {
+      // GPIO event
+      if (eventmask & _eventListenerGPIO.events) {
+        eventflags = chEvtGetAndClearFlags(&_eventListenerGPIO);
+#if defined(MODULE_SSSP_SHUTDOWN_2_2_GPIOEVENT_HOOK)
+        MODULE_SSSP_SHUTDOWN_2_2_GPIOEVENT_HOOK(eventmask, eventflags);
+#else /* defined(MODULE_SSSP_SHUTDOWN_2_2_GPIOEVENT_HOOK) */
+        /* silently ignore any other GPIO events */
+#endif /* defined(MODULE_SSSP_SHUTDOWN_2_2_GPIOEVENT_HOOK) */
+        /* silently ignore any GPIO events */
+      }
+      // OS event
+      else if (eventmask & _eventListenerOS.events) {
+        eventflags = chEvtGetAndClearFlags(&_eventListenerOS);
+        _unexpectedEventError(eventmask, eventflags);
+      }
+      // unknown event
+      else {
+        _unexpectedEventError(eventmask, 0);
+      }
+    }
+
+    // Since AMiRo-OS does not support multiple ways to shutdown or restart, the identifier is ignored.
+  }
+
+  // proceed to SSSP shutdown stage 2.3
+  aosSsspProceed(NULL, 0, 0, NULL);
+  aosDbgAssert(aos.sssp.stage == AOS_SSSP_STAGE_SHUTDOWN_2_3);
 
   /*
-   * ##########################################################################
-   * # after shutdown/restart                                                 #
-   * ##########################################################################
-   *
-   * NOTE: This code will not be executed, since the bootloader callbacks will stop/restart the MCU.
-   *       It is included nevertheless for the sake of completeness and to explicitely indicate,
-   *       which subsystems should NOT be shut down.
+   * Since AMiRo-OS does only support one basic shutdown and no restart at all, the final shutdown is kept very simple.
    */
 
-  // return an error, since this code should not be executed
-  return -1;
+  // disable interrupts
+  irqDeinit();
+  chSysDisable();
+
+  chThdExit(MSG_OK);
+  return MSG_OK;
+
+#else /* (AMIROOS_CFG_SSSP_SHUTDOWN == true) */
+
+  /* hand over to the bootloader to perform SSSP shutdown phase */
+  aosSysShutdownToBootloader(shutdown);
+
+  aosDbgAssertMsg(false, "AMiRo-OS must not proceed to this point!");
+  chThdExit(MSG_RESET);
+  return MSG_RESET;
+
+#endif /* (AMIROOS_CFG_SSSP_SHUTDOWN == true) */
+
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
+  /*
+   * Depending on the configured bootloader, trivial shutdown is either executed by AMiRo-OS or by that bootloader.
+   */
+#if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE)
+
+  /* AMiRo-OS performs trivial shutdown */
+
+  // disable interrupts
+  irqDeinit();
+  chSysDisable();
+
+  chThdExit(MSG_OK);
+  return MSG_OK;
+
+#elif (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)
+
+  /* AMiRo-BLT performns shutdown */
+  aosSysShutdownToBootloader(shutdown);
+
+  aosDbgAssertMsg(false, "AMiRo-OS must not proceed to this point!");
+  chThdExit(MSG_RESET);
+  return MSG_RESET;
+
+#endif /* (AMIROOS_CFG_BOOTLOADER == X) */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 }
 
 /******************************************************************************/
diff --git a/core/src/aos_shell.c b/core/src/aos_shell.c
index f1c5fd3..3e4ceea 100644
--- a/core/src/aos_shell.c
+++ b/core/src/aos_shell.c
@@ -28,7 +28,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <amiroos.h>
 #include <string.h>
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 
 /******************************************************************************/
 /* LOCAL DEFINITIONS                                                          */
@@ -1637,7 +1637,7 @@ void aosShellThread(void* shell)
       {
         eventflags = chEvtGetAndClearFlags(&((aos_shell_t*)shell)->os.eventListener);
         // handle shutdown/restart events
-        if (eventflags & AOS_SYSTEM_EVENTFLAGS_SHUTDOWN) {
+        if (eventflags & AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_MASK) {
           chThdTerminate(((aos_shell_t*)shell)->thread);
         } else {
           // print an error message
@@ -1720,6 +1720,6 @@ void aosShellThread(void* shell)
   // no chSysUnlock() required since the thread has been terminated an all waiting threads have been woken up
 }
 
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)*/
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
diff --git a/core/src/aos_sssp.c b/core/src/aos_sssp.c
new file mode 100644
index 0000000..683dd79
--- /dev/null
+++ b/core/src/aos_sssp.c
@@ -0,0 +1,573 @@
+/*
+AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
+Copyright (C) 2016..2019  Thomas Schöpping et al.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file    aos_sssp.c
+ * @brief   SSSP related code.
+ *
+ * @addtogroup aos_sssp
+ * @{
+ */
+
+#include <amiroos.h>
+
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
+/******************************************************************************/
+/* LOCAL DEFINITIONS                                                          */
+/******************************************************************************/
+
+/******************************************************************************/
+/* EXPORTED VARIABLES                                                         */
+/******************************************************************************/
+
+/******************************************************************************/
+/* LOCAL TYPES                                                                */
+/******************************************************************************/
+
+/******************************************************************************/
+/* LOCAL VARIABLES                                                            */
+/******************************************************************************/
+
+#if (AMIROOS_CFG_SSSP_MASTER == true) || defined (__DOXYGEN__)
+
+/**
+ * @brief   A timer event based delays.
+ */
+static virtual_timer_t _delayTimer;
+
+/**
+ * @brief   Event source for the delay timer.
+ */
+static event_source_t _eventSourceDelay;
+
+/**
+ * @brief   Event listener for the delay event.
+ */
+static event_listener_t _eventListenerDelay;
+
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
+
+/******************************************************************************/
+/* LOCAL FUNCTIONS                                                            */
+/******************************************************************************/
+
+#if (AMIROOS_CFG_SSSP_MASTER == true) || defined (__DOXYGEN__)
+
+/**
+ * @brief   General callback function to be used for any local timers.
+ *
+ * @param[in] par   A pointer to an @p event_source_t to be fired.
+ */
+static void _timerCallback(void* par)
+{
+  aosDbgCheck(par != NULL);
+
+  chSysLockFromISR();
+  chEvtBroadcastI((event_source_t*)par);
+  chSysUnlockFromISR();
+
+  return;
+}
+
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
+
+/**
+ * @brief   Waits for the S signal to switch to the desired state.
+ *
+ * @param[in]   listener      Pointer to the GPIO event listener to be used.
+ * @param[in]   flags         Event flags to listen to by the event listener (indicating a S signal event).
+ * @param[in]   signalstate   Desired state of the S signal ti be waited for.
+ * @param[out]  received      Output variable to store the received event mask to.
+ *
+ * @return  Status, indicating whether the expected event was received.
+ */
+static inline aos_status_t _waitForS(event_listener_t* listener, eventflags_t flags, apalControlGpioState_t signalstate, eventmask_t* received)
+{
+  aosDbgCheck(listener != NULL);
+  aosDbgCheck(flags != 0);
+  aosDbgCheck(received != NULL);
+
+  // wait for the next event (do not apply any filters in order not to miss any events)
+  *received = chEvtWaitOne(ALL_EVENTS);
+  // if the correct event was triggered
+  if (*received == listener->events) {
+    apalControlGpioState_t s;
+    apalControlGpioGet(&moduleSsspGpioS, &s);
+    // only check for the expected event
+    if (flags & listener->flags && s == signalstate) {
+      // unset the expected flags but keep any other ones
+      listener->flags &= ~flags;
+      return AOS_SUCCESS;
+    }
+  }
+
+  return AOS_FAILURE;
+}
+
+#if (AMIROOS_CFG_SSSP_MASTER == true) || defined(__DOXYGEN__)
+
+/**
+ * @brief   Uses the local delay timer to setup a timed event and waits for it to fire.
+ *
+ * @param[in]   dt          Delay time in microseconds to be set to the timer.
+ * @param[in]   mask        Event mask to be used for the delay timer.
+ * @param[in]   arm_timer   Flag to indicate whether the timer has to be armed yet (i.e. on first call of this function).
+ * @param[out]  received    Output variable to store the received event mask to.
+ *
+ * @return  Status, indicating whether the expected event (delay timer) was received.
+ */
+static inline aos_status_t _delay(uint32_t dt, eventmask_t mask, bool arm_timer, eventmask_t* received)
+{
+  aosDbgCheck(dt != TIME_IMMEDIATE);
+  aosDbgCheck(mask != 0);
+  aosDbgCheck(received != NULL);
+
+  // arm the delay timer once
+  if (arm_timer) {
+    chEvtRegisterMask(&_eventSourceDelay, &_eventListenerDelay, mask);
+    chVTSet(&_delayTimer, chTimeUS2I(dt), _timerCallback, &_eventSourceDelay);
+  }
+
+  // wait for any event to occur (do not apply any filters in order not to miss any events)
+  *received = chEvtWaitOne(ALL_EVENTS);
+
+  // if the timer event was received, cleanup
+  if (*received & _eventListenerDelay.events) {
+    chEvtUnregister(&_eventSourceDelay, &_eventListenerDelay);
+    return AOS_SUCCESS;
+  }
+
+  return AOS_FAILURE;
+}
+
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
+
+/******************************************************************************/
+/* EXPORTED FUNCTIONS                                                         */
+/******************************************************************************/
+
+/**
+ * @brief   Initialize all SSSP related data.
+ */
+void aosSsspInit(void)
+{
+#if (AMIROOS_CFG_SSSP_MSI == true)
+  // module ID is initialized as 'invalid'
+  aos.sssp.moduleId = AOS_SSSP_MODULEID_INVALID;
+#endif /* (AMIROOS_CFG_SSSP_MSI == true) */
+
+#if (AMIROOS_CFG_SSSP_STARTUP == true)
+  // AMiRo-OS has to perform the basic initialization
+  aos.sssp.stage = AOS_SSSP_STAGE_STARTUP_1_1;
+#if (AMIROOS_CFG_DBG == true)
+  // check whether the initial signal configuration is correct
+  {
+    apalControlGpioState_t state;
+    // S signal
+    apalControlGpioGet(&moduleSsspGpioS, &state);
+    aosDbgAssert(state == APAL_GPIO_ON);
+    // PD signal
+    apalControlGpioGet(&moduleSsspGpioPD, &state);
+    aosDbgAssert(state == APAL_GPIO_OFF);
+  }
+#endif /* (AMIROOS_CFG_DBG == true) */
+#else /* (AMIROOS_CFG_SSSP_STARTUP == true) */
+  // basic initialization was already performed by a bootloader
+  aos.sssp.stage = AOS_SSSP_STAGE_STARTUP_2_1;
+#if (AMIROOS_CFG_DBG == true)
+  // check whether the initial signal configuration is correct
+  {
+    apalControlGpioState_t state;
+    // S signal
+    apalControlGpioGet(&moduleSsspGpioS, &state);
+    aosDbgAssert(state == APAL_GPIO_ON);
+    // PD signal
+    apalControlGpioGet(&moduleSsspGpioPD, &state);
+    aosDbgAssert(state == APAL_GPIO_OFF);
+  }
+#endif /* (AMIROOS_CFG_DBG == true) */
+#endif /* (AMIROOS_CFG_SSSP_STARTUP == true) */
+
+#if (AMIROOS_CFG_SSSP_MASTER == true)
+  // initialize static variables
+  chVTObjectInit(&_delayTimer);
+  chEvtObjectInit(&_eventSourceDelay);
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
+
+  return;
+}
+
+/**
+ * @brief   Proceed to the next SSSP stage.
+ *
+ * @param[in]   listener  An optional listener, in case the system has to wait for a specific event.
+ * @param[in]   flags     The relevant flags to wait for (mandatory if a listener is given).
+ * @param[in]   mask      If the stage transition involves a timer event (handled internally by this function),
+ *                        the given input value of this parameter defines the mask to be used for that event.
+ *                        In case a listener was specified, the according mask is retrieved from the listener but this parameter is still used as input for sanity checks.
+ * @param[out]  received  Output variable to store the received event mask to.
+ *
+ * @return  Status, indicating whether proceeding in the protocol was successful.
+ */
+aos_status_t aosSsspProceed(event_listener_t* listener, eventflags_t flags, eventmask_t mask, eventmask_t* received)
+{
+  // local variables
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+  static aos_ssspstage_t laststage = AOS_SSSP_STAGE_UNDEFINED;
+#pragma GCC diagnostic pop
+  aos_ssspstage_t nextstage = aos.sssp.stage;
+
+  // behaviour depends on current SSSP stage of the system
+  switch (aos.sssp.stage) {
+#if (AMIROOS_CFG_SSSP_STARTUP == true)
+
+    /*
+     * Deactivate S signal.
+     * Master node delays execution by one period AOS_SSSP_DELAY.
+     */
+    case AOS_SSSP_STAGE_STARTUP_1_1:
+    {
+#if (AMIROOS_CFG_SSSP_MASTER == true)
+      aosDbgCheck(listener == NULL);
+      aosDbgCheck(flags == 0);
+      aosDbgCheck(mask != 0);
+      aosDbgCheck(received != NULL);
+
+      // delay execution and deactivate the S signal on success
+      if (_delay(AOS_SSSP_DELAY, mask, (laststage != AOS_SSSP_STAGE_STARTUP_1_1), received) == AOS_SUCCESS) {
+        apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_OFF);
+        nextstage = AOS_SSSP_STAGE_STARTUP_1_2;
+      }
+#else /* (AMIROOS_CFG_SSSP_MASTER == true) */
+      aosDbgCheck(listener == NULL);
+      aosDbgCheck(flags == 0);
+      aosDbgCheck(mask == 0);
+      aosDbgCheck(received == NULL);
+
+      // deactivate S signal and proceed
+      apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_OFF);
+      nextstage = AOS_SSSP_STAGE_STARTUP_1_2;
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
+      break;
+    }
+
+    /*
+     * Wait for the S signal to become inactive.
+     */
+    case AOS_SSSP_STAGE_STARTUP_1_2:
+    {
+      aosDbgCheck(listener != NULL);
+      aosDbgCheck(flags != 0);
+      aosDbgCheck(mask == listener->events);
+      aosDbgCheck(received != NULL);
+
+      // wait for the S signal to become inactive and proceed on success
+      if (_waitForS(listener, flags, APAL_GPIO_OFF, received) == AOS_SUCCESS) {
+        nextstage = AOS_SSSP_STAGE_STARTUP_1_3;
+      }
+      break;
+    }
+
+    /*
+     * Wait for the S signal to be activated by the master module.
+     * The master delays execution by one period AOS_SSSP_DELAY.
+     */
+    case AOS_SSSP_STAGE_STARTUP_1_3:
+    {
+#if (AMIROOS_CFG_SSSP_MASTER == true)
+      aosDbgCheck(listener == NULL);
+      aosDbgCheck(flags == 0);
+      aosDbgCheck(mask != 0);
+      aosDbgCheck(received != NULL);
+
+      // delay execution and deactivate the S signal on success
+      if (_delay(AOS_SSSP_DELAY, mask, (laststage != AOS_SSSP_STAGE_STARTUP_1_3), received) == AOS_SUCCESS) {
+        apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_ON);
+        nextstage = AOS_SSSP_STAGE_STARTUP_2_1;
+      }
+#else /* (AMIROOS_CFG_SSSP_MASTER == true) */
+      aosDbgCheck(listener != NULL);
+      aosDbgCheck(flags != 0);
+      aosDbgCheck(mask == listener->events);
+      aosDbgCheck(received != NULL);
+
+      // wait for the S signal to become active and activate it as well and proceed on success
+      if (_waitForS(listener, flags, APAL_GPIO_ON, received) == AOS_SUCCESS) {
+        apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_ON);
+        nextstage = AOS_SSSP_STAGE_STARTUP_2_1;
+      }
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
+      break;
+    }
+
+#endif /* (AMIROOS_CFG_SSSP_STARTUP == true) */
+
+    /*
+     * Deactivate S signal.
+     * Master node delays execution by one period AOS_SSSP_DELAY
+     */
+    case AOS_SSSP_STAGE_STARTUP_2_1:
+    {
+#if (AMIROOS_CFG_SSSP_MASTER == true)
+      aosDbgCheck(listener == NULL);
+      aosDbgCheck(flags == 0);
+      aosDbgCheck(mask != 0);
+      aosDbgCheck(received != NULL);
+
+      // delay execution and deactivate the S signal on success
+      if (_delay(AOS_SSSP_DELAY, mask, (laststage != AOS_SSSP_STAGE_STARTUP_2_1), received) == AOS_SUCCESS) {
+        apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_OFF);
+        nextstage = AOS_SSSP_STAGE_STARTUP_2_2;
+      }
+#else /* (AMIROOS_CFG_SSSP_MASTER == true) */
+      aosDbgCheck(listener == NULL);
+      aosDbgCheck(flags == 0);
+      aosDbgCheck(mask == 0);
+      aosDbgCheck(received == NULL);
+
+      // deactivate S signal and proceed
+      apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_OFF);
+      nextstage = AOS_SSSP_STAGE_STARTUP_2_2;
+      mask = 0;
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
+      break;
+    }
+
+    /*
+     * Wait for the S signal to become inactive.
+     */
+    case AOS_SSSP_STAGE_STARTUP_2_2:
+    {
+      aosDbgCheck(listener != NULL);
+      aosDbgCheck(flags != 0);
+      aosDbgCheck(mask == listener->events);
+      aosDbgCheck(received != NULL);
+
+      // wait for the S signal to become inactive and proceed on success
+      if (_waitForS(listener, flags, APAL_GPIO_OFF, received) == AOS_SUCCESS) {
+#if (AMIROOS_CFG_SSSP_MSI == true)
+        nextstage = AOS_SSSP_STAGE_STARTUP_3;
+#else /* (AMIROOS_CFG_SSSP_MSI == true) */
+        nextstage = AOS_SSSP_STAGE_OPERATION;
+#endif /* (AMIROOS_CFG_SSSP_MSI == true) */
+      }
+      break;
+    }
+
+#if (AMIROOS_CFG_SSSP_MSI == true)
+
+      //TODO
+
+#endif /* (AMIROOS_CFG_SSSP_MSI == true) */
+
+    /*
+     * Delay execution by one perion AOS_SSSP_DELAY, deactivate the SYNC signal and proceed.
+     * NOTE: Actually only the module that initiated the shutdown has to delay execution here.
+     *       For the sake of simlicity though, each module delays execution.
+     */
+    case AOS_SSSP_STAGE_SHUTDOWN_1_2:
+    {
+      aosDbgCheck(listener == NULL);
+      aosDbgCheck(flags == 0);
+      aosDbgCheck(mask == 0);
+      aosDbgCheck(received == NULL);
+
+      // delay execution
+      aosThdUSleep(AOS_SSSP_DELAY);
+      // deactivate S signal
+      apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_OFF);
+      nextstage = AOS_SSSP_STAGE_SHUTDOWN_1_3;
+      break;
+    }
+
+#if (AMIROOS_CFG_SSSP_SHUTDOWN == true)
+
+    /*
+     * Wait for S signal to become inactive.
+     */
+    case AOS_SSSP_STAGE_SHUTDOWN_1_3:
+    {
+      aosDbgCheck(listener != NULL);
+      aosDbgCheck(flags != 0);
+      aosDbgCheck(mask == listener->events);
+      aosDbgCheck(received != NULL);
+
+      // wait for the S signal to become inactive and proceed on success
+      if (_waitForS(listener, flags, APAL_GPIO_OFF, received) == AOS_SUCCESS) {
+        nextstage = AOS_SSSP_STAGE_SHUTDOWN_2_1;
+      }
+      break;
+    }
+
+    /*
+     * Evaluate PD signal to determine whether a shutdown or restart is requested.
+     * The logical state is returned by the function call.
+     */
+    case AOS_SSSP_STAGE_SHUTDOWN_2_1:
+    {
+      aosDbgCheck(listener == NULL);
+      aosDbgCheck(flags == 0);
+      aosDbgCheck(mask == 0);
+      aosDbgCheck(received != NULL);
+
+      // evaluate PD signal
+      apalControlGpioState_t pd;
+      apalControlGpioGet(&moduleSsspGpioPD, &pd);
+      *received = (pd == APAL_GPIO_ON) ? (eventmask_t)~0 : 0;
+      nextstage = AOS_SSSP_STAGE_SHUTDOWN_2_2;
+      break;
+    }
+
+    /*
+     * Proceed with no further actions required.
+     */
+    case AOS_SSSP_STAGE_SHUTDOWN_2_2:
+    {
+      aosDbgCheck(listener == NULL);
+      aosDbgCheck(flags == 0);
+      aosDbgCheck(mask == 0);
+      aosDbgCheck(received == NULL);
+
+      nextstage = AOS_SSSP_STAGE_SHUTDOWN_2_3;
+      break;
+    }
+
+#endif /* (AMIROOS_CFG_SSSP_SHUTDOWN == true) */
+
+    default:
+    {
+      // this case must never occur!
+      aosDbgAssertMsg(false, "Invalid SSSP stage tranition occurred");
+      break;
+    }
+  } /* end of switch (aos.sssp.stage) */
+
+  // outro and return
+  laststage = aos.sssp.stage;
+  const aos_status_t status = (nextstage > aos.sssp.stage) ? AOS_SUCCESS : AOS_FAILURE;
+  aos.sssp.stage = nextstage;
+
+  return status;
+}
+
+void aosSsspShutdownInit(void)
+{
+  // activate S signal
+  apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_ON);
+  // proceed to shutdown phase
+  aos.sssp.stage = AOS_SSSP_STAGE_SHUTDOWN_1_2;
+
+  return;
+}
+
+#if (AMIROOS_CFG_SSSP_SHUTDOWN == true) || defined(__DOXYGEN__)
+
+/**
+ * @brief   Sequnetially broadcast an identifier via S to specify a specific way to shutdown or restart.
+ *
+ * @param[in] identifier  Identifier to be broadcasted.
+ */
+void aosSsspShutdownBroadcastIdentifier(unsigned int identifier)
+{
+  // only broadcast anything if a identifier greater than 0 was specified
+  if (identifier > 0) {
+    // broadcast identifier
+    for (unsigned int pulse = 0; pulse < identifier; ++pulse) {
+      // wait one delay time with S being deactivated
+      aosThdUSleep(AOS_SSSP_DELAY);
+
+      // activate S for one AOS_SSSP_DELAY.
+      apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_ON);
+      aosThdUSleep(AOS_SSSP_DELAY);
+      apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_OFF);
+    }
+  }
+
+  // let a timeout pass and return
+  aosThdUSleep(AOS_SSSP_TIMEOUT);
+
+  return;
+}
+
+/**
+ * @brief   Wait for a pulse during the SSSP shutdown disambiguation procedure.
+ * @details Whenever a pulse is received, the identifier is incremented.
+ *          Otherwise the internal timer is configured and will eventually trigger a timeout event.
+ *
+ * @param[in]     gpiolistener  Event listener for GPIO events.
+ * @param[in]     sflags        Event flags to be set by edges on the S signal.
+ * @param[in]     timermask     Event maks to use for the internal timer.
+ * @param[in,out] identifier    Identifier variable to increment.
+ *
+ * @return  The event mask of whatever event was received during this function call.
+ */
+eventmask_t aosSsspShutdownWaitForIdentifierPulse(event_listener_t* gpiolistener, const eventflags_t sflags, eventmask_t timermask, unsigned int* identifier)
+{
+  aosDbgCheck(gpiolistener != NULL);
+  aosDbgCheck(sflags != 0);
+  aosDbgCheck(timermask != 0);
+  aosDbgCheck(identifier != NULL);
+
+  // local variables
+  eventmask_t mask;
+  eventflags_t flags;
+  apalControlGpioState_t sstate;
+
+  // arm the timer once
+  if (!chVTIsArmed(&_delayTimer)) {
+    chEvtRegisterMask(&_eventSourceDelay, &_eventListenerDelay, timermask);
+    chVTSet(&_delayTimer, chTimeUS2I(AOS_SSSP_TIMEOUT), _timerCallback, &_eventSourceDelay);
+  }
+
+  // wait for any event to occur (do not apply any filters in order not to miss any events)
+  mask = chEvtWaitOne(ALL_EVENTS);
+
+  // GPIO event
+  if (mask & gpiolistener->events) {
+    // retreive flags without clearing them
+    flags = gpiolistener->flags;
+    apalControlGpioGet(&moduleSsspGpioS, &sstate);
+    if (flags == sflags) {
+      apalControlGpioGet(&moduleSsspGpioS, &sstate);
+      // if this was the end of a pulse
+      if (sstate == APAL_GPIO_OFF) {
+        // restart the timer
+        chVTReset(&_delayTimer);
+        chVTSet(&_delayTimer, chTimeUS2I(AOS_SSSP_TIMEOUT), _timerCallback, &_eventSourceDelay);
+        // increment the identifier
+        ++(*identifier);
+      }
+    }
+  }
+  // timer event
+  else if (mask & _eventListenerDelay.events) {
+    // unregister event
+    chEvtUnregister(&_eventSourceDelay, &_eventListenerDelay);
+  }
+  // any further events must be handled externally
+
+  return mask;
+}
+
+#endif /* (AMIROOS_CFG_SSSP_SHUTDOWN == true) */
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
+/** @} */
diff --git a/core/src/aos_system.c b/core/src/aos_system.c
index c9b3072..97270e6 100644
--- a/core/src/aos_system.c
+++ b/core/src/aos_system.c
@@ -84,14 +84,14 @@ aos_system_t aos;
 /*
  * forward declarations
  */
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv[]);
 static int _shellcmd_infocb(BaseSequentialStream* stream, int argc, char* argv[]);
 static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* argv[]);
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 static int _shellcmd_kerneltestcb(BaseSequentialStream* stream, int argc, char* argv[]);
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Timer to accumulate system uptime.
@@ -108,7 +108,9 @@ static aos_timestamp_t _uptime;
  */
 static systime_t _synctime;
 
-#if ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER == true)) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SSSP_MASTER == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   Timer to drive the SYS_SYNC signal for system wide time synchronization according to SSSP.
  */
@@ -118,17 +120,21 @@ static virtual_timer_t _syssynctimer;
  * @brief   Last uptime of system wide time synchronization.
  */
 static aos_timestamp_t _syssynctime;
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER == true) */
 
-#if ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true)) || defined(__DOXYGEN__)
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
+
+#if ((AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true)) || defined(__DOXYGEN__)
+
 /**
  * @brief   Offset between local clock and system wide synchronization signal.
  */
 static float _syssyncskew;
 
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true) */
+#endif /* (AMIROOS_CFG_SSSP_MASTER != true) && (AMIROOS_CFG_PROFILE == true) */
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell thread working area.
  */
@@ -157,19 +163,21 @@ static AOS_SHELL_COMMAND(_shellcmd_config, "module:config", _shellcmd_configcb);
 /**
  * @brief   Shell command to shutdown the system.
  */
-#if (AMIROOS_CFG_SSSP_ENABLE == true)
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
 static AOS_SHELL_COMMAND(_shellcmd_shutdown, "system:shutdown", _shellcmd_shutdowncb);
 #else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 static AOS_SHELL_COMMAND(_shellcmd_shutdown, "module:shutdown", _shellcmd_shutdowncb);
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   Shell kommand to run a test of the ChibiOS/RT kernel.
  */
 static AOS_SHELL_COMMAND(_shellcmd_kerneltest, "kernel:test", _shellcmd_kerneltestcb);
+
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /******************************************************************************/
 /* LOCAL FUNCTIONS                                                            */
@@ -261,7 +269,7 @@ static void _printSystemInfo(BaseSequentialStream* stream)
   _printSystemInfoLine(stream, "Architecture", SYSTEM_INFO_NAMEWIDTH, "%s", PORT_ARCHITECTURE_NAME);
   _printSystemInfoSeparator(stream, '-', SYSTEM_INFO_WIDTH);
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
-  _printSystemInfoLine(stream, "AMiRo-OS" , SYSTEM_INFO_NAMEWIDTH, "%u.%u.%u %s (SSSP %u.%u)", AMIROOS_VERSION_MAJOR, AMIROOS_VERSION_MINOR, AMIROOS_VERSION_PATCH, AMIROOS_RELEASE_TYPE, AOS_SYSTEM_SSSP_VERSION_MAJOR, AOS_SYSTEM_SSSP_VERSION_MINOR);
+  _printSystemInfoLine(stream, "AMiRo-OS" , SYSTEM_INFO_NAMEWIDTH, "%u.%u.%u %s (SSSP %u.%u)", AMIROOS_VERSION_MAJOR, AMIROOS_VERSION_MINOR, AMIROOS_VERSION_PATCH, AMIROOS_RELEASE_TYPE, AOS_SSSP_VERSION_MAJOR, AOS_SSSP_VERSION_MINOR);
 #else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   _printSystemInfoLine(stream, "AMiRo-OS" , SYSTEM_INFO_NAMEWIDTH, "%u.%u.%u %s", AMIROOS_VERSION_MAJOR, AMIROOS_VERSION_MINOR, AMIROOS_VERSION_PATCH, AMIROOS_RELEASE_TYPE);
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
@@ -273,7 +281,10 @@ static void _printSystemInfo(BaseSequentialStream* stream)
   _printSystemInfoLine(stream, "Compiled" , SYSTEM_INFO_NAMEWIDTH, "%s - %s", __DATE__, __TIME__);
 
   // print static information about the bootloader
+#if (AMIROOS_CFG_BOOTLOADER != AOS_BOOTLOADER_NONE)
   _printSystemInfoSeparator(stream, '-', SYSTEM_INFO_WIDTH);
+#endif /* (AMIROOS_CFG_BOOTLOADER != AOS_BOOTLOADER_NONE) */
+#if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)
   if (BL_CALLBACK_TABLE_ADDRESS->magicNumber == BL_MAGIC_NUMBER) {
     _printSystemInfoLine(stream, "AMiRo-BLT", SYSTEM_INFO_NAMEWIDTH, "%u.%u.%u %s (SSSP %u.%u)", BL_CALLBACK_TABLE_ADDRESS->vBootloader.major, BL_CALLBACK_TABLE_ADDRESS->vBootloader.minor, BL_CALLBACK_TABLE_ADDRESS->vBootloader.patch,
                          (BL_CALLBACK_TABLE_ADDRESS->vBootloader.identifier == BL_VERSION_ID_AMiRoBLT_Release) ? "stable" :
@@ -284,31 +295,30 @@ static void _printSystemInfo(BaseSequentialStream* stream)
                          "<release type unknown>",
                          BL_CALLBACK_TABLE_ADDRESS->vSSSP.major, BL_CALLBACK_TABLE_ADDRESS->vSSSP.minor);
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
-    if (BL_CALLBACK_TABLE_ADDRESS->vSSSP.major != AOS_SYSTEM_SSSP_VERSION_MAJOR) {
-      if (stream) {
-        chprintf(stream, "WARNING: Bootloader and AMiRo-OS implement incompatible SSSP versions!\n");
-      } else {
-        aosprintf("WARNING: Bootloader and AMiRo-OS implement incompatible SSSP versions!\n");
-      }
+    if (BL_CALLBACK_TABLE_ADDRESS->vSSSP.major != AOS_SSSP_VERSION_MAJOR) {
+      const char* msg = "WARNING: AMiRo-BLT and AMiRo-OS implement incompatible SSSP versions!\n";
+      stream ? chprintf(stream, msg) : aosprintf(msg);
     }
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
     _printSystemInfoLine(stream, "Compiler", SYSTEM_INFO_NAMEWIDTH, "%s %u.%u.%u", (BL_CALLBACK_TABLE_ADDRESS->vCompiler.identifier == BL_VERSION_ID_GCC) ? "GCC" : "<compiler unknown>", BL_CALLBACK_TABLE_ADDRESS->vCompiler.major, BL_CALLBACK_TABLE_ADDRESS->vCompiler.minor, BL_CALLBACK_TABLE_ADDRESS->vCompiler.patch); // TODO: support other compilers than GCC
   } else {
-    if (stream) {
-      chprintf(stream, "Bootloader incompatible or not available.\n");
-    } else {
-      aosprintf("Bootloader incompatible or not available.\n");
-    }
+    const char* msg = "WARNING: AMiRo-BLT incompatible or not available.\n";
+    stream ? chprintf(stream, "%s", msg) : aosprintf("%s", msg);
   }
+#endif /* (AMIROOS_CFG_BOOTLOADER == X) */
 
   // print dynamic information about the module
   _printSystemInfoSeparator(stream, '-', SYSTEM_INFO_WIDTH);
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
+#if (AMIROOS_CFG_SSSP_MSI == true)
   if (aos.sssp.moduleId != 0) {
     _printSystemInfoLine(stream, "Module ID", SYSTEM_INFO_NAMEWIDTH, "%u", aos.sssp.moduleId);
   } else {
     _printSystemInfoLine(stream, "Module ID", SYSTEM_INFO_NAMEWIDTH, "not available");
   }
+#else /* (AMIROOS_CFG_SSSP_MSI == true) */
+  _printSystemInfoLine(stream, "Module ID", SYSTEM_INFO_NAMEWIDTH, "not available");
+#endif /* (AMIROOS_CFG_SSSP_MSI == true) */
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 #if (HAL_USE_RTC == TRUE)
   _printSystemInfoLine(stream, "Date", SYSTEM_INFO_NAMEWIDTH, "%04u-%02u-%02u (%s)",
@@ -317,13 +327,6 @@ static void _printSystemInfo(BaseSequentialStream* stream)
                        dt.tm_mday,
                        (dt.tm_wday == 0) ? "Sunday" : (dt.tm_wday == 1) ? "Monday" : (dt.tm_wday == 2) ? "Tuesday" : (dt.tm_wday == 3) ? "Wednesday" : (dt.tm_wday == 4) ? "Thursday" : (dt.tm_wday == 5) ? "Friday" : "Saturday");
   _printSystemInfoLine(stream, "Time", SYSTEM_INFO_NAMEWIDTH, "%02u:%02u:%02u", dt.tm_hour, dt.tm_min, dt.tm_sec);
-#if (AMIROOS_CFG_SSSP_ENABLE == true) && (HAL_USE_CAN != TRUE)
-#if (AMIROOS_CFG_SSSP_MASTER == true)
-  _printSystemInfoLine(stream, "", SYSTEM_INFO_NAMEWIDTH, "Date & Time were not synchronized to slave modules.");
-#else /* (AMIROOS_CFG_SSSP_MASTER == true) */
-  _printSystemInfoLine(stream, "", SYSTEM_INFO_NAMEWIDTH, "Date & Time were not synchronized from master module.");
-#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (HAL_USE_CAN != TRUE) */
 #endif /* (HAL_USE_RTC == TRUE) */
 
   _printSystemInfoSeparator(stream, '=', SYSTEM_INFO_WIDTH);
@@ -331,7 +334,7 @@ static void _printSystemInfo(BaseSequentialStream* stream)
   return;
 }
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Callback function for the system:config shell command.
  *
@@ -456,7 +459,7 @@ static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv
         chprintf(stream, "unknown option '%s' or invalid value '%s'\n", argv[2], argv[3]);
         return AOS_INVALIDARGUMENTS;
       }
-      dt.tm_wday = aosTimeDayOfWeekFromDate(dt.tm_mday, dt.tm_mon+1, dt.tm_year+1900) % 7;
+      dt.tm_wday = aosTimeDayOfWeekFromDate((uint16_t)dt.tm_mday, (uint8_t)dt.tm_mon+1, (uint16_t)dt.tm_year+1900) % DAYS_PER_WEEK;
       aosSysSetDateTime(&dt);
 
       // read and print new date and time
@@ -554,7 +557,7 @@ static int _shellcmd_infocb(BaseSequentialStream* stream, int argc, char* argv[]
 }
 
 /**
- * @brief   Callback function for the sytem:shutdown shell command.
+ * @brief   Callback function for the sytem:shutdown or module:shutdown shell command.
  *
  * @param[in] stream    The I/O stream to use.
  * @param[in] argc      Number of arguments.
@@ -568,7 +571,20 @@ static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* ar
 {
   aosDbgCheck(stream != NULL);
 
-#if (AMIROOS_CFG_SSSP_ENABLE == true)
+#if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE)
+
+  (void)argv;
+  (void)argc;
+
+  // broadcast shutdown event
+  chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_MASK);
+  // set terminate flag so no further prompt will be printed
+  chThdTerminate(chThdGetSelfX());
+
+  return AOS_OK;
+
+#elif (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)
+
   // print help text
   if (argc != 2 || strcmp(argv[1], "--help") == 0) {
     chprintf(stream, "Usage: %s OPTION\n", argv[0]);
@@ -592,22 +608,30 @@ static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* ar
   // handle argument
   else {
     if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--hibernate") == 0) {
-      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_HIBERNATE);
+      // broadcast shutdown event
+      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_HIBERNATE);
+      // set terminate flag so no further prompt will be printed
       chThdTerminate(chThdGetSelfX());
       return AOS_OK;
     }
     else if (strcmp(argv[1], "-d") == 0 || strcmp(argv[1], "--deepsleep") == 0) {
-      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_DEEPSLEEP);
+      // broadcast shutdown event
+      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_DEEPSLEEP);
+      // set terminate flag so no further prompt will be printed
       chThdTerminate(chThdGetSelfX());
       return AOS_OK;
     }
     else if (strcmp(argv[1], "-t") == 0 || strcmp(argv[1], "--transportation") == 0) {
-      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_TRANSPORTATION);
+      // broadcast shutdown event
+      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_TRANSPORTATION);
+      // set terminate flag so no further prompt will be printed
       chThdTerminate(chThdGetSelfX());
       return AOS_OK;
     }
     else if (strcmp(argv[1], "-r") == 0 || strcmp(argv[1], "--restart") == 0) {
-      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_RESTART);
+      // broadcast shutdown event
+      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_RESTART);
+      // set terminate flag so no further prompt will be printed
       chThdTerminate(chThdGetSelfX());
       return AOS_OK;
     }
@@ -616,17 +640,12 @@ static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* ar
       return AOS_INVALIDARGUMENTS;
     }
   }
-#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
-  (void)argv;
-  (void)argc;
 
-  chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN);
-  chThdTerminate(chThdGetSelfX());
-  return AOS_OK;
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+#endif /* (AMIROOS_CFG_BOOTLOADER == X) */
 }
 
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   Callback function for the kernel:test shell command.
  *
@@ -647,8 +666,9 @@ static int _shellcmd_kerneltestcb(BaseSequentialStream* stream, int argc, char*
 
   return retval;
 }
+
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 // suppress warning in case no interrupt GPIOs are defined
 #pragma GCC diagnostic push
@@ -658,12 +678,12 @@ static int _shellcmd_kerneltestcb(BaseSequentialStream* stream, int argc, char*
  *
  * @param[in] args   Pointer to the GPIO line identifier.
  */
-static void _extiCallback(void* args)
+static void _gpioCallback(void* args)
 {
   aosDbgCheck((args != NULL) && (*((ioline_t*)args) != PAL_NOLINE) && (PAL_PAD(*((ioline_t*)args)) < sizeof(eventflags_t) * 8));
 
   chSysLockFromISR();
-  chEvtBroadcastFlagsI(&aos.events.io, AOS_IOEVENT_FLAG(PAL_PAD(*((ioline_t*)args))));
+  chEvtBroadcastFlagsI(&aos.events.gpio, AOS_GPIOEVENT_FLAG(PAL_PAD(*((ioline_t*)args))));
   chSysUnlockFromISR();
 
   return;
@@ -671,6 +691,7 @@ static void _extiCallback(void* args)
 #pragma GCC diagnostic pop
 
 #if ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true)) || defined(__DOXYGEN__)
+
 /**
  * @brief   Callback function for the Sync signal interrupt.
  *
@@ -680,16 +701,17 @@ static void _signalSyncCallback(void *args)
 {
   aosDbgCheck((args != NULL) && (*((ioline_t*)args) != PAL_NOLINE) && (PAL_PAD(*((ioline_t*)args)) < sizeof(eventflags_t) * 8));
 
-  apalControlGpioState_t s_state;
+  apalControlGpioState_t state;
   aos_timestamp_t uptime;
 
   chSysLockFromISR();
+
   // if the system is in operation phase
-  if (aos.sssp.stage == AOS_SSSP_OPERATION) {
+  if (aos.sssp.stage == AOS_SSSP_STAGE_OPERATION) {
     // read signal S
-    apalControlGpioGet(&moduleSsspGpioSync, &s_state);
+    apalControlGpioGet(&moduleSsspGpioS, &state);
     // if S was toggled from on to off
-    if (s_state == APAL_GPIO_OFF) {
+    if (state == APAL_GPIO_OFF) {
       // get current uptime
       aosSysGetUptimeX(&uptime);
       // align the uptime with the synchronization period
@@ -706,12 +728,14 @@ static void _signalSyncCallback(void *args)
       }
     }
   }
+
   // broadcast event
-  chEvtBroadcastFlagsI(&aos.events.io, AOS_IOEVENT_FLAG(PAL_PAD(*((ioline_t*)args))));
+  chEvtBroadcastFlagsI(&aos.events.gpio, AOS_GPIOEVENT_FLAG(PAL_PAD(*((ioline_t*)args))));
   chSysUnlockFromISR();
 
   return;
 }
+
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER != true) */
 
 /**
@@ -737,32 +761,33 @@ static void _uptimeCallback(void* par)
 }
 
 #if ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER == true)) || defined (__DOXYGEN__)
+
 /**
  * @brief   Periodic system synchronization callback function.
  * @details Toggles the SYS_SYNC signal and reconfigures the system synchronization timer.
  *
- * @param[in] par   Unuesed parameters.
+ * @param[in] par   Unused parameters.
  */
 static void _sysSyncTimerCallback(void* par)
 {
   (void)par;
 
-  apalControlGpioState_t s_state;
+  apalControlGpioState_t state;
   aos_timestamp_t uptime;
 
   chSysLockFromISR();
   // toggle and read signal S
-  apalGpioToggle(moduleSsspGpioSync.gpio);
-  apalControlGpioGet(&moduleSsspGpioSync, &s_state);
+  apalGpioToggle(moduleSsspGpioS.gpio);
+  apalControlGpioGet(&moduleSsspGpioS, &state);
   // if S was toggled from off to on
-  if (s_state == APAL_GPIO_ON) {
+  if (state == APAL_GPIO_ON) {
     // reconfigure the timer precisely, because the logically falling edge (next interrupt) snychronizes the system time
     _syssynctime += AMIROOS_CFG_SSSP_SYSSYNCPERIOD;
     aosSysGetUptimeX(&uptime);
     chVTSetI(&_syssynctimer, chTimeUS2I(_syssynctime - uptime), _sysSyncTimerCallback, NULL);
   }
   // if S was toggled from on to off
-  else /* if (s_state == APAL_GPIO_OFF) */ {
+  else /* if (state == APAL_GPIO_OFF) */ {
     // reconfigure the timer (lazy)
     chVTSetI(&_syssynctimer, chTimeUS2I(AMIROOS_CFG_SSSP_SYSSYNCPERIOD / 2), _sysSyncTimerCallback, NULL);
   }
@@ -770,8 +795,26 @@ static void _sysSyncTimerCallback(void* par)
 
   return;
 }
+
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER == true) */
 
+/**
+ * @brief   Retreive the number of active threads.
+ *
+ * @return  Number of active threads.
+ */
+size_t _numActiveThreads(void)
+{
+  size_t threads = 0;
+  thread_t* tp = chRegFirstThread();
+  while (tp) {
+    threads += (tp->state == CH_STATE_FINAL) ? 1 : 0;
+    tp = chRegNextThread(tp);
+  }
+
+  return threads;
+}
+
 /******************************************************************************/
 /* EXPORTED FUNCTIONS                                                         */
 /******************************************************************************/
@@ -782,15 +825,19 @@ static void _sysSyncTimerCallback(void* par)
  *
  * @param[in] shellPrompt   String to be printed as prompt of the system shell.
  */
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 void aosSysInit(const char* shellPrompt)
-#else /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#else /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 void aosSysInit(void)
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 {
   /* set control thread to maximum priority */
   chThdSetPriority(AOS_THD_CTRLPRIO);
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
+  aosSsspInit();
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
   /* set local variables */
   chVTObjectInit(&_systimer);
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
@@ -813,39 +860,38 @@ void aosSysInit(void)
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   /* initialize aos configuration */
-#if (AMIROOS_CFG_SSSP_ENABLE == true)
-  aos.sssp.stage = AOS_SSSP_STARTUP_2_1;
-  aos.sssp.moduleId = 0;
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
   aosIOStreamInit(&aos.iostream);
-  chEvtObjectInit(&aos.events.io);
+  chEvtObjectInit(&aos.events.gpio);
   chEvtObjectInit(&aos.events.os);
 
-  /* interrupt setup */
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
+
+  /* SSSP signal interrupt setup */
   // PD signal
-  palSetLineCallback(moduleSsspGpioPd.gpio->line, _extiCallback, &moduleSsspGpioPd.gpio->line);
-  palEnableLineEvent(moduleSsspGpioPd.gpio->line, APAL2CH_EDGE(moduleSsspGpioPd.meta.edge));
-  // SYNC signal
+  palSetLineCallback(moduleSsspGpioPD.gpio->line, _gpioCallback, &moduleSsspGpioPD.gpio->line);
+  palEnableLineEvent(moduleSsspGpioPD.gpio->line, APAL2CH_EDGE(moduleSsspGpioPD.meta.edge));
+  // S signal
 #if (AMIROOS_CFG_SSSP_MASTER == true)
-  palSetLineCallback(moduleSsspGpioSync.gpio->line, _extiCallback, &moduleSsspGpioSync.gpio->line);
+  palSetLineCallback(moduleSsspGpioS.gpio->line, _gpioCallback, &moduleSsspGpioS.gpio->line);
 #else /* (AMIROOS_CFG_SSSP_MASTER == true) */
-  palSetLineCallback(moduleSsspGpioSync.gpio->line, _signalSyncCallback, &moduleSsspGpioSync.gpio->line);
+  palSetLineCallback(moduleSsspGpioS.gpio->line, _signalSyncCallback, &moduleSsspGpioS.gpio->line);
 #endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
-  palEnableLineEvent(moduleSsspGpioSync.gpio->line, APAL2CH_EDGE(moduleSsspGpioSync.meta.edge));
+  palEnableLineEvent(moduleSsspGpioS.gpio->line, APAL2CH_EDGE(moduleSsspGpioS.meta.edge));
 #if (AMIROOS_CFG_SSSP_STACK_START != true)
   // DN signal
-  palSetLineCallback(moduleSsspGpioDn.gpio->line, _extiCallback, &moduleSsspGpioDn.gpio->line);
-  palEnableLineEvent(moduleSsspGpioDn.gpio->line, APAL2CH_EDGE(moduleSsspGpioDn.meta.edge));
+  palSetLineCallback(moduleSsspGpioDN.gpio->line, _gpioCallback, &moduleSsspGpioDN.gpio->line);
+  palEnableLineEvent(moduleSsspGpioDN.gpio->line, APAL2CH_EDGE(moduleSsspGpioDN.meta.edge));
 #endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */
 #if (AMIROOS_CFG_SSSP_STACK_END != true)
   // UP signal
-  palSetLineCallback(moduleSsspGpioUp.gpio->line, _extiCallback, &moduleSsspGpioUp.gpio->line);
-  palEnableLineEvent(moduleSsspGpioUp.gpio->line, APAL2CH_EDGE(moduleSsspGpioUp.meta.edge));
+  palSetLineCallback(moduleSsspGpioUP.gpio->line, _gpioCallback, &moduleSsspGpioUP.gpio->line);
+  palEnableLineEvent(moduleSsspGpioUP.gpio->line, APAL2CH_EDGE(moduleSsspGpioUP.meta.edge));
 #endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */
+
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
+#if (AMIROOS_CFG_SHELL_ENABLE == true)
+
   /* init shell */
   aosShellInit(&aos.shell,
                &aos.events.os,
@@ -861,7 +907,8 @@ void aosSysInit(void)
 #if (AMIROOS_CFG_TESTS_ENABLE == true)
   aosShellAddCommand(&aos.shell, &_shellcmd_kerneltest);
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
   return;
 }
@@ -869,13 +916,9 @@ void aosSysInit(void)
 /**
  * @brief   Starts the system and all system threads.
  */
-inline void aosSysStart(void)
+void aosSysStart(void)
 {
-#if (AMIROOS_CFG_SSSP_ENABLE == true)
-  // update the system SSSP stage
-  aos.sssp.stage = AOS_SSSP_OPERATION;
-
-#if (AMIROOS_CFG_SSSP_MASTER == true)
+#if (AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_MASTER == true)
   {
     chSysLock();
     // start the system synchronization counter
@@ -886,76 +929,43 @@ inline void aosSysStart(void)
     chVTSetI(&_syssynctimer, chTimeUS2I((t > (AMIROOS_CFG_SSSP_SYSSYNCPERIOD / 2)) ? (t - (AMIROOS_CFG_SSSP_SYSSYNCPERIOD / 2)) : (t + (AMIROOS_CFG_SSSP_SYSSYNCPERIOD / 2))), _sysSyncTimerCallback, NULL);
     chSysUnlock();
   }
-#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SSSP_MASTER == true) && (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   // print system information;
   _printSystemInfo((BaseSequentialStream*)&aos.iostream);
   aosprintf("\n");
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
+#if (AMIROOS_CFG_SHELL_ENABLE == true)
   // start system shell thread
 #if (CH_CFG_USE_THREADHIERARCHY == TRUE)
   aos.shell.thread = chThdCreateStatic(_shell_wa, sizeof(_shell_wa), AMIROOS_CFG_SHELL_THREADPRIO, aosShellThread, &aos.shell, &ch.mainthread);
 #else /* (CH_CFG_USE_THREADHIERARCHY == TRUE) */
   aos.shell.thread = chThdCreateStatic(_shell_wa, sizeof(_shell_wa), AMIROOS_CFG_SHELL_THREADPRIO, aosShellThread, &aos.shell);
 #endif /* (CH_CFG_USE_THREADHIERARCHY == TRUE) */
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
   return;
 }
 
 #if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
- * @brief   Implements the SSSP startup synchronization step.
- *
- * @param[in] syncEvtListener   Event listener that receives the Sync event.
- *
- * @return    If another event that the listener is interested in was received, its mask is returned.
- *            Otherwise an empty mask (0) is returned.
+ * @brief   Start the system uptime measurement.
  */
-eventmask_t aosSysSsspStartupOsInitSyncCheck(event_listener_t* syncEvtListener)
+void aosSysStartUptime(void)
 {
-  aosDbgCheck(syncEvtListener != NULL);
+  chSysLock();
 
-  // local variables
-  eventmask_t m;
-  eventflags_t f;
-  apalControlGpioState_t s;
-
-  // update the system SSSP stage
-  aos.sssp.stage = AOS_SSSP_STARTUP_2_2;
-
-  // deactivate the sync signal to indicate that the module is ready (SSSPv1 stage 2.1 of startup phase)
-  apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_OFF);
-
-  // wait for any event to occur (do not apply any filter in order not to miss any event)
-  m = chEvtWaitOne(ALL_EVENTS);
-  f = chEvtGetAndClearFlags(syncEvtListener);
-  apalControlGpioGet(&moduleSsspGpioSync, &s);
-
-  // if the event was a system event,
-  //   and it was fired because of the SysSync control signal,
-  //   and the SysSync control signal has been deactivated
-  if (m & syncEvtListener->events &&
-      f == MODULE_SSSP_EVENTFLAGS_SYNC &&
-      s == APAL_GPIO_OFF) {
-    chSysLock();
-    // start the uptime counter
-    _synctime = chVTGetSystemTimeX();
-    _uptime = 0;
-    chVTSetI(&_systimer, SYSTIMER_PERIOD, &_uptimeCallback, NULL);
-    chSysUnlock();
+  // start the uptime counter
+  _synctime = chVTGetSystemTimeX();
+  _uptime = 0;
+  chVTSetI(&_systimer, SYSTIMER_PERIOD, &_uptimeCallback, NULL);
 
-    return 0;
-  }
-  // an unexpected event occurred
-  else {
-    // reassign the flags to the event and return the event mask
-    syncEvtListener->flags |= f;
-    return m;
-  }
+  chSysUnlock();
+
+  return;
 }
+
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /**
@@ -963,7 +973,7 @@ eventmask_t aosSysSsspStartupOsInitSyncCheck(event_listener_t* syncEvtListener)
  *
  * @param[out] ut   The system uptime.
  */
-inline void aosSysGetUptimeX(aos_timestamp_t* ut)
+void aosSysGetUptimeX(aos_timestamp_t* ut)
 {
   aosDbgCheck(ut != NULL);
 
@@ -1020,54 +1030,53 @@ void aosSysShutdownInit(aos_shutdown_t shutdown)
   aosDbgCheck(shutdown != AOS_SHUTDOWN_NONE);
 
 #if (AMIROOS_CFG_SSSP_ENABLE == true)
+
 #if (AMIROOS_CFG_SSSP_MASTER == true)
   // deactivate the system synchronization timer
   chVTReset(&_syssynctimer);
+  // activate SSSP S signal in case the synchronization timer had it deactivated.
+  apalControlGpioSet(&moduleSsspGpioS, APAL_GPIO_ON);
 #endif /* (AMIROOS_CFG_SSSP_MASTER == true) */
 
-  // update the system SSSP stage
-  aos.sssp.stage = AOS_SSSP_SHUTDOWN_1_1;
-
-  chSysLock();
-  // activate the SYS_PD control signal only, if this module initiated the shutdown
+  // activate the PD signal only if this module initiated the shutdown
   if (shutdown != AOS_SHUTDOWN_PASSIVE) {
-    apalControlGpioSet(&moduleSsspGpioPd, APAL_GPIO_ON);
+    apalControlGpioSet(&moduleSsspGpioPD, APAL_GPIO_ON);
+    aosSsspShutdownInit();
   }
-  // activate the SYS_SYNC signal
-  apalControlGpioSet(&moduleSsspGpioSync, APAL_GPIO_ON);
-  chSysUnlock();
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   switch (shutdown) {
     case AOS_SHUTDOWN_PASSIVE:
-      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN);
+      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_SHUTDOWN_PASSIVE);
       aosprintf("shutdown request received...\n");
       break;
+#if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_NONE)
+    case AOS_SHUTDOWN_ACTIVE:
+      aosprintf("shutdown initiated...\n");
+      break;
+#elif (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)
     case AOS_SHUTDOWN_HIBERNATE:
-      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_HIBERNATE);
       aosprintf("shutdown to hibernate mode...\n");
       break;
     case AOS_SHUTDOWN_DEEPSLEEP:
-      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_DEEPSLEEP);
       aosprintf("shutdown to deepsleep mode...\n");
       break;
     case AOS_SHUTDOWN_TRANSPORTATION:
-      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_TRANSPORTATION);
       aosprintf("shutdown to transportation mode...\n");
       break;
     case AOS_SHUTDOWN_RESTART:
-      chEvtBroadcastFlags(&aos.events.os, AOS_SYSTEM_EVENTFLAGS_RESTART);
       aosprintf("restarting system...\n");
       break;
-    // must never occur
+#endif /* (AMIROOS_CFG_BOOTLOADER == X) */
     case AOS_SHUTDOWN_NONE:
-    default:
+      // must never occur
+      aosDbgAssert(false);
       break;
   }
 
-#if (AMIROOS_CFG_SSSP_ENABLE == true)
-  // update the system SSSP stage
-  aos.sssp.stage = AOS_SSSP_SHUTDOWN_1_2;
+#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
+  aosprintf("shutdown initiated...\n");
+
 #endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
   return;
@@ -1078,9 +1087,15 @@ void aosSysShutdownInit(aos_shutdown_t shutdown)
  */
 void aosSysStop(void)
 {
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true)
-  chThdWait(aos.shell.thread);
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+  // wait until the calling thread is the only remaining active thread
+#if (CH_CFG_NO_IDLE_THREAD == TRUE)
+  while (_numActiveThreads() > 1) {
+#else /* (CH_CFG_NO_IDLE_THREAD == TRUE) */
+  while (_numActiveThreads() > 2) {
+#endif /* (CH_CFG_NO_IDLE_THREAD == TRUE) */
+    aosDbgPrintf("waiting for all threads to terminate...\n");
+    chThdYield();
+  }
 
   return;
 }
@@ -1093,13 +1108,17 @@ void aosSysDeinit(void)
   return;
 }
 
+#if ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_SHUTDOWN != true)) ||                 \
+    ((AMIROOS_CFG_SSSP_ENABLE != true) && (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)) || \
+    defined(__DOXYGEN__)
+
 /**
  * @brief   Finally shuts down the system and calls the bootloader callback function.
  * @note    This function should be called from the thtead with highest priority.
  *
  * @param[in] shutdown    Type of shutdown.
  */
-void aosSysShutdownFinal(aos_shutdown_t shutdown)
+void aosSysShutdownToBootloader(aos_shutdown_t shutdown)
 {
   // check arguments
   aosDbgCheck(shutdown != AOS_SHUTDOWN_NONE);
@@ -1107,20 +1126,18 @@ void aosSysShutdownFinal(aos_shutdown_t shutdown)
   // disable all interrupts
   irqDeinit();
 
-#if (AMIROOS_CFG_SSSP_ENABLE == true)
-  // update the system SSSP stage
-  aos.sssp.stage = AOS_SSSP_SHUTDOWN_1_3;
-#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
-
-  // validate bootloader
+#if (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)
+  // validate AMiRo-BLT
   if ((BL_CALLBACK_TABLE_ADDRESS->magicNumber == BL_MAGIC_NUMBER) &&
       (BL_CALLBACK_TABLE_ADDRESS->vBootloader.major == BL_VERSION_MAJOR) &&
       (BL_CALLBACK_TABLE_ADDRESS->vBootloader.minor >= BL_VERSION_MINOR)) {
     // call bootloader callback depending on arguments
     switch (shutdown) {
+#if (AMIROOS_CFG_SSSP_ENABLE == true)
       case AOS_SHUTDOWN_PASSIVE:
         BL_CALLBACK_TABLE_ADDRESS->cbHandleShutdownRequest();
         break;
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
       case AOS_SHUTDOWN_HIBERNATE:
         BL_CALLBACK_TABLE_ADDRESS->cbShutdownHibernate();
         break;
@@ -1139,23 +1156,26 @@ void aosSysShutdownFinal(aos_shutdown_t shutdown)
         break;
     }
   } else {
-    // fallback if bootloader was found to be invalid
-    aosprintf("Bootloader incompatible or not available!\n");
+    // fallback if AMiRo-BLT was found to be invalid
+    aosprintf("ERROR: AMiRo-BLT incompatible or not available!\n");
     aosThdMSleep(10);
     chSysDisable();
   }
+#endif /* (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT) */
 
   return;
 }
 
+#endif /* ((AMIROOS_CFG_SSSP_ENABLE == true) && (AMIROOS_CFG_SSSP_SHUTDOWN != true)) || ((AMIROOS_CFG_SSSP_ENABLE != true) && (AMIROOS_CFG_BOOTLOADER == AOS_BOOTLOADER_AMiRoBLT)) */
+
 /**
  * @brief   Generic callback function for GPIO interrupts.
  *
  * @return  Pointer to the callback function.
  */
-palcallback_t aosSysGetStdExtiCallback(void)
+palcallback_t aosSysGetStdGpioCallback(void)
 {
-  return _extiCallback;
+  return _gpioCallback;
 }
 
 /** @} */
diff --git a/kernel/ChibiOS b/kernel/ChibiOS
index 065a318..a9ba0b8 160000
--- a/kernel/ChibiOS
+++ b/kernel/ChibiOS
@@ -1 +1 @@
-Subproject commit 065a3182147545188d83a71c0881e2d7bac58de2
+Subproject commit a9ba0b88416cff96c60c59f1d8bf8469fd328ef2
diff --git a/modules/DiWheelDrive_1-1/aosconf.h b/modules/DiWheelDrive_1-1/aosconf.h
index e45bcbd..0f93be9 100644
--- a/modules/DiWheelDrive_1-1/aosconf.h
+++ b/modules/DiWheelDrive_1-1/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,14 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK 0
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -103,6 +103,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_AMiRoBLT
+
+/** @} */
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -118,6 +133,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/DiWheelDrive_1-1/board.c b/modules/DiWheelDrive_1-1/board.c
index 0ef0984..059caec 100644
--- a/modules/DiWheelDrive_1-1/board.c
+++ b/modules/DiWheelDrive_1-1/board.c
@@ -26,6 +26,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <hal.h>
 
+/*===========================================================================*/
+/* Driver local definitions.                                                 */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported variables.                                                */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables and types.                                         */
+/*===========================================================================*/
+
 #if HAL_USE_PAL || defined(__DOXYGEN__)
 /**
  * @brief   PAL setup.
@@ -57,6 +69,18 @@ const PALConfig pal_default_config = {
 };
 #endif
 
+/*===========================================================================*/
+/* Driver local functions.                                                   */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver interrupt handlers.                                                */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions.                                                */
+/*===========================================================================*/
+
 /**
  * @brief   Early initialization code.
  * @details This initialization must be performed just after stack setup
diff --git a/modules/DiWheelDrive_1-1/board.h b/modules/DiWheelDrive_1-1/board.h
index 0403412..1832e08 100644
--- a/modules/DiWheelDrive_1-1/board.h
+++ b/modules/DiWheelDrive_1-1/board.h
@@ -27,6 +27,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef BOARD_H
 #define BOARD_H
 
+/*===========================================================================*/
+/* Driver constants.                                                         */
+/*===========================================================================*/
+
 /*
  * Setup for AMiRo DiWheelDrive v1.1 board.
  */
@@ -232,6 +236,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LINE_OSC_OUT                PAL_LINE(GPIOD, GPIOD_OSC_OUT)
 #define LINE_SYS_WARMRST_N          PAL_LINE(GPIOD, GPIOD_SYS_WARMRST_N)
 
+/*===========================================================================*/
+/* Driver pre-compile time settings.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks.                                       */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver macros.                                                            */
+/*===========================================================================*/
+
 /*
  * I/O ports initial setup, this configuration is established soon after reset
  * in the initialization code.
@@ -632,6 +652,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                                      PIN_ODR_LOW(GPIOG_PIN14) |                                                    \
                                      PIN_ODR_LOW(GPIOG_PIN15))
 
+/*===========================================================================*/
+/* External declarations.                                                    */
+/*===========================================================================*/
+
 #if !defined(_FROM_ASM_)
 #ifdef __cplusplus
 extern "C" {
diff --git a/modules/DiWheelDrive_1-1/chconf.h b/modules/DiWheelDrive_1-1/chconf.h
index d8de561..e3f5064 100644
--- a/modules/DiWheelDrive_1-1/chconf.h
+++ b/modules/DiWheelDrive_1-1/chconf.h
@@ -136,12 +136,6 @@
 /*===========================================================================*/
 
 /**
- * @brief   NVIC VTOR initialization offset.
- * @details On initialization, the code at this address in the flash memory will be executed.
- */
-#define CORTEX_VTOR_INIT                        0x00006000U
-
-/**
  * @brief   Flag to enable/disable sleep mode when the system is idle.
  */
 #define CORTEX_ENABLE_WFI_IDLE                  TRUE
diff --git a/modules/DiWheelDrive_1-1/module.c b/modules/DiWheelDrive_1-1/module.c
index 0cf6a90..b401687 100644
--- a/modules/DiWheelDrive_1-1/module.c
+++ b/modules/DiWheelDrive_1-1/module.c
@@ -339,9 +339,9 @@ ROMCONST apalControlGpio_t moduleGpioSysWarmrst = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "DiWheelDrive";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/DiWheelDrive_1-1/module.h b/modules/DiWheelDrive_1-1/module.h
index fb91d71..b56b32b 100644
--- a/modules/DiWheelDrive_1-1/module.h
+++ b/modules/DiWheelDrive_1-1/module.h
@@ -242,85 +242,84 @@ extern ROMCONST apalControlGpio_t moduleGpioSysWarmrst;
 /**
  * @brief   Event flag to be set on a SYS_SYNC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSSYNC         AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
 
 /**
  * @brief   Event flag to be set on a SYS_WARMRST interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST       AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSWARMRST      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
 
 /**
  * @brief   Event flag to be set on a PATH_DCSTAT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT       AOS_IOEVENT_FLAG(PAL_PAD(LINE_PATH_DCEN))
+#define MODULE_OS_GPIOEVENTFLAG_PATHDCSTAT      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_PATH_DCEN))
 
 /**
  * @brief   Event flag to be set on a COMPASS_DRDY interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_COMPASSDRDY      AOS_IOEVENT_FLAG(PAL_PAD(LINE_COMPASS_DRDY))
+#define MODULE_OS_GPIOEVENTFLAG_COMPASSDRDY     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_COMPASS_DRDY))
 
 /**
  * @brief   Event flag to be set on a SYS_PD interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSPD           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
 
 /**
  * @brief   Event flag to be set on a SYS_REG_EN interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSREGEN         AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_REG_EN))
+#define MODULE_OS_GPIOEVENTFLAG_SYSREGEN        AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_REG_EN))
 
 /**
  * @brief   Event flag to be set on a IR_INT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_IRINT            AOS_IOEVENT_FLAG(PAL_PAD(LINE_IR_INT))
+#define MODULE_OS_GPIOEVENTFLAG_IRINT           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IR_INT))
 
 /**
  * @brief   Event flag to be set on a GYRO_DRDY interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_GYRODRDY         AOS_IOEVENT_FLAG(PAL_PAD(LINE_GYRO_DRDY))
+#define MODULE_OS_GPIOEVENTFLAG_GYRODRDY        AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_GYRO_DRDY))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_UP interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTUP       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
 
 /**
  * @brief   Event flag to be set on a ACCEL_INT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_ACCELINT         AOS_IOEVENT_FLAG(PAL_PAD(LINE_ACCEL_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_ACCELINT        AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_ACCEL_INT_N))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* COMPASS_DRDY */                                                          \
-  palSetLineCallback(moduleGpioCompassDrdy.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioCompassDrdy.gpio->line);  \
+  palSetLineCallback(moduleGpioCompassDrdy.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioCompassDrdy.gpio->line);  \
   palEnableLineEvent(moduleGpioCompassDrdy.gpio->line, APAL2CH_EDGE(moduleGpioCompassDrdy.meta.edge));                  \
   /* IR_INT */                                                                \
-  palSetLineCallback(moduleGpioIrInt.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioIrInt.gpio->line);  \
+  palSetLineCallback(moduleGpioIrInt.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioIrInt.gpio->line);  \
   palEnableLineEvent(moduleGpioIrInt.gpio->line, APAL2CH_EDGE(moduleGpioIrInt.meta.edge));                  \
   /* GYRO_DRDY */                                                             \
-  palSetLineCallback(moduleGpioGyroDrdy.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioGyroDrdy.gpio->line);  \
+  palSetLineCallback(moduleGpioGyroDrdy.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioGyroDrdy.gpio->line);  \
   palEnableLineEvent(moduleGpioGyroDrdy.gpio->line, APAL2CH_EDGE(moduleGpioGyroDrdy.meta.edge));                  \
   /* ACCEL_INT */                                                             \
-  palSetLineCallback(moduleGpioAccelInt.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioAccelInt.gpio->line);  \
+  palSetLineCallback(moduleGpioAccelInt.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioAccelInt.gpio->line);  \
   palEnableLineEvent(moduleGpioAccelInt.gpio->line, APAL2CH_EDGE(moduleGpioAccelInt.meta.edge));                  \
   /* PATH_DCSTAT */                                                           \
-  palSetLineCallback(moduleGpioPathDcStat.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioPathDcStat.gpio->line);  \
+  palSetLineCallback(moduleGpioPathDcStat.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioPathDcStat.gpio->line);  \
   palEnableLineEvent(moduleGpioPathDcStat.gpio->line, APAL2CH_EDGE(moduleGpioPathDcStat.meta.edge));                  \
   /* SYS_REG_EN */                                                            \
-  palSetLineCallback(moduleGpioSysRegEn.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysRegEn.gpio->line);  \
+  palSetLineCallback(moduleGpioSysRegEn.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysRegEn.gpio->line);  \
   palEnableLineEvent(moduleGpioSysRegEn.gpio->line, APAL2CH_EDGE(moduleGpioSysRegEn.meta.edge));                  \
   /* SYS_WARMRST */                                                           \
-  palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysWarmrst.gpio->line);  \
+  palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysWarmrst.gpio->line);  \
   palEnableLineEvent(moduleGpioSysWarmrst.gpio->line, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge));                  \
 }
 
@@ -328,7 +327,7 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* initialize tests and add to shell */                                     \
+  /* add test commands to shell */                                            \
   aosShellAddCommand(&aos.shell, &moduleTestA3906ShellCmd);                   \
   aosShellAddCommand(&aos.shell, &moduleTestAt24c01bShellCmd);                \
   aosShellAddCommand(&aos.shell, &moduleTestHmc5883lShellCmd);                \
@@ -367,12 +366,16 @@ extern ROMCONST char* moduleShellPrompt;
   qeiStart(&MODULE_HAL_QEI_RIGHT_WHEEL, &moduleHalQeiConfig);                 \
   qeiEnable(&MODULE_HAL_QEI_LEFT_WHEEL);                                      \
   qeiEnable(&MODULE_HAL_QEI_RIGHT_WHEEL);                                     \
+  /* CAN */                                                                   \
+  canStart(&MODULE_HAL_CAN, &moduleHalCanConfig);                             \
 }
 
 /**
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* CAN */                                                                   \
+  canStop(&MODULE_HAL_CAN);                                                   \
   /* PWM */                                                                   \
   pwmStop(&MODULE_HAL_PWM_DRIVE);                                             \
   /* QEI */                                                                   \
@@ -395,35 +398,39 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   PD signal GPIO.
  */
-#define moduleSsspGpioPd                        moduleGpioSysPd
+#define moduleSsspGpioPD                        moduleGpioSysPd
 
 /**
- * @brief   SYNC signal GPIO.
+ * @brief   S signal GPIO.
  */
-#define moduleSsspGpioSync                      moduleGpioSysSync
+#define moduleSsspGpioS                         moduleGpioSysSync
 
 /**
  * @brief   UP signal GPIO.
  */
-#define moduleSsspGpioUp                        moduleGpioSysUartUp
+#define moduleSsspGpioUP                        moduleGpioSysUartUp
 
 /**
- * @brief   Event flags for PD signal events.
+ * @brief   Event flag for PD signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_PD               MODULE_OS_IOEVENTFLAGS_SYSPD
+#define MODULE_SSSP_EVENTFLAG_PD                MODULE_OS_GPIOEVENTFLAG_SYSPD
 
 /**
- * @brief   Event flags for SYNC signal events.
+ * @brief   Event flag for S signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_SYNC             MODULE_OS_IOEVENTFLAGS_SYSSYNC
+#define MODULE_SSSP_EVENTFLAG_S                 MODULE_OS_GPIOEVENTFLAG_SYSSYNC
 
 /**
- * @brief   Event flags for UP signal events.
+ * @brief   Event flag for UP signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_UP               MODULE_OS_IOEVENTFLAGS_SYSUARTUP
+#define MODULE_SSSP_EVENTFLAG_UP                MODULE_OS_GPIOEVENTFLAG_SYSUARTUP
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/DiWheelDrive_1-1/test/HMC5883L/module_test_HMC5883L.c b/modules/DiWheelDrive_1-1/test/HMC5883L/module_test_HMC5883L.c
index bd6fa19..f546627 100644
--- a/modules/DiWheelDrive_1-1/test/HMC5883L/module_test_HMC5883L.c
+++ b/modules/DiWheelDrive_1-1/test/HMC5883L/module_test_HMC5883L.c
@@ -41,8 +41,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 static aos_test_hmc5883ldata_t _data = {
   /* HMC driver   */ &moduleLldCompass,
-  /* event source */ &aos.events.io,
-  /* event flags  */ MODULE_OS_IOEVENTFLAGS_COMPASSDRDY,
+  /* event source */ &aos.events.gpio,
+  /* event flags  */ MODULE_OS_GPIOEVENTFLAG_COMPASSDRDY,
   /* timeout      */ MICROSECONDS_PER_SECOND,
 };
 
diff --git a/modules/DiWheelDrive_1-1/test/L3G4200D/module_test_L3G4200D.c b/modules/DiWheelDrive_1-1/test/L3G4200D/module_test_L3G4200D.c
index 67f170c..7017044 100644
--- a/modules/DiWheelDrive_1-1/test/L3G4200D/module_test_L3G4200D.c
+++ b/modules/DiWheelDrive_1-1/test/L3G4200D/module_test_L3G4200D.c
@@ -42,8 +42,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 static aos_test_l3g4200ddata_t _data = {
   /* driver            */ &moduleLldGyroscope,
   /* SPI configuration */ &moduleHalSpiGyroscopeConfig,
-  /* event source */ &aos.events.io,
-  /* event flags  */ MODULE_OS_IOEVENTFLAGS_GYRODRDY,
+  /* event source */ &aos.events.gpio,
+  /* event flags  */ MODULE_OS_GPIOEVENTFLAG_GYRODRDY,
 };
 
 static AOS_TEST(_test, "L3G4200D", "Gyroscope", moduleTestL3g4200dShellCb, aosTestL3g4200dFunc, &_data);
diff --git a/modules/DiWheelDrive_1-1/test/LIS331DLH/module_test_LIS331DLH.c b/modules/DiWheelDrive_1-1/test/LIS331DLH/module_test_LIS331DLH.c
index 7ea0cdc..9644b0e 100644
--- a/modules/DiWheelDrive_1-1/test/LIS331DLH/module_test_LIS331DLH.c
+++ b/modules/DiWheelDrive_1-1/test/LIS331DLH/module_test_LIS331DLH.c
@@ -42,8 +42,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 static aos_test_lis331dlhdata_t _data = {
   /* driver            */ &moduleLldAccelerometer,
   /* SPI configuration */ &moduleHalSpiAccelerometerConfig,
-  /* event source */ &aos.events.io,
-  /* event flags  */ MODULE_OS_IOEVENTFLAGS_ACCELINT,
+  /* event source */ &aos.events.gpio,
+  /* event flags  */ MODULE_OS_GPIOEVENTFLAG_ACCELINT,
 };
 
 static AOS_TEST(_test, "LIS331DLH", "Accelerometer", moduleTestLis331dlhShellCb, aosTestLis331dlhFunc, &_data);
diff --git a/modules/DiWheelDrive_1-1/test/VCNL4020/module_test_VCNL4020.c b/modules/DiWheelDrive_1-1/test/VCNL4020/module_test_VCNL4020.c
index 5d1670f..60ec57d 100644
--- a/modules/DiWheelDrive_1-1/test/VCNL4020/module_test_VCNL4020.c
+++ b/modules/DiWheelDrive_1-1/test/VCNL4020/module_test_VCNL4020.c
@@ -43,8 +43,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 static aos_test_vcnl4020data_t _data = {
   /* driver       */ &moduleLldProximity,
   /* timeout      */ MICROSECONDS_PER_SECOND,
-  /* event source */ &aos.events.io,
-  /* event flags  */ MODULE_OS_IOEVENTFLAGS_IRINT,
+  /* event source */ &aos.events.gpio,
+  /* event flags  */ MODULE_OS_GPIOEVENTFLAG_IRINT,
 };
 
 static AOS_TEST(_test, "VCNL4020", "proximity sensor", moduleTestVcnl4020ShellCb, aosTestVcnl4020Func, &_data);
diff --git a/modules/DiWheelDrive_1-2/aosconf.h b/modules/DiWheelDrive_1-2/aosconf.h
index 44f464b..549f682 100644
--- a/modules/DiWheelDrive_1-2/aosconf.h
+++ b/modules/DiWheelDrive_1-2/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,14 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK 0
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -103,6 +103,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_AMiRoBLT
+
+/** @} */
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -118,6 +133,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/DiWheelDrive_1-2/board.c b/modules/DiWheelDrive_1-2/board.c
index f624c7c..3c4c143 100644
--- a/modules/DiWheelDrive_1-2/board.c
+++ b/modules/DiWheelDrive_1-2/board.c
@@ -26,6 +26,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <hal.h>
 
+/*===========================================================================*/
+/* Driver local definitions.                                                 */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported variables.                                                */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables and types.                                         */
+/*===========================================================================*/
+
 #if HAL_USE_PAL || defined(__DOXYGEN__)
 /**
  * @brief   PAL setup.
@@ -57,6 +69,18 @@ const PALConfig pal_default_config = {
 };
 #endif
 
+/*===========================================================================*/
+/* Driver local functions.                                                   */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver interrupt handlers.                                                */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions.                                                */
+/*===========================================================================*/
+
 /**
  * @brief   Early initialization code.
  * @details This initialization must be performed just after stack setup
diff --git a/modules/DiWheelDrive_1-2/board.h b/modules/DiWheelDrive_1-2/board.h
index 8758766..a7abb3f 100644
--- a/modules/DiWheelDrive_1-2/board.h
+++ b/modules/DiWheelDrive_1-2/board.h
@@ -27,6 +27,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef BOARD_H
 #define BOARD_H
 
+/*===========================================================================*/
+/* Driver constants.                                                         */
+/*===========================================================================*/
+
 /*
  * Setup for AMiRo DiWheelDrive v1.2 board.
  */
@@ -228,6 +232,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LINE_OSC_OUT                PAL_LINE(GPIOD, GPIOD_OSC_OUT)
 #define LINE_SYS_WARMRST_N          PAL_LINE(GPIOD, GPIOD_SYS_WARMRST_N)
 
+/*===========================================================================*/
+/* Driver pre-compile time settings.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks.                                       */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver macros.                                                            */
+/*===========================================================================*/
+
 /*
  * I/O ports initial setup, this configuration is established soon after reset
  * in the initialization code.
@@ -628,6 +648,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                                      PIN_ODR_LOW(GPIOG_PIN14) |                                                    \
                                      PIN_ODR_LOW(GPIOG_PIN15))
 
+/*===========================================================================*/
+/* External declarations.                                                    */
+/*===========================================================================*/
+
 #if !defined(_FROM_ASM_)
 #ifdef __cplusplus
 extern "C" {
diff --git a/modules/DiWheelDrive_1-2/chconf.h b/modules/DiWheelDrive_1-2/chconf.h
index 92dc2d1..10eb0a8 100644
--- a/modules/DiWheelDrive_1-2/chconf.h
+++ b/modules/DiWheelDrive_1-2/chconf.h
@@ -136,12 +136,6 @@
 /*===========================================================================*/
 
 /**
- * @brief   NVIC VTOR initialization offset.
- * @details On initialization, the code at this address in the flash memory will be executed.
- */
-#define CORTEX_VTOR_INIT                        0x00006000U
-
-/**
  * @brief   Flag to enable/disable sleep mode when the system is idle.
  */
 #define CORTEX_ENABLE_WFI_IDLE                  TRUE
diff --git a/modules/DiWheelDrive_1-2/module.c b/modules/DiWheelDrive_1-2/module.c
index 70384c5..6cb2f6d 100644
--- a/modules/DiWheelDrive_1-2/module.c
+++ b/modules/DiWheelDrive_1-2/module.c
@@ -336,9 +336,9 @@ ROMCONST apalControlGpio_t moduleGpioSysWarmrst = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "DiWheelDrive";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/DiWheelDrive_1-2/module.h b/modules/DiWheelDrive_1-2/module.h
index 20cac86..27a751f 100644
--- a/modules/DiWheelDrive_1-2/module.h
+++ b/modules/DiWheelDrive_1-2/module.h
@@ -232,69 +232,68 @@ extern ROMCONST apalControlGpio_t moduleGpioSysWarmrst;
 /**
  * @brief   Event flag to be set on a SYS_SYNC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSSYNC         AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
 
 /**
  * @brief   Event flag to be set on a SYS_WARMRST interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST       AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSWARMRST      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
 
 /**
  * @brief   Event flag to be set on a PATH_DCSTAT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT       AOS_IOEVENT_FLAG(PAL_PAD(LINE_PATH_DCEN))
+#define MODULE_OS_GPIOEVENTFLAG_PATHDCSTAT      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_PATH_DCEN))
 
 /**
  * @brief   Event flag to be set on a SYS_PD interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSPD           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
 
 /**
  * @brief   Event flag to be set on a SYS_REG_EN interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSREGEN         AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_REG_EN))
+#define MODULE_OS_GPIOEVENTFLAG_SYSREGEN        AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_REG_EN))
 
 /**
  * @brief   Event flag to be set on a IR_INT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_IRINT            AOS_IOEVENT_FLAG(PAL_PAD(LINE_IR_INT))
+#define MODULE_OS_GPIOEVENTFLAG_IRINT           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IR_INT))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_UP interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTUP       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
 
 /**
  * @brief   Event flag to be set on a IMU_INT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_IMUINT         AOS_IOEVENT_FLAG(PAL_PAD(LINE_IMU_INT))
+#define MODULE_OS_GPIOEVENTFLAG_IMUINT          AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IMU_INT))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* IR_INT */                                                                \
-  palSetLineCallback(moduleGpioIrInt.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioIrInt.gpio->line);  \
+  palSetLineCallback(moduleGpioIrInt.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioIrInt.gpio->line);  \
   palEnableLineEvent(moduleGpioIrInt.gpio->line, APAL2CH_EDGE(moduleGpioIrInt.meta.edge));                  \
   /* IMU_INT */                                                               \
-  palSetLineCallback(moduleGpioImuInt.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioImuInt.gpio->line);  \
+  palSetLineCallback(moduleGpioImuInt.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioImuInt.gpio->line);  \
   palEnableLineEvent(moduleGpioImuInt.gpio->line, APAL2CH_EDGE(moduleGpioImuInt.meta.edge));                  \
   /* PATH_DCSTAT */                                                           \
-  palSetLineCallback(moduleGpioPathDcStat.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioPathDcStat.gpio->line);  \
+  palSetLineCallback(moduleGpioPathDcStat.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioPathDcStat.gpio->line);  \
   palEnableLineEvent(moduleGpioPathDcStat.gpio->line, APAL2CH_EDGE(moduleGpioPathDcStat.meta.edge));                  \
   /* SYS_REG_EN */                                                            \
-  palSetLineCallback(moduleGpioSysRegEn.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysRegEn.gpio->line);  \
+  palSetLineCallback(moduleGpioSysRegEn.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysRegEn.gpio->line);  \
   palEnableLineEvent(moduleGpioSysRegEn.gpio->line, APAL2CH_EDGE(moduleGpioSysRegEn.meta.edge));                  \
   /* SYS_WARMRST */                                                           \
-  palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysWarmrst.gpio->line);  \
+  palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysWarmrst.gpio->line);  \
   palEnableLineEvent(moduleGpioSysWarmrst.gpio->line, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge));                  \
 }
 
@@ -302,7 +301,7 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* initialize tests and add to shell */                                     \
+  /* add test commands to shell */                                            \
   aosShellAddCommand(&aos.shell, &moduleTestA3906ShellCmd);                   \
   aosShellAddCommand(&aos.shell, &moduleTestAt24c01bShellCmd);                \
   /* TODO: add BNO055 test command */                                         \
@@ -337,12 +336,16 @@ extern ROMCONST char* moduleShellPrompt;
   qeiStart(&MODULE_HAL_QEI_RIGHT_WHEEL, &moduleHalQeiConfig);                 \
   qeiEnable(&MODULE_HAL_QEI_LEFT_WHEEL);                                      \
   qeiEnable(&MODULE_HAL_QEI_RIGHT_WHEEL);                                     \
+  /* CAN */                                                                   \
+  canStart(&MODULE_HAL_CAN, &moduleHalCanConfig);                             \
 }
 
 /**
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* CAN */                                                                   \
+  canStop(&MODULE_HAL_CAN);                                                   \
   /* PWM */                                                                   \
   pwmStop(&MODULE_HAL_PWM_DRIVE);                                             \
   /* QEI */                                                                   \
@@ -365,35 +368,39 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   PD signal GPIO.
  */
-#define moduleSsspGpioPd                        moduleGpioSysPd
+#define moduleSsspGpioPD                        moduleGpioSysPd
 
 /**
- * @brief   SYNC signal GPIO.
+ * @brief   S signal GPIO.
  */
-#define moduleSsspGpioSync                      moduleGpioSysSync
+#define moduleSsspGpioS                         moduleGpioSysSync
 
 /**
  * @brief   UP signal GPIO.
  */
-#define moduleSsspGpioUp                        moduleGpioSysUartUp
+#define moduleSsspGpioUP                        moduleGpioSysUartUp
 
 /**
- * @brief   Event flags for PD signal events.
+ * @brief   Event flag for PD signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_PD               MODULE_OS_IOEVENTFLAGS_SYSPD
+#define MODULE_SSSP_EVENTFLAG_PD                MODULE_OS_GPIOEVENTFLAG_SYSPD
 
 /**
- * @brief   Event flags for SYNC signal events.
+ * @brief   Event flag for S signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_SYNC             MODULE_OS_IOEVENTFLAGS_SYSSYNC
+#define MODULE_SSSP_EVENTFLAG_S                 MODULE_OS_GPIOEVENTFLAG_SYSSYNC
 
 /**
- * @brief   Event flags for UP signal events.
+ * @brief   Event flag for UP signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_UP               MODULE_OS_IOEVENTFLAGS_SYSUARTUP
+#define MODULE_SSSP_EVENTFLAG_UP                MODULE_OS_GPIOEVENTFLAG_SYSUARTUP
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/DiWheelDrive_1-2/test/VCNL4020/module_test_VCNL4020.c b/modules/DiWheelDrive_1-2/test/VCNL4020/module_test_VCNL4020.c
index 5d1670f..60ec57d 100644
--- a/modules/DiWheelDrive_1-2/test/VCNL4020/module_test_VCNL4020.c
+++ b/modules/DiWheelDrive_1-2/test/VCNL4020/module_test_VCNL4020.c
@@ -43,8 +43,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 static aos_test_vcnl4020data_t _data = {
   /* driver       */ &moduleLldProximity,
   /* timeout      */ MICROSECONDS_PER_SECOND,
-  /* event source */ &aos.events.io,
-  /* event flags  */ MODULE_OS_IOEVENTFLAGS_IRINT,
+  /* event source */ &aos.events.gpio,
+  /* event flags  */ MODULE_OS_GPIOEVENTFLAG_IRINT,
 };
 
 static AOS_TEST(_test, "VCNL4020", "proximity sensor", moduleTestVcnl4020ShellCb, aosTestVcnl4020Func, &_data);
diff --git a/modules/LightRing_1-0/aosconf.h b/modules/LightRing_1-0/aosconf.h
index 1d42982..16dcc6e 100644
--- a/modules/LightRing_1-0/aosconf.h
+++ b/modules/LightRing_1-0/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,14 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK 0
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -103,6 +103,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_AMiRoBLT
+
+/** @} */
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -118,6 +133,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/LightRing_1-0/board.c b/modules/LightRing_1-0/board.c
index badb34a..b090e4a 100644
--- a/modules/LightRing_1-0/board.c
+++ b/modules/LightRing_1-0/board.c
@@ -26,6 +26,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <hal.h>
 
+/*===========================================================================*/
+/* Driver local definitions.                                                 */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported variables.                                                */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables and types.                                         */
+/*===========================================================================*/
+
 #if HAL_USE_PAL || defined(__DOXYGEN__)
 /**
  * @brief   PAL setup.
@@ -57,6 +69,18 @@ const PALConfig pal_default_config = {
 };
 #endif
 
+/*===========================================================================*/
+/* Driver local functions.                                                   */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver interrupt handlers.                                                */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions.                                                */
+/*===========================================================================*/
+
 /**
  * @brief   Early initialization code.
  * @details This initialization must be performed just after stack setup
diff --git a/modules/LightRing_1-0/board.h b/modules/LightRing_1-0/board.h
index 07ee007..7f0d7ab 100644
--- a/modules/LightRing_1-0/board.h
+++ b/modules/LightRing_1-0/board.h
@@ -27,6 +27,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef BOARD_H
 #define BOARD_H
 
+/*===========================================================================*/
+/* Driver constants.                                                         */
+/*===========================================================================*/
+
 /*
  * Setup for AMiRo LightRing v1.0 board.
  */
@@ -216,6 +220,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #define LINE_SYS_INT_N              PAL_LINE(GPIOD, GPIOD_SYS_INT_N)
 
+/*===========================================================================*/
+/* Driver pre-compile time settings.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks.                                       */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver macros.                                                            */
+/*===========================================================================*/
+
 /*
  * I/O ports initial setup, this configuration is established soon after reset
  * in the initialization code.
@@ -615,6 +635,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                                      PIN_ODR_LOW(GPIOG_PIN14) |                                                    \
                                      PIN_ODR_LOW(GPIOG_PIN15))
 
+/*===========================================================================*/
+/* External declarations.                                                    */
+/*===========================================================================*/
+
 #if !defined(_FROM_ASM_)
 #ifdef __cplusplus
 extern "C" {
diff --git a/modules/LightRing_1-0/chconf.h b/modules/LightRing_1-0/chconf.h
index 973844c..bf18599 100644
--- a/modules/LightRing_1-0/chconf.h
+++ b/modules/LightRing_1-0/chconf.h
@@ -136,12 +136,6 @@
 /*===========================================================================*/
 
 /**
- * @brief   NVIC VTOR initialization offset.
- * @details On initialization, the code at this address in the flash memory will be executed.
- */
-#define CORTEX_VTOR_INIT                        0x00006000U
-
-/**
  * @brief   Flag to enable/disable sleep mode when the system is idle.
  */
 #define CORTEX_ENABLE_WFI_IDLE                  TRUE
diff --git a/modules/LightRing_1-0/module.c b/modules/LightRing_1-0/module.c
index 867d225..73c8281 100644
--- a/modules/LightRing_1-0/module.c
+++ b/modules/LightRing_1-0/module.c
@@ -231,9 +231,9 @@ ROMCONST apalControlGpio_t moduleGpioSysSync = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "LightRing";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/LightRing_1-0/module.h b/modules/LightRing_1-0/module.h
index 93ee58d..30f47b1 100644
--- a/modules/LightRing_1-0/module.h
+++ b/modules/LightRing_1-0/module.h
@@ -166,53 +166,52 @@ extern ROMCONST apalControlGpio_t moduleGpioSysSync;
 /**
  * @brief   Event flag to be set on a LASER_OC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_LASEROC          AOS_IOEVENT_FLAG(PAL_PAD(LINE_LASER_OC_N))
+#define MODULE_OS_GPIOEVENTFLAG_LASEROC         AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_LASER_OC_N))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_DN interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTDN       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
 
 /**
  * @brief   Event flag to be set on a WL_GDO2 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_WLGDO2           AOS_IOEVENT_FLAG(PAL_PAD(LINE_WL_GDO2))
+#define MODULE_OS_GPIOEVENTFLAG_WLGDO2          AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_WL_GDO2))
 
 /**
  * @brief   Event flag to be set on a WL_GDO0 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_WLGDO0           AOS_IOEVENT_FLAG(PAL_PAD(LINE_WL_GDO0))
+#define MODULE_OS_GPIOEVENTFLAG_WLGDO0          AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_WL_GDO0))
 
 /**
  * @brief   Event flag to be set on a SYS_PD interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSPD           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
 
 /**
  * @brief   Event flag to be set on a SYS_SYNC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSSYNC         AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* LASER_OC */                                                              \
-  palSetLineCallback(moduleGpioLaserOc.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioLaserOc.gpio->line);  \
+  palSetLineCallback(moduleGpioLaserOc.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioLaserOc.gpio->line);  \
   palEnableLineEvent(moduleGpioLaserOc.gpio->line, APAL2CH_EDGE(moduleGpioLaserOc.meta.edge));                  \
   /* WL_GDO2 */                                                               \
-  palSetLineCallback(moduleGpioWlGdo2.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioWlGdo2.gpio->line);  \
+  palSetLineCallback(moduleGpioWlGdo2.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioWlGdo2.gpio->line);  \
   palEnableLineEvent(moduleGpioWlGdo2.gpio->line, APAL2CH_EDGE(moduleGpioWlGdo2.meta.edge));                  \
   /* WL_GDO0 */                                                               \
-  palSetLineCallback(moduleGpioWlGdo0.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioWlGdo0.gpio->line);  \
+  palSetLineCallback(moduleGpioWlGdo0.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioWlGdo0.gpio->line);  \
   /*palEnableLineEvent(moduleGpioWlGdo0.gpio->line, APAL2CH_EDGE(moduleGpioWlGdo0.meta.edge)); // this is broken for some reason*/  \
 }
 
@@ -220,7 +219,7 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* initialize tests and add to shell */                                     \
+  /* add test commands to shell */                                            \
   aosShellAddCommand(&aos.shell, &moduleTestAt24c01bShellCmd);                \
   aosShellAddCommand(&aos.shell, &moduleTestTlc5947ShellCmd);                 \
   aosShellAddCommand(&aos.shell, &moduleTestTps2051bdbvShellCmd);             \
@@ -240,12 +239,16 @@ extern ROMCONST char* moduleShellPrompt;
   /* SPI */                                                                   \
   spiStart(&MODULE_HAL_SPI_LIGHT, &moduleHalSpiLightConfig);                  \
   spiStart(&MODULE_HAL_SPI_WL, &moduleHalSpiWlConfig);                        \
+  /* CAN */                                                                   \
+  canStart(&MODULE_HAL_CAN, &moduleHalCanConfig);                             \
 }
 
 /**
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* CAN */                                                                   \
+  canStop(&MODULE_HAL_CAN);                                                   \
   /* SPI */                                                                   \
   spiStop(&MODULE_HAL_SPI_LIGHT);                                             \
   spiStop(&MODULE_HAL_SPI_WL);                                                \
@@ -263,35 +266,39 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   PD signal GPIO.
  */
-#define moduleSsspGpioPd                        moduleGpioSysPd
+#define moduleSsspGpioPD                        moduleGpioSysPd
 
 /**
- * @brief   SYNC signal GPIO.
+ * @brief   S signal GPIO.
  */
-#define moduleSsspGpioSync                      moduleGpioSysSync
+#define moduleSsspGpioS                         moduleGpioSysSync
 
 /**
  * @brief   DN signal GPIO.
  */
-#define moduleSsspGpioDn                        moduleGpioSysUartDn
+#define moduleSsspGpioDN                        moduleGpioSysUartDn
 
 /**
- * @brief   Event flags for PD signal events.
+ * @brief   Event flag for PD signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_PD               MODULE_OS_IOEVENTFLAGS_SYSPD
+#define MODULE_SSSP_EVENTFLAG_PD                MODULE_OS_GPIOEVENTFLAG_SYSPD
 
 /**
- * @brief   Event flags for SYNC signal events.
+ * @brief   Event flag for S signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_SYNC             MODULE_OS_IOEVENTFLAGS_SYSSYNC
+#define MODULE_SSSP_EVENTFLAG_S                 MODULE_OS_GPIOEVENTFLAG_SYSSYNC
 
 /**
- * @brief   Event flags for DN signal events.
+ * @brief   Event flag for DN signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_DN               MODULE_OS_IOEVENTFLAGS_SYSUARTDN
+#define MODULE_SSSP_EVENTFLAG_DN                MODULE_OS_GPIOEVENTFLAG_SYSUARTDN
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/LightRing_1-2/aosconf.h b/modules/LightRing_1-2/aosconf.h
index 1ff1159..b46f4b3 100644
--- a/modules/LightRing_1-2/aosconf.h
+++ b/modules/LightRing_1-2/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,14 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK 0
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -103,6 +103,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_AMiRoBLT
+
+/** @} */
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -118,6 +133,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/LightRing_1-2/board.c b/modules/LightRing_1-2/board.c
index ef7ea32..39d57d6 100644
--- a/modules/LightRing_1-2/board.c
+++ b/modules/LightRing_1-2/board.c
@@ -26,6 +26,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <hal.h>
 
+/*===========================================================================*/
+/* Driver local definitions.                                                 */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported variables.                                                */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local variables and types.                                         */
+/*===========================================================================*/
+
 #if HAL_USE_PAL || defined(__DOXYGEN__)
 /**
  * @brief   PAL setup.
@@ -57,6 +69,18 @@ const PALConfig pal_default_config = {
 };
 #endif
 
+/*===========================================================================*/
+/* Driver local functions.                                                   */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver interrupt handlers.                                                */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions.                                                */
+/*===========================================================================*/
+
 /**
  * @brief   Early initialization code.
  * @details This initialization must be performed just after stack setup
diff --git a/modules/LightRing_1-2/board.h b/modules/LightRing_1-2/board.h
index 7ea2f11..98f5c8d 100644
--- a/modules/LightRing_1-2/board.h
+++ b/modules/LightRing_1-2/board.h
@@ -27,6 +27,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef BOARD_H
 #define BOARD_H
 
+/*===========================================================================*/
+/* Driver constants.                                                         */
+/*===========================================================================*/
+
 /*
  * Setup for AMiRo LightRing v1.2 board.
  */
@@ -67,10 +71,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define BOARD_BREAKOUT_UWBv10       1
 
 /*
- * Configuration macro to define which type of sensor ring is attached.
+ * Configuration macro to define which breakout module is attached.
  */
 #if !defined(BOARD_BREAKOUT_MODULE) || defined(__DOXYGEN__)
-#define BOARD_BREAKOUT_MODULE       BOARD_BREAKOUT_UWBv10
+#define BOARD_BREAKOUT_MODULE       BOARD_BREAKOUT_NONE
 #endif
 
 /*
@@ -245,6 +249,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #define LINE_SYS_INT_N              PAL_LINE(GPIOD, GPIOD_SYS_INT_N)
 
+/*===========================================================================*/
+/* Driver pre-compile time settings.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks.                                       */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver macros.                                                            */
+/*===========================================================================*/
+
 /*
  * I/O ports initial setup, this configuration is established soon after reset
  * in the initialization code.
@@ -644,6 +664,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                                      PIN_ODR_LOW(GPIOG_PIN14) |                                                    \
                                      PIN_ODR_LOW(GPIOG_PIN15))
 
+/*===========================================================================*/
+/* External declarations.                                                    */
+/*===========================================================================*/
+
 #if !defined(_FROM_ASM_)
 #ifdef __cplusplus
 extern "C" {
diff --git a/modules/LightRing_1-2/chconf.h b/modules/LightRing_1-2/chconf.h
index 07588f2..093b438 100644
--- a/modules/LightRing_1-2/chconf.h
+++ b/modules/LightRing_1-2/chconf.h
@@ -136,12 +136,6 @@
 /*===========================================================================*/
 
 /**
- * @brief   NVIC VTOR initialization offset.
- * @details On initialization, the code at this address in the flash memory will be executed.
- */
-#define CORTEX_VTOR_INIT                        0x00006000U
-
-/**
  * @brief   Flag to enable/disable sleep mode when the system is idle.
  */
 #define CORTEX_ENABLE_WFI_IDLE                  TRUE
diff --git a/modules/LightRing_1-2/module.c b/modules/LightRing_1-2/module.c
index b763077..d142636 100644
--- a/modules/LightRing_1-2/module.c
+++ b/modules/LightRing_1-2/module.c
@@ -509,9 +509,9 @@ apalControlGpio_t moduleGpioBreakoutIo8 = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "LightRing";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/LightRing_1-2/module.h b/modules/LightRing_1-2/module.h
index d62f6b5..a9da746 100644
--- a/modules/LightRing_1-2/module.h
+++ b/modules/LightRing_1-2/module.h
@@ -246,77 +246,76 @@ extern ROMCONST apalControlGpio_t moduleGpioSysSync;
 /**
  * @brief   Event flag to be set on a IO_4 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO4      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_4))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO4     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_4))
 
 /**
  * @brief   Event flag to be set on a IO_1 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO1      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_1))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO1     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_1))
 
 /**
  * @brief   Event flag to be set on a SYS_SYNC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSSYNC         AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
 
 /**
  * @brief   Event flag to be set on a IO_3 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO3      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_3))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO3     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_3))
 
 /**
  * @brief   Event flag to be set on a IO_5 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO5      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_5))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO5     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_5))
 
 /**
  * @brief   Event flag to be set on a IO_6 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO6      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_6))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO6     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_6))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_DN interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTDN       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_UP interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTUP       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
 
 /**
  * @brief   Event flag to be set on a IO_7 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO7      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_7))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO7     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_7))
 
 /**
  * @brief   Event flag to be set on a IO_8 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO8      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_8))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO8     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_8))
 
 /**
  * @brief   Event flag to be set on a SYS_PD interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSPD           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
 
 #if (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_UWBv10) || defined(__DOXYGEN__)
 
 /**
  * @brief   Event flag to be set on a DW1000 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_DW1000           MODULE_OS_IOEVENTFLAGS_BREAKOUTIO8
+#define MODULE_OS_GPIOEVENTFLAG_DW1000          MODULE_OS_GPIOEVENTFLAGS_BREAKOUTIO8
 
 #endif /* (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_UWBv10) */
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* breakout interrupts must be enabled explicitely */                       \
@@ -324,7 +323,7 @@ extern ROMCONST char* moduleShellPrompt;
 }
 #if (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_UWBv10)
   #define MODULE_INIT_INTERRUPTS_BREAKOUT() {                                 \
-    palSetLineCallback(moduleLldDw1000.gpio_exti->gpio->line, aosSysGetStdExtiCallback(), &moduleLldDw1000.gpio_exti->gpio->line);  \
+    palSetLineCallback(moduleLldDw1000.gpio_exti->gpio->line, aosSysGetStdGpioCallback(), &moduleLldDw1000.gpio_exti->gpio->line);  \
     palEnableLineEvent(moduleLldDw1000.gpio_exti->gpio->line, APAL2CH_EDGE(moduleLldDw1000.gpio_exti->meta.edge));                  \
   }
 #elif (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_NONE)
@@ -333,10 +332,10 @@ extern ROMCONST char* moduleShellPrompt;
 #endif
 
 /**
- * @brief   Unit test initialization hook.
+ * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* initialize tests and add to shell */                                     \
+  /* add test commands to shell */                                            \
   aosShellAddCommand(&aos.shell, &moduleTestAt24c01bShellCmd);                \
   aosShellAddCommand(&aos.shell, &moduleTestIna219ShellCmd);                  \
   aosShellAddCommand(&aos.shell, &moduleTestLedShellCmd);                     \
@@ -367,6 +366,8 @@ extern ROMCONST char* moduleShellPrompt;
   i2cStart(&MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT, &moduleHalI2cEepromPwrmtrBreakoutConfig);  \
   /* SPI */                                                                   \
   spiStart(&MODULE_HAL_SPI_LIGHT, &moduleHalSpiLightConfig);                  \
+  /* CAN */                                                                   \
+  canStart(&MODULE_HAL_CAN, &moduleHalCanConfig);                             \
   /* breakout module */                                                       \
   MODULE_INIT_PERIPHERY_COMM_BREAKOUT();                                      \
 }
@@ -383,12 +384,14 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* breakout module */                                                       \
+  MODULE_SHUTDOWN_PERIPHERY_COMM_BREAKOUT();                                  \
+  /* CAN */                                                                   \
+  canStop(&MODULE_HAL_CAN);                                                   \
   /* SPI */                                                                   \
   spiStop(&MODULE_HAL_SPI_LIGHT);                                             \
   /* I2C */                                                                   \
   i2cStop(&MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT);                            \
-  /* breakout module */                                                       \
-  MODULE_SHUTDOWN_PERIPHERY_COMM_BREAKOUT();                                  \
   /* don't stop the serial driver so messages can still be printed */         \
 }
 #if (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_UWBv10)
@@ -410,45 +413,49 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   PD signal GPIO.
  */
-#define moduleSsspGpioPd                        moduleGpioSysPd
+#define moduleSsspGpioPD                        moduleGpioSysPd
 
 /**
- * @brief   SYNC signal GPIO.
+ * @brief   S signal GPIO.
  */
-#define moduleSsspGpioSync                      moduleGpioSysSync
+#define moduleSsspGpioS                         moduleGpioSysSync
 
 /**
  * @brief   UP signal GPIO.
  */
-#define moduleSsspGpioUp                        moduleGpioSysUartUp
+#define moduleSsspGpioUP                        moduleGpioSysUartUp
 
 /**
  * @brief   DN signal GPIO.
  */
-#define moduleSsspGpioDn                        moduleGpioSysUartDn
+#define moduleSsspGpioDN                        moduleGpioSysUartDn
 
 /**
- * @brief   Event flags for PD signal events.
+ * @brief   Event flag for PD signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_PD               MODULE_OS_IOEVENTFLAGS_SYSPD
+#define MODULE_SSSP_EVENTFLAG_PD                MODULE_OS_GPIOEVENTFLAG_SYSPD
 
 /**
- * @brief   Event flags for SYNC signal events.
+ * @brief   Event flag for S signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_SYNC             MODULE_OS_IOEVENTFLAGS_SYSSYNC
+#define MODULE_SSSP_EVENTFLAG_S                 MODULE_OS_GPIOEVENTFLAG_SYSSYNC
 
 /**
- * @brief   Event flags for UP signal events.
+ * @brief   Event flag for UP signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_UP               MODULE_OS_IOEVENTFLAGS_SYSUARTUP
+#define MODULE_SSSP_EVENTFLAG_UP                MODULE_OS_GPIOEVENTFLAGS_SYSUARTUP
 
 /**
- * @brief   Event flags for DN signal events.
+ * @brief   Event flag for DN signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_DN               MODULE_OS_IOEVENTFLAGS_SYSUARTDN
+#define MODULE_SSSP_EVENTFLAG_DN                MODULE_OS_GPIOEVENTFLAG_SYSUARTDN
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/NUCLEO-F103RB/aosconf.h b/modules/NUCLEO-F103RB/aosconf.h
index 41fad2a..85ae785 100644
--- a/modules/NUCLEO-F103RB/aosconf.h
+++ b/modules/NUCLEO-F103RB/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,15 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    (MODULE_OS_IOEVENTFLAGS_DW1000_IRQn | MODULE_OS_IOEVENTFLAGS_USERBUTTON)
-//  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    MODULE_OS_IOEVENTFLAGS_USERBUTTON
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK MODULE_OS_GPIOEVENTFLAG_USERBUTTON
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -104,6 +103,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_NONE
+
+/** @} */
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -119,6 +133,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/NUCLEO-F103RB/module.c b/modules/NUCLEO-F103RB/module.c
index 393e18e..3374c3a 100644
--- a/modules/NUCLEO-F103RB/module.c
+++ b/modules/NUCLEO-F103RB/module.c
@@ -167,9 +167,9 @@ ROMCONST apalControlGpio_t moduleGpioUserButton = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "NUCLEO-F103RB";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/NUCLEO-F103RB/module.h b/modules/NUCLEO-F103RB/module.h
index 22a5cb2..89ce887 100644
--- a/modules/NUCLEO-F103RB/module.h
+++ b/modules/NUCLEO-F103RB/module.h
@@ -147,34 +147,33 @@ extern ROMCONST apalControlGpio_t moduleGpioUserButton;
 /**
  * @brief   Event flag to be call dwt_isr() interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_DW1000_IRQn      AOS_IOEVENT_FLAG(PAL_PAD(LINE_ARD_D14))
+#define MODULE_OS_GPIOEVENTFLAG_DW1000_IRQn     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_ARD_D14))
 //#endif /* (BOARD_DW1000_CONNECTED == true) */
 
 /**
  * @brief   Event flag to be set on a USER_BUTTON interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_USERBUTTON       AOS_IOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
+#define MODULE_OS_GPIOEVENTFLAG_USERBUTTON      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* user button */                                                           \
-  palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioUserButton.gpio->line);  \
+  palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioUserButton.gpio->line);  \
   palEnableLineEvent(moduleGpioUserButton.gpio->line, APAL2CH_EDGE(moduleGpioUserButton.meta.edge));                  \
   MODULE_INIT_INTERRUPTS_DW1000();                                            \
 }
 #if (BOARD_DW1000_CONNECTED == true)
   #define MODULE_INIT_INTERRUPTS_DW1000() {                                   \
-    palSetLineCallback(moduleGpioDw1000Irqn.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioDw1000Irqn.gpio->line);  \
+    palSetLineCallback(moduleGpioDw1000Irqn.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioDw1000Irqn.gpio->line);  \
     palEnableLineEvent(moduleGpioDw1000Irqn.gpio->line, APAL2CH_EDGE(moduleGpioDw1000Irqn.meta.edge));                  \
   }
 #else /* (BOARD_DW1000_CONNECTED == true) */
@@ -187,7 +186,7 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* initialize tests and add to shell */                                     \
+  /* add test commands to shell */                                            \
   aosShellAddCommand(&aos.shell, &moduleTestLedShellCmd);                     \
   aosShellAddCommand(&aos.shell, &moduleTestButtonShellCmd);                  \
   MODULE_INIT_TESTS_DW1000();                                                 \
@@ -228,6 +227,7 @@ extern ROMCONST char* moduleShellPrompt;
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
   MODULE_SHUTDOWN_PERIPHERY_IF_DW1000();                                      \
+  /* don't stop the serial driver so messages can still be printed */         \
 }
 #if (BOARD_DW1000_CONNECTED == true)
 #define MODULE_SHUTDOWN_PERIPHERY_IF_DW1000() {                               \
@@ -242,26 +242,26 @@ extern ROMCONST char* moduleShellPrompt;
 /**
  * @brief   HOOK to toggle the LEDs when the user button is pressed.
  */
-#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) {                               \
-  if (eventflags & MODULE_OS_IOEVENTFLAGS_USERBUTTON) {                       \
+#define MODULE_MAIN_LOOP_GPIOEVENT(eventflags) {                              \
+  if (eventflags & MODULE_OS_GPIOEVENTFLAG_USERBUTTON) {                      \
     apalControlGpioState_t buttonstate;                                       \
     apalControlGpioGet(&moduleGpioUserButton, &buttonstate);                  \
     apalControlGpioSet(&moduleGpioLed, buttonstate);                          \
   }                                                                           \
-  MODULE_MAIN_LOOP_IO_EVENT_DW1000();                                         \
+  MODULE_MAIN_LOOP_GPIOEVENT_DW1000();                                        \
 }
 #if (BOARD_DW1000_CONNECTED == true)
   /**
    * @brief   HOOK to call process_deca_irq() func when the dw1000 interrupt pin is activated.
    */
-  #define MODULE_MAIN_LOOP_IO_EVENT_DW1000() {                                \
-    if(eventflags & MODULE_OS_IOEVENTFLAGS_DW1000_IRQn) {                     \
+  #define MODULE_MAIN_LOOP_GPIOEVENT_DW1000() {                               \
+    if(eventflags & MODULE_GPOS_IOEVENTFLAG_DW1000_IRQn) {                    \
       /*apalGpioToggle(moduleGpioLed.gpio);*/ /* just for debug*/             \
       process_deca_irq();                                                     \
     }                                                                         \
   }
 #else /* (BOARD_DW1000_CONNECTED == true) */
-  #define MODULE_MAIN_LOOP_IO_EVENT_DW1000() {                                \
+  #define MODULE_MAIN_LOOP_GPIOEVENT_DW1000() {                               \
   }
 #endif /* (BOARD_DW1000_CONNECTED == true) */
 
@@ -274,6 +274,12 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
+// SSSP is not yet supported on this module
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
 /** @} */
 
 /*===========================================================================*/
diff --git a/modules/NUCLEO-F103RB/test/DW1000/module_test_DW1000.c b/modules/NUCLEO-F103RB/test/DW1000/module_test_DW1000.c
index 090d325..7c2c020 100644
--- a/modules/NUCLEO-F103RB/test/DW1000/module_test_DW1000.c
+++ b/modules/NUCLEO-F103RB/test/DW1000/module_test_DW1000.c
@@ -42,8 +42,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 static aos_test_dw1000data_t _data = {
   /* UWB data     */ &moduleLldDw1000,
-  /* event source */ &aos.events.io,
-  /* event flags  */ MODULE_OS_IOEVENTFLAGS_DW1000_IRQn,
+  /* event source */ &aos.events.gpio,
+  /* event flags  */ MODULE_OS_GPIOEVENTFLAG_DW1000_IRQn,
 };
 
 static AOS_TEST(_test, "DW1000", NULL, moduleTestDw1000ShellCb, aosTestDw1000Func, &_data);
diff --git a/modules/NUCLEO-F103RB/test/button/module_test_button.c b/modules/NUCLEO-F103RB/test/button/module_test_button.c
index 9990b53..e2914ca 100644
--- a/modules/NUCLEO-F103RB/test/button/module_test_button.c
+++ b/modules/NUCLEO-F103RB/test/button/module_test_button.c
@@ -41,8 +41,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 static aos_test_buttondata_t _data = {
   /* button       */ &moduleLldUserButton,
-  /* event source */ &aos.events.io,
-  /* event flags  */ MODULE_OS_IOEVENTFLAGS_USERBUTTON,
+  /* event source */ &aos.events.gpio,
+  /* event flags  */ MODULE_OS_GPIOEVENTFLAG_USERBUTTON,
 };
 
 static AOS_TEST(_test, "button", NULL, moduleTestButtonShellCb, aosTestButtonFunc, &_data);
diff --git a/modules/NUCLEO-F401RE/aosconf.h b/modules/NUCLEO-F401RE/aosconf.h
index aa21821..45e6687 100644
--- a/modules/NUCLEO-F401RE/aosconf.h
+++ b/modules/NUCLEO-F401RE/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,14 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    MODULE_OS_IOEVENTFLAGS_USERBUTTON
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK MODULE_OS_GPIOEVENTFLAG_USERBUTTON
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -103,6 +103,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_NONE
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -118,6 +131,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/NUCLEO-F401RE/module.c b/modules/NUCLEO-F401RE/module.c
index 68063b1..bcc71fd 100644
--- a/modules/NUCLEO-F401RE/module.c
+++ b/modules/NUCLEO-F401RE/module.c
@@ -97,9 +97,9 @@ ROMCONST apalControlGpio_t moduleGpioUserButton = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "NUCLEO-F401RE";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/NUCLEO-F401RE/module.h b/modules/NUCLEO-F401RE/module.h
index 6f6675c..a3d398c 100644
--- a/modules/NUCLEO-F401RE/module.h
+++ b/modules/NUCLEO-F401RE/module.h
@@ -91,30 +91,29 @@ extern ROMCONST apalControlGpio_t moduleGpioUserButton;
 /**
  * @brief   Event flag to be set on a USER_BUTTON interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_USERBUTTON       AOS_IOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
+#define MODULE_OS_GPIOEVENTFLAG_USERBUTTON      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* user button */                                                           \
-  palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioUserButton.gpio->line);  \
+  palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioUserButton.gpio->line);  \
   palEnableLineEvent(moduleGpioUserButton.gpio->line, APAL2CH_EDGE(moduleGpioUserButton.meta.edge));                  \
 }
 
 /**
- * @brief   Unit test initialization hook.
+ * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* add unit-test shell commands */                                          \
+  /* add test commands to shell */                                            \
 }
 
 /**
@@ -129,13 +128,14 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* don't stop the serial driver so messages can still be printed */         \
 }
 
 /**
  * @brief   HOOK to toggle the LEDs when the user button is pressed.
  */
-#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) {                               \
-  if (eventflags & MODULE_OS_IOEVENTFLAGS_USERBUTTON) {                       \
+#define MODULE_MAIN_LOOP_GPIOEVENT(eventflags) {                              \
+  if (eventflags & MODULE_OS_GPIOEVENTFLAG_USERBUTTON) {                      \
     apalControlGpioState_t buttonstate;                                       \
     apalControlGpioGet(&moduleGpioUserButton, &buttonstate);                  \
     apalControlGpioSet(&moduleGpioLed, buttonstate);                          \
@@ -151,6 +151,12 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
+// SSSP is not yet supported on this module
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
 /** @} */
 
 /*===========================================================================*/
diff --git a/modules/NUCLEO-F767ZI/aosconf.h b/modules/NUCLEO-F767ZI/aosconf.h
index fc42c7a..0e4ebee 100644
--- a/modules/NUCLEO-F767ZI/aosconf.h
+++ b/modules/NUCLEO-F767ZI/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,14 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    MODULE_OS_IOEVENTFLAGS_USERBUTTON
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK MODULE_OS_GPIOEVENTFLAG_USERBUTTON
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -103,6 +103,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_NONE
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -118,6 +131,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/NUCLEO-F767ZI/module.c b/modules/NUCLEO-F767ZI/module.c
index bb5d9ae..606f1f8 100644
--- a/modules/NUCLEO-F767ZI/module.c
+++ b/modules/NUCLEO-F767ZI/module.c
@@ -127,9 +127,9 @@ ROMCONST apalControlGpio_t moduleGpioUserButton = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "NUCLEO-F767ZI";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/NUCLEO-F767ZI/module.h b/modules/NUCLEO-F767ZI/module.h
index 543c763..3cfec3c 100644
--- a/modules/NUCLEO-F767ZI/module.h
+++ b/modules/NUCLEO-F767ZI/module.h
@@ -101,30 +101,29 @@ extern ROMCONST apalControlGpio_t moduleGpioUserButton;
 /**
  * @brief   Event flag to be set on a USER_BUTTON interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_USERBUTTON       AOS_IOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
+#define MODULE_OS_GPIOEVENTFLAG_USERBUTTON      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* user button */                                                           \
-  palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioUserButton.gpio->line);  \
+  palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioUserButton.gpio->line);  \
   palEnableLineEvent(moduleGpioUserButton.gpio->line, APAL2CH_EDGE(moduleGpioUserButton.meta.edge));                  \
 }
 
 /**
- * @brief   Unit test initialization hook.
+ * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* add unit-test shell commands */                                          \
+  /* add test commands to shell */                                            \
 }
 
 /**
@@ -139,13 +138,14 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* don't stop the serial driver so messages can still be printed */         \
 }
 
 /**
  * @brief   HOOK to toggle the LEDs when the user button is pressed.
  */
-#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) {                               \
-  if (eventflags & MODULE_OS_IOEVENTFLAGS_USERBUTTON) {                       \
+#define MODULE_MAIN_LOOP_GPIOEVENT(eventflags) {                              \
+  if (eventflags & MODULE_OS_GPIOEVENTFLAG_USERBUTTON) {                      \
     apalControlGpioState_t buttonstate;                                       \
     apalControlGpioGet(&moduleGpioUserButton, &buttonstate);                  \
     apalControlGpioSet(&moduleGpioLed1, buttonstate);                         \
@@ -163,6 +163,12 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
+// SSSP is not yet supported on this module
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
 /** @} */
 
 /*===========================================================================*/
diff --git a/modules/NUCLEO-L476RG/aosconf.h b/modules/NUCLEO-L476RG/aosconf.h
index 0bbf321..5b0779e 100644
--- a/modules/NUCLEO-L476RG/aosconf.h
+++ b/modules/NUCLEO-L476RG/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,14 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    MODULE_OS_IOEVENTFLAGS_USERBUTTON
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK MODULE_OS_GPIOEVENTFLAG_USERBUTTON
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -103,6 +103,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_NONE
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -118,6 +131,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/NUCLEO-L476RG/module.c b/modules/NUCLEO-L476RG/module.c
index 5500b4d..2a731e6 100644
--- a/modules/NUCLEO-L476RG/module.c
+++ b/modules/NUCLEO-L476RG/module.c
@@ -107,9 +107,9 @@ ROMCONST apalControlGpio_t moduleGpioUserButton = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "NUCLEO-L476RG";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/NUCLEO-L476RG/module.h b/modules/NUCLEO-L476RG/module.h
index dacef7b..1c4b8bf 100644
--- a/modules/NUCLEO-L476RG/module.h
+++ b/modules/NUCLEO-L476RG/module.h
@@ -105,22 +105,21 @@ extern ROMCONST apalControlGpio_t moduleGpioUserButton;
 /**
  * @brief   Event flag to be set on a USER_BUTTON interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_USERBUTTON       AOS_IOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
+#define MODULE_OS_GPIOEVENTFLAG_USERBUTTON      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* user button */                                                           \
-  palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioUserButton.gpio->line);  \
+  palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioUserButton.gpio->line);  \
   palEnableLineEvent(moduleGpioUserButton.gpio->line, APAL2CH_EDGE(moduleGpioUserButton.meta.edge));                  \
 }
 
@@ -128,7 +127,7 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* initialize tests and add to shell */                                     \
+  /* add test commands to shell */                                            \
   aosShellAddCommand(&aos.shell, &moduleTestLedShellCmd);                     \
   aosShellAddCommand(&aos.shell, &moduleTestButtonShellCmd);                  \
   MODULE_INIT_TEST_MPU6050();                                                 \
@@ -136,7 +135,6 @@ extern ROMCONST char* moduleShellPrompt;
 }
 #if (BOARD_MPU6050_CONNECTED == true)
   #define MODULE_INIT_TEST_MPU6050() {                                        \
-    /* add unit-test shell commands */                                        \
     aosShellAddCommand(&aos.shell, &moduleTestMpu6050ShellCmd);               \
   }
 #else /* (BOARD_MPU6050_CONNECTED == true) */
@@ -185,13 +183,14 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* don't stop the serial driver so messages can still be printed */         \
 }
 
 /**
  * @brief   HOOK to toggle the LEDs when the user button is pressed.
  */
-#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) {                               \
-  if (eventflags & MODULE_OS_IOEVENTFLAGS_USERBUTTON) {                       \
+#define MODULE_MAIN_LOOP_GPIOEVENT(eventflags) {                              \
+  if (eventflags & MODULE_OS_GPIOEVENTFLAG_USERBUTTON) {                      \
     button_lld_state_t buttonstate;                                           \
     button_lld_get(&moduleLldUserButton, &buttonstate);                       \
     led_lld_set(&moduleLldLed, (buttonstate == BUTTON_LLD_STATE_PRESSED) ? LED_LLD_STATE_ON : LED_LLD_STATE_OFF); \
@@ -207,6 +206,12 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
+// SSSP is not yet supported on this module
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
 /** @} */
 
 /*===========================================================================*/
diff --git a/modules/NUCLEO-L476RG/test/button/module_test_button.c b/modules/NUCLEO-L476RG/test/button/module_test_button.c
index 9990b53..e2914ca 100644
--- a/modules/NUCLEO-L476RG/test/button/module_test_button.c
+++ b/modules/NUCLEO-L476RG/test/button/module_test_button.c
@@ -41,8 +41,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 static aos_test_buttondata_t _data = {
   /* button       */ &moduleLldUserButton,
-  /* event source */ &aos.events.io,
-  /* event flags  */ MODULE_OS_IOEVENTFLAGS_USERBUTTON,
+  /* event source */ &aos.events.gpio,
+  /* event flags  */ MODULE_OS_GPIOEVENTFLAG_USERBUTTON,
 };
 
 static AOS_TEST(_test, "button", NULL, moduleTestButtonShellCb, aosTestButtonFunc, &_data);
diff --git a/modules/PowerManagement_1-1/aosconf.h b/modules/PowerManagement_1-1/aosconf.h
index 20eab3e..968bbf6 100644
--- a/modules/PowerManagement_1-1/aosconf.h
+++ b/modules/PowerManagement_1-1/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,14 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK 0
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -103,6 +103,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_AMiRoBLT
+
+/** @} */
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -118,6 +133,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/PowerManagement_1-1/board.c b/modules/PowerManagement_1-1/board.c
index cb33515..90fb63c 100644
--- a/modules/PowerManagement_1-1/board.c
+++ b/modules/PowerManagement_1-1/board.c
@@ -27,14 +27,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <hal.h>
 #include <stm32_gpio.h>
 
-/**
- * @brief   GPIO initialization.
- *
- * @param[in]   gpiop   GPIO register block.
- * @param[in]   config  GPIO configuration.
- */
+/*===========================================================================*/
+/* Driver local definitions.                                                 */
+/*===========================================================================*/
 
+/*===========================================================================*/
+/* Driver exported variables.                                                */
+/*===========================================================================*/
 
+/*===========================================================================*/
+/* Driver local variables and types.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions.                                                   */
+/*===========================================================================*/
 
 /**
  * @brief   GPIO initialization.
@@ -114,6 +121,14 @@ static void _stm32_gpio_init(void) {
 #endif
 }
 
+/*===========================================================================*/
+/* Driver interrupt handlers.                                                */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions.                                                */
+/*===========================================================================*/
+
 /**
  * @brief   Early initialization code.
  * @details This initialization must be performed just after stack setup
diff --git a/modules/PowerManagement_1-1/board.h b/modules/PowerManagement_1-1/board.h
index 794ab31..87541a9 100644
--- a/modules/PowerManagement_1-1/board.h
+++ b/modules/PowerManagement_1-1/board.h
@@ -27,6 +27,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef BOARD_H
 #define BOARD_H
 
+/*===========================================================================*/
+/* Driver constants.                                                         */
+/*===========================================================================*/
+
 /*
  * Setup for AMiRo PowerManagement v1.1 board.
  */
@@ -308,6 +312,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LINE_OSC_IN                     PAL_LINE(GPIOH, 0U)
 #define LINE_OSC_OUT                    PAL_LINE(GPIOH, 1U)
 
+/*===========================================================================*/
+/* Driver pre-compile time settings.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks.                                       */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver macros.                                                            */
+/*===========================================================================*/
+
 /*
  * I/O ports initial setup, this configuration is established soon after reset
  * in the initialization code.
@@ -1383,6 +1403,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                                          PIN_AFIO_AF(GPIOI_PIN14, STM32F4xx_AF_system) |              \
                                          PIN_AFIO_AF(GPIOI_PIN15, STM32F4xx_AF_system))
 
+/*===========================================================================*/
+/* External declarations.                                                    */
+/*===========================================================================*/
+
 #if !defined(_FROM_ASM_)
 #ifdef __cplusplus
 extern "C" {
diff --git a/modules/PowerManagement_1-1/chconf.h b/modules/PowerManagement_1-1/chconf.h
index e955874..a25b20b 100644
--- a/modules/PowerManagement_1-1/chconf.h
+++ b/modules/PowerManagement_1-1/chconf.h
@@ -136,12 +136,6 @@
 /*===========================================================================*/
 
 /**
- * @brief   NVIC VTOR initialization offset.
- * @details On initialization, the code at this address in the flash memory will be executed.
- */
-#define CORTEX_VTOR_INIT                        0x00008000U
-
-/**
  * @brief   Flag to enable/disable sleep mode when the system is idle.
  */
 #define CORTEX_ENABLE_WFI_IDLE                  TRUE
diff --git a/modules/PowerManagement_1-1/module.c b/modules/PowerManagement_1-1/module.c
index f584017..ad30a16 100644
--- a/modules/PowerManagement_1-1/module.c
+++ b/modules/PowerManagement_1-1/module.c
@@ -522,9 +522,9 @@ ROMCONST apalControlGpio_t moduleGpioChargeEn2 = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "PowerManagement";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/PowerManagement_1-1/module.h b/modules/PowerManagement_1-1/module.h
index 86127f2..0ed1d9b 100644
--- a/modules/PowerManagement_1-1/module.h
+++ b/modules/PowerManagement_1-1/module.h
@@ -317,114 +317,113 @@ extern ROMCONST apalControlGpio_t moduleGpioChargeEn2;
 /**
  * @brief   Event flag to be set on a IR_INT1 / CHARGE_STAT1A interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_IRINT1           AOS_IOEVENT_FLAG(PAL_PAD(LINE_IR_INT1_N))
+#define MODULE_OS_GPIOEVENTFLAG_IRINT1          AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IR_INT1_N))
 
 /**
  * @brief   Event flag to be set on a GAUGE_BATLOW1 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_GAUGEBATLOW1     AOS_IOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATLOW1))
+#define MODULE_OS_GPIOEVENTFLAG_GAUGEBATLOW1    AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATLOW1))
 
 /**
  * @brief   Event flag to be set on a GAUGE_BATGD1 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_GAUGEBATGD1      AOS_IOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATGD1_N))
+#define MODULE_OS_GPIOEVENTFLAG_GAUGEBATGD1     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATGD1_N))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_DN interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTDN       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
 
 /**
  * @brief   Event flag to be set on a IR_INT2 / CHARGE_STAT2A interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_IRINT2           AOS_IOEVENT_FLAG(PAL_PAD(LINE_IR_INT2_N))
+#define MODULE_OS_GPIOEVENTFLAG_IRINT2          AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IR_INT2_N))
 
 /**
  * @brief   Event flag to be set on a TOUCH_INT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_TOUCHINT         AOS_IOEVENT_FLAG(PAL_PAD(LINE_TOUCH_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_TOUCHINT        AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_TOUCH_INT_N))
 
 /**
  * @brief   Event flag to be set on a GAUGE_BATLOW2 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_GAUGEBATLOW2     AOS_IOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATLOW2))
+#define MODULE_OS_GPIOEVENTFLAG_GAUGEBATLOW2    AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATLOW2))
 
 /**
  * @brief   Event flag to be set on a GAUGE_BATGD2 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_GAUGEBATGD2      AOS_IOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATGD2_N))
+#define MODULE_OS_GPIOEVENTFLAG_GAUGEBATGD2     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATGD2_N))
 
 /**
  * @brief   Event flag to be set on a PATH_DC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_PATHDC           AOS_IOEVENT_FLAG(PAL_PAD(LINE_PATH_DC))
+#define MODULE_OS_GPIOEVENTFLAG_PATHDC          AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_PATH_DC))
 
 /**
  * @brief   Event flag to be set on a SYS_SPI_DIR interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSSPIDIR        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_SPI_DIR))
+#define MODULE_OS_GPIOEVENTFLAG_SYSSPIDIR       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_SPI_DIR))
 
 /**
  * @brief   Event flag to be set on a SYS_SYNC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSSYNC         AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
 
 /**
  * @brief   Event flag to be set on a SYS_PD interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSPD           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
 
 /**
  * @brief   Event flag to be set on a SYS_WARMRST interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST       AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSWARMRST      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_UP interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTUP       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* IR_INT1 */                                                               \
-  palSetLineCallback(moduleGpioIrInt1.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioIrInt1.gpio->line);  \
+  palSetLineCallback(moduleGpioIrInt1.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioIrInt1.gpio->line);  \
   palEnableLineEvent(moduleGpioIrInt1.gpio->line, APAL2CH_EDGE(moduleGpioIrInt1.meta.edge));                  \
   /* GAUGE_BATLOW2 */                                                         \
-  palSetLineCallback(moduleGpioGaugeBatLow2.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioGaugeBatLow2.gpio->line);  \
+  palSetLineCallback(moduleGpioGaugeBatLow2.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioGaugeBatLow2.gpio->line);  \
   palEnableLineEvent(moduleGpioGaugeBatLow2.gpio->line, APAL2CH_EDGE(moduleGpioGaugeBatLow2.meta.edge));                  \
   /* GAUGE_BATGD2 */                                                          \
-  palSetLineCallback(moduleGpioGaugeBatGd2.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioGaugeBatGd2.gpio->line);  \
+  palSetLineCallback(moduleGpioGaugeBatGd2.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioGaugeBatGd2.gpio->line);  \
   palEnableLineEvent(moduleGpioGaugeBatGd2.gpio->line, APAL2CH_EDGE(moduleGpioGaugeBatGd2.meta.edge));                  \
   /* GAUGE_BATLOW1 */                                                         \
-  palSetLineCallback(moduleGpioGaugeBatLow1.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioGaugeBatLow1.gpio->line);  \
+  palSetLineCallback(moduleGpioGaugeBatLow1.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioGaugeBatLow1.gpio->line);  \
   palEnableLineEvent(moduleGpioGaugeBatLow1.gpio->line, APAL2CH_EDGE(moduleGpioGaugeBatLow1.meta.edge));                  \
   /* GAUGE_BATGD1 */                                                          \
-  palSetLineCallback(moduleGpioGaugeBatGd1.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioGaugeBatGd1.gpio->line);  \
+  palSetLineCallback(moduleGpioGaugeBatGd1.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioGaugeBatGd1.gpio->line);  \
   palEnableLineEvent(moduleGpioGaugeBatGd1.gpio->line, APAL2CH_EDGE(moduleGpioGaugeBatGd1.meta.edge));                  \
   /* IR_INT2 */                                                               \
-  palSetLineCallback(moduleGpioIrInt2.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioIrInt2.gpio->line);  \
+  palSetLineCallback(moduleGpioIrInt2.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioIrInt2.gpio->line);  \
   palEnableLineEvent(moduleGpioIrInt2.gpio->line, APAL2CH_EDGE(moduleGpioIrInt2.meta.edge));                  \
   /* TOUCH_INT */                                                             \
-  palSetLineCallback(moduleGpioTouchInt.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioTouchInt.gpio->line);  \
+  palSetLineCallback(moduleGpioTouchInt.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioTouchInt.gpio->line);  \
   palEnableLineEvent(moduleGpioTouchInt.gpio->line, APAL2CH_EDGE(moduleGpioTouchInt.meta.edge));                  \
   /* PATH_DC */                                                               \
-  palSetLineCallback(moduleGpioPathDc.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioPathDc.gpio->line);  \
+  palSetLineCallback(moduleGpioPathDc.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioPathDc.gpio->line);  \
   palEnableLineEvent(moduleGpioPathDc.gpio->line, APAL2CH_EDGE(moduleGpioPathDc.meta.edge));                  \
   /* SYS_SPI_DIR */                                                           \
-  palSetLineCallback(moduleGpioSysSpiDir.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysSpiDir.gpio->line);  \
+  palSetLineCallback(moduleGpioSysSpiDir.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysSpiDir.gpio->line);  \
   palEnableLineEvent(moduleGpioSysSpiDir.gpio->line, APAL2CH_EDGE(moduleGpioSysSpiDir.meta.edge));                  \
   /* SYS_WARMRST */                                                           \
-  palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysWarmrst.gpio->line);  \
+  palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysWarmrst.gpio->line);  \
   palEnableLineEvent(moduleGpioSysWarmrst.gpio->line, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge));                  \
 }
 
@@ -432,7 +431,7 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* add unit-test shell commands */                                          \
+  /* add test commands to shell */                                            \
   aosShellAddCommand(&aos.shell, &moduleTestAdcShellCmd);                     \
   aosShellAddCommand(&aos.shell, &moduleTestAt24c01bShellCmd);                \
   aosShellAddCommand(&aos.shell, &moduleTestBq241xxShellCmd);                 \
@@ -491,6 +490,8 @@ extern ROMCONST char* moduleShellPrompt;
   pwmStop(&MODULE_HAL_PWM_BUZZER);                                            \
   moduleHalPwmBuzzerConfig.period = moduleHalPwmBuzzerConfig.frequency / PKxxxExxx_LLD_FREQUENCY_SPEC; \
   pwmStart(&MODULE_HAL_PWM_BUZZER, &moduleHalPwmBuzzerConfig);                \
+  /* CAN */                                                                   \
+  canStart(&MODULE_HAL_CAN, &moduleHalCanConfig);                             \
 }
 #if (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR) || defined(__DOXYGEN__)
   #define MODULE_INIT_PERIPHERY_IF_SENSORRING() {                             \
@@ -520,6 +521,8 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* CAN */                                                                   \
+  canStop(&MODULE_HAL_CAN);                                                   \
   /* PWM */                                                                   \
   pwmStop(&MODULE_HAL_PWM_BUZZER);                                            \
   /* ADC */                                                                   \
@@ -539,45 +542,49 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   PD signal GPIO.
  */
-#define moduleSsspGpioPd                        moduleGpioSysPd
+#define moduleSsspGpioPD                        moduleGpioSysPd
 
 /**
- * @brief   SYNC signal GPIO.
+ * @brief   S signal GPIO.
  */
-#define moduleSsspGpioSync                       moduleGpioSysSync
+#define moduleSsspGpioS                         moduleGpioSysSync
 
 /**
  * @brief   DN signal GPIO.
  */
-#define moduleSsspGpioDn                        moduleGpioSysUartDn
+#define moduleSsspGpioDN                        moduleGpioSysUartDn
 
 /**
  * @brief   UP signal GPIO.
  */
-#define moduleSsspGpioUp                        moduleGpioSysUartUp
+#define moduleSsspGpioUP                        moduleGpioSysUartUp
 
 /**
- * @brief   Event flags for PD signal events.
+ * @brief   Event flag for PD signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_PD               MODULE_OS_IOEVENTFLAGS_SYSPD
+#define MODULE_SSSP_EVENTFLAG_PD                MODULE_OS_GPIOEVENTFLAG_SYSPD
 
 /**
- * @brief   Event flags for SYNC signal events.
+ * @brief   Event flag for S signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_SYNC             MODULE_OS_IOEVENTFLAGS_SYSSYNC
+#define MODULE_SSSP_EVENTFLAG_S                 MODULE_OS_GPIOEVENTFLAG_SYSSYNC
 
 /**
- * @brief   Event flags for UP signal events.
+ * @brief   Event flag for UP signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_UP               MODULE_OS_IOEVENTFLAGS_SYSUARTUP
+#define MODULE_SSSP_EVENTFLAG_UP                MODULE_OS_GPIOEVENTFLAG_SYSUARTUP
 
 /**
- * @brief   Event flags for DN signal events.
+ * @brief   Event flag for DN signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_DN               MODULE_OS_IOEVENTFLAGS_SYSUARTDN
+#define MODULE_SSSP_EVENTFLAG_DN                MODULE_OS_GPIOEVENTFLAG_SYSUARTDN
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/PowerManagement_1-1/test/AT42QT1050/module_test_AT42QT1050.c b/modules/PowerManagement_1-1/test/AT42QT1050/module_test_AT42QT1050.c
index 6c373f7..de77988 100644
--- a/modules/PowerManagement_1-1/test/AT42QT1050/module_test_AT42QT1050.c
+++ b/modules/PowerManagement_1-1/test/AT42QT1050/module_test_AT42QT1050.c
@@ -42,8 +42,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 static aos_test_at42qt1050data_t _data = {
   /* AT42QT1050 driver  */ &moduleLldTouch,
   /* timeout            */ MICROSECONDS_PER_SECOND,
-  /* event source       */ &aos.events.io,
-  /* event flags        */ MODULE_OS_IOEVENTFLAGS_TOUCHINT,
+  /* event source       */ &aos.events.gpio,
+  /* event flags        */ MODULE_OS_GPIOEVENTFLAG_TOUCHINT,
 };
 
 static AOS_TEST(_test, "AT42QT1050", "touch sensor", moduleTestAt42qt1050ShellCb, aosTestAt42qt1050Func, &_data);
diff --git a/modules/PowerManagement_1-1/test/MPR121/module_test_MPR121.c b/modules/PowerManagement_1-1/test/MPR121/module_test_MPR121.c
index f678f43..05e1480 100644
--- a/modules/PowerManagement_1-1/test/MPR121/module_test_MPR121.c
+++ b/modules/PowerManagement_1-1/test/MPR121/module_test_MPR121.c
@@ -42,8 +42,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 static aos_test_mpr121data_t _data= {
   /* MPR121 driver  */ &moduleLldTouch,
   /* timeout        */ MICROSECONDS_PER_SECOND,
-  /* event source   */ &aos.events.io,
-  /* event flags    */ MODULE_OS_IOEVENTFLAGS_TOUCHINT,
+  /* event source   */ &aos.events.gpio,
+  /* event flags    */ MODULE_OS_GPIOEVENTFLAG_TOUCHINT,
 };
 
 static AOS_TEST(_test, "MPR121", "touch sensor", moduleTestMpr121ShellCb, aosTestMpr121Func, &_data);
diff --git a/modules/PowerManagement_1-1/test/VCNL4020/module_test_VCNL4020.c b/modules/PowerManagement_1-1/test/VCNL4020/module_test_VCNL4020.c
index 913e762..62ffa2c 100644
--- a/modules/PowerManagement_1-1/test/VCNL4020/module_test_VCNL4020.c
+++ b/modules/PowerManagement_1-1/test/VCNL4020/module_test_VCNL4020.c
@@ -43,7 +43,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 static aos_test_vcnl4020data_t _data = {
   /* driver       */ NULL,
   /* timeout      */ MICROSECONDS_PER_SECOND,
-  /* event source */ &aos.events.io,
+  /* event source */ &aos.events.gpio,
   /* event flags  */ 0,
 };
 
@@ -107,7 +107,7 @@ int moduleTestVcnl4020ShellCb(BaseSequentialStream* stream, int argc, char* argv
       case WNW:
         mux = &moduleLldI2cMultiplexer1;
         _data.vcnld = &moduleLldProximity1;
-        _data.evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+        _data.evtflags = MODULE_OS_GPIOEVENTFLAG_IRINT2;
         break;
       case NNW:
       case NNE:
@@ -115,7 +115,7 @@ int moduleTestVcnl4020ShellCb(BaseSequentialStream* stream, int argc, char* argv
       case ESE:
         mux = &moduleLldI2cMultiplexer2;
         _data.vcnld = &moduleLldProximity2;
-        _data.evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+        _data.evtflags = MODULE_OS_GPIOEVENTFLAG_IRINT1;
         break;
       default:
         break;
diff --git a/modules/PowerManagement_1-2/aosconf.h b/modules/PowerManagement_1-2/aosconf.h
index 87369e3..024aad2 100644
--- a/modules/PowerManagement_1-2/aosconf.h
+++ b/modules/PowerManagement_1-2/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,14 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    0
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK 0
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -103,6 +103,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_AMiRoBLT
+
+/** @} */
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -118,6 +133,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/PowerManagement_1-2/board.c b/modules/PowerManagement_1-2/board.c
index 18d4274..f683ea2 100644
--- a/modules/PowerManagement_1-2/board.c
+++ b/modules/PowerManagement_1-2/board.c
@@ -27,14 +27,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <hal.h>
 #include <stm32_gpio.h>
 
-/**
- * @brief   GPIO initialization.
- *
- * @param[in]   gpiop   GPIO register block.
- * @param[in]   config  GPIO configuration.
- */
+/*===========================================================================*/
+/* Driver local definitions.                                                 */
+/*===========================================================================*/
 
+/*===========================================================================*/
+/* Driver exported variables.                                                */
+/*===========================================================================*/
 
+/*===========================================================================*/
+/* Driver local variables and types.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver local functions.                                                   */
+/*===========================================================================*/
 
 /**
  * @brief   GPIO initialization.
@@ -114,6 +121,14 @@ static void _stm32_gpio_init(void) {
 #endif
 }
 
+/*===========================================================================*/
+/* Driver interrupt handlers.                                                */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver exported functions.                                                */
+/*===========================================================================*/
+
 /**
  * @brief   Early initialization code.
  * @details This initialization must be performed just after stack setup
diff --git a/modules/PowerManagement_1-2/board.h b/modules/PowerManagement_1-2/board.h
index 52d8720..5290b10 100644
--- a/modules/PowerManagement_1-2/board.h
+++ b/modules/PowerManagement_1-2/board.h
@@ -27,6 +27,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef BOARD_H
 #define BOARD_H
 
+/*===========================================================================*/
+/* Driver constants.                                                         */
+/*===========================================================================*/
+
 /*
  * Setup for AMiRo PowerManagement v1.2 board.
  */
@@ -91,7 +95,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * Configuration macro to define which type of sensor ring is attached.
  */
 #if !defined(BOARD_SENSORRING) || defined(__DOXYGEN__)
-#define BOARD_SENSORRING                BOARD_PROXIMITYSENSOR
+#define BOARD_SENSORRING                BOARD_NOSENSORRING
 #endif
 
 /*
@@ -309,6 +313,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LINE_OSC_IN                     PAL_LINE(GPIOH, 0U)
 #define LINE_OSC_OUT                    PAL_LINE(GPIOH, 1U)
 
+/*===========================================================================*/
+/* Driver pre-compile time settings.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks.                                       */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types.                                         */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver macros.                                                            */
+/*===========================================================================*/
+
 /*
  * I/O ports initial setup, this configuration is established soon after reset
  * in the initialization code.
@@ -1384,6 +1404,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                                          PIN_AFIO_AF(GPIOI_PIN14, STM32F4xx_AF_system) |              \
                                          PIN_AFIO_AF(GPIOI_PIN15, STM32F4xx_AF_system))
 
+/*===========================================================================*/
+/* External declarations.                                                    */
+/*===========================================================================*/
+
 #if !defined(_FROM_ASM_)
 #ifdef __cplusplus
 extern "C" {
diff --git a/modules/PowerManagement_1-2/chconf.h b/modules/PowerManagement_1-2/chconf.h
index 55dbe38..7d00cb7 100644
--- a/modules/PowerManagement_1-2/chconf.h
+++ b/modules/PowerManagement_1-2/chconf.h
@@ -136,12 +136,6 @@
 /*===========================================================================*/
 
 /**
- * @brief   NVIC VTOR initialization offset.
- * @details On initialization, the code at this address in the flash memory will be executed.
- */
-#define CORTEX_VTOR_INIT                        0x00008000U
-
-/**
  * @brief   Flag to enable/disable sleep mode when the system is idle.
  */
 #define CORTEX_ENABLE_WFI_IDLE                  TRUE
diff --git a/modules/PowerManagement_1-2/module.c b/modules/PowerManagement_1-2/module.c
index 6926136..e962413 100644
--- a/modules/PowerManagement_1-2/module.c
+++ b/modules/PowerManagement_1-2/module.c
@@ -537,9 +537,9 @@ ROMCONST apalControlGpio_t moduleGpioChargeEn2 = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "PowerManagement";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/PowerManagement_1-2/module.h b/modules/PowerManagement_1-2/module.h
index 5123605..6861ade 100644
--- a/modules/PowerManagement_1-2/module.h
+++ b/modules/PowerManagement_1-2/module.h
@@ -322,114 +322,113 @@ extern ROMCONST apalControlGpio_t moduleGpioChargeEn2;
 /**
  * @brief   Event flag to be set on a IR_INT1 / CHARGE_STAT1A interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_IRINT1           AOS_IOEVENT_FLAG(PAL_PAD(LINE_IR_INT1_N))
+#define MODULE_OS_GPIOEVENTFLAG_IRINT1          AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IR_INT1_N))
 
 /**
  * @brief   Event flag to be set on a GAUGE_BATLOW1 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_GAUGEBATLOW1     AOS_IOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATLOW1))
+#define MODULE_OS_GPIOEVENTFLAG_GAUGEBATLOW1    AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATLOW1))
 
 /**
  * @brief   Event flag to be set on a GAUGE_BATGD1 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_GAUGEBATGD1      AOS_IOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATGD1_N))
+#define MODULE_OS_GPIOEVENTFLAG_GAUGEBATGD1     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATGD1_N))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_DN interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTDN       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
 
 /**
  * @brief   Event flag to be set on a IR_INT2 / CHARGE_STAT2A interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_IRINT2           AOS_IOEVENT_FLAG(PAL_PAD(LINE_IR_INT2_N))
+#define MODULE_OS_GPIOEVENTFLAG_IRINT2          AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IR_INT2_N))
 
 /**
  * @brief   Event flag to be set on a TOUCH_INT interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_TOUCHINT         AOS_IOEVENT_FLAG(PAL_PAD(LINE_TOUCH_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_TOUCHINT        AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_TOUCH_INT_N))
 
 /**
  * @brief   Event flag to be set on a GAUGE_BATLOW2 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_GAUGEBATLOW2     AOS_IOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATLOW2))
+#define MODULE_OS_GPIOEVENTFLAG_GAUGEBATLOW2    AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATLOW2))
 
 /**
  * @brief   Event flag to be set on a GAUGE_BATGD2 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_GAUGEBATGD2      AOS_IOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATGD2_N))
+#define MODULE_OS_GPIOEVENTFLAG_GAUGEBATGD2     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_GAUGE_BATGD2_N))
 
 /**
  * @brief   Event flag to be set on a PATH_DC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_PATHDC           AOS_IOEVENT_FLAG(PAL_PAD(LINE_PATH_DC))
+#define MODULE_OS_GPIOEVENTFLAG_PATHDC          AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_PATH_DC))
 
 /**
  * @brief   Event flag to be set on a SYS_SPI_DIR interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSSPIDIR        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_SPI_DIR))
+#define MODULE_OS_GPIOEVENTFLAG_SYSSPIDIR       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_SPI_DIR))
 
 /**
  * @brief   Event flag to be set on a SYS_SYNC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSSYNC         AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
 
 /**
  * @brief   Event flag to be set on a SYS_PD interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSPD           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
 
 /**
  * @brief   Event flag to be set on a SYS_WARMRST interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST       AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSWARMRST      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_UP interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTUP       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* IR_INT1 */                                                               \
-  palSetLineCallback(moduleGpioIrInt1.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioIrInt1.gpio->line);  \
+  palSetLineCallback(moduleGpioIrInt1.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioIrInt1.gpio->line);  \
   palEnableLineEvent(moduleGpioIrInt1.gpio->line, APAL2CH_EDGE(moduleGpioIrInt1.meta.edge));                  \
   /* GAUGE_BATLOW2 */                                                         \
-  palSetLineCallback(moduleGpioGaugeBatLow2.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioGaugeBatLow2.gpio->line);  \
+  palSetLineCallback(moduleGpioGaugeBatLow2.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioGaugeBatLow2.gpio->line);  \
   palEnableLineEvent(moduleGpioGaugeBatLow2.gpio->line, APAL2CH_EDGE(moduleGpioGaugeBatLow2.meta.edge));                  \
   /* GAUGE_BATGD2 */                                                          \
-  palSetLineCallback(moduleGpioGaugeBatGd2.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioGaugeBatGd2.gpio->line);  \
+  palSetLineCallback(moduleGpioGaugeBatGd2.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioGaugeBatGd2.gpio->line);  \
   palEnableLineEvent(moduleGpioGaugeBatGd2.gpio->line, APAL2CH_EDGE(moduleGpioGaugeBatGd2.meta.edge));                  \
   /* GAUGE_BATLOW1 */                                                         \
-  palSetLineCallback(moduleGpioGaugeBatLow1.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioGaugeBatLow1.gpio->line);  \
+  palSetLineCallback(moduleGpioGaugeBatLow1.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioGaugeBatLow1.gpio->line);  \
   palEnableLineEvent(moduleGpioGaugeBatLow1.gpio->line, APAL2CH_EDGE(moduleGpioGaugeBatLow1.meta.edge));                  \
   /* GAUGE_BATGD1 */                                                          \
-  palSetLineCallback(moduleGpioGaugeBatGd1.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioGaugeBatGd1.gpio->line);  \
+  palSetLineCallback(moduleGpioGaugeBatGd1.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioGaugeBatGd1.gpio->line);  \
   palEnableLineEvent(moduleGpioGaugeBatGd1.gpio->line, APAL2CH_EDGE(moduleGpioGaugeBatGd1.meta.edge));                  \
   /* IR_INT2 */                                                               \
-  palSetLineCallback(moduleGpioIrInt2.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioIrInt2.gpio->line);  \
+  palSetLineCallback(moduleGpioIrInt2.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioIrInt2.gpio->line);  \
   palEnableLineEvent(moduleGpioIrInt2.gpio->line, APAL2CH_EDGE(moduleGpioIrInt2.meta.edge));                  \
   /* TOUCH_INT */                                                             \
-  palSetLineCallback(moduleGpioTouchInt.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioTouchInt.gpio->line);  \
+  palSetLineCallback(moduleGpioTouchInt.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioTouchInt.gpio->line);  \
   palEnableLineEvent(moduleGpioTouchInt.gpio->line, APAL2CH_EDGE(moduleGpioTouchInt.meta.edge));                  \
   /* PATH_DC */                                                               \
-  palSetLineCallback(moduleGpioPathDc.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioPathDc.gpio->line);  \
+  palSetLineCallback(moduleGpioPathDc.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioPathDc.gpio->line);  \
   palEnableLineEvent(moduleGpioPathDc.gpio->line, APAL2CH_EDGE(moduleGpioPathDc.meta.edge));                  \
   /* SYS_SPI_DIR */                                                           \
-  palSetLineCallback(moduleGpioSysSpiDir.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysSpiDir.gpio->line);  \
+  palSetLineCallback(moduleGpioSysSpiDir.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysSpiDir.gpio->line);  \
   palEnableLineEvent(moduleGpioSysSpiDir.gpio->line, APAL2CH_EDGE(moduleGpioSysSpiDir.meta.edge));                  \
   /* SYS_WARMRST */                                                           \
-  palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysWarmrst.gpio->line);  \
+  palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysWarmrst.gpio->line);  \
   palEnableLineEvent(moduleGpioSysWarmrst.gpio->line, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge));                  \
 }
 
@@ -437,7 +436,7 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* add unit-test shell commands */                                          \
+  /* add test commands to shell */                                            \
   aosShellAddCommand(&aos.shell, &moduleTestAdcShellCmd);                     \
   aosShellAddCommand(&aos.shell, &moduleTestAt24c01bShellCmd);                \
   aosShellAddCommand(&aos.shell, &moduleTestBq241xxShellCmd);                 \
@@ -496,6 +495,8 @@ extern ROMCONST char* moduleShellPrompt;
   pwmStop(&MODULE_HAL_PWM_BUZZER);                                            \
   moduleHalPwmBuzzerConfig.period = moduleHalPwmBuzzerConfig.frequency / PKxxxExxx_LLD_FREQUENCY_SPEC; \
   pwmStart(&MODULE_HAL_PWM_BUZZER, &moduleHalPwmBuzzerConfig);                \
+  /* CAN */                                                                   \
+  canStart(&MODULE_HAL_CAN, &moduleHalCanConfig);                             \
 }
 #if (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR) || defined(__DOXYGEN__)
   #define MODULE_INIT_PERIPHERY_IF_SENSORRING() {                             \
@@ -525,6 +526,8 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* CAN */                                                                   \
+  canStop(&MODULE_HAL_CAN);                                                   \
   /* PWM */                                                                   \
   pwmStop(&MODULE_HAL_PWM_BUZZER);                                            \
   /* ADC */                                                                   \
@@ -544,45 +547,49 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   PD signal GPIO.
  */
-#define moduleSsspGpioPd                        moduleGpioSysPd
+#define moduleSsspGpioPD                        moduleGpioSysPd
 
 /**
- * @brief   SYNC signal GPIO.
+ * @brief   S signal GPIO.
  */
-#define moduleSsspGpioSync                       moduleGpioSysSync
+#define moduleSsspGpioS                         moduleGpioSysSync
 
 /**
  * @brief   DN signal GPIO.
  */
-#define moduleSsspGpioDn                        moduleGpioSysUartDn
+#define moduleSsspGpioDN                        moduleGpioSysUartDn
 
 /**
  * @brief   UP signal GPIO.
  */
-#define moduleSsspGpioUp                        moduleGpioSysUartUp
+#define moduleSsspGpioUP                        moduleGpioSysUartUp
 
 /**
- * @brief   Event flags for PD signal events.
+ * @brief   Event flag for PD signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_PD               MODULE_OS_IOEVENTFLAGS_SYSPD
+#define MODULE_SSSP_EVENTFLAG_PD                MODULE_OS_GPIOEVENTFLAG_SYSPD
 
 /**
- * @brief   Event flags for SYNC signal events.
+ * @brief   Event flag for S signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_SYNC             MODULE_OS_IOEVENTFLAGS_SYSSYNC
+#define MODULE_SSSP_EVENTFLAG_S                 MODULE_OS_GPIOEVENTFLAG_SYSSYNC
 
 /**
- * @brief   Event flags for UP signal events.
+ * @brief   Event flag for UP signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_UP               MODULE_OS_IOEVENTFLAGS_SYSUARTUP
+#define MODULE_SSSP_EVENTFLAG_UP                MODULE_OS_GPIOEVENTFLAG_SYSUARTUP
 
 /**
- * @brief   Event flags for DN signal events.
+ * @brief   Event flag for DN signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_DN               MODULE_OS_IOEVENTFLAGS_SYSUARTDN
+#define MODULE_SSSP_EVENTFLAG_DN                MODULE_OS_GPIOEVENTFLAG_SYSUARTDN
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/PowerManagement_1-2/test/AT42QT1050/module_test_AT42QT1050.c b/modules/PowerManagement_1-2/test/AT42QT1050/module_test_AT42QT1050.c
index 6c373f7..de77988 100644
--- a/modules/PowerManagement_1-2/test/AT42QT1050/module_test_AT42QT1050.c
+++ b/modules/PowerManagement_1-2/test/AT42QT1050/module_test_AT42QT1050.c
@@ -42,8 +42,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 static aos_test_at42qt1050data_t _data = {
   /* AT42QT1050 driver  */ &moduleLldTouch,
   /* timeout            */ MICROSECONDS_PER_SECOND,
-  /* event source       */ &aos.events.io,
-  /* event flags        */ MODULE_OS_IOEVENTFLAGS_TOUCHINT,
+  /* event source       */ &aos.events.gpio,
+  /* event flags        */ MODULE_OS_GPIOEVENTFLAG_TOUCHINT,
 };
 
 static AOS_TEST(_test, "AT42QT1050", "touch sensor", moduleTestAt42qt1050ShellCb, aosTestAt42qt1050Func, &_data);
diff --git a/modules/PowerManagement_1-2/test/MPR121/module_test_MPR121.c b/modules/PowerManagement_1-2/test/MPR121/module_test_MPR121.c
index f678f43..05e1480 100644
--- a/modules/PowerManagement_1-2/test/MPR121/module_test_MPR121.c
+++ b/modules/PowerManagement_1-2/test/MPR121/module_test_MPR121.c
@@ -42,8 +42,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 static aos_test_mpr121data_t _data= {
   /* MPR121 driver  */ &moduleLldTouch,
   /* timeout        */ MICROSECONDS_PER_SECOND,
-  /* event source   */ &aos.events.io,
-  /* event flags    */ MODULE_OS_IOEVENTFLAGS_TOUCHINT,
+  /* event source   */ &aos.events.gpio,
+  /* event flags    */ MODULE_OS_GPIOEVENTFLAG_TOUCHINT,
 };
 
 static AOS_TEST(_test, "MPR121", "touch sensor", moduleTestMpr121ShellCb, aosTestMpr121Func, &_data);
diff --git a/modules/PowerManagement_1-2/test/VCNL4020/module_test_VCNL4020.c b/modules/PowerManagement_1-2/test/VCNL4020/module_test_VCNL4020.c
index 913e762..62ffa2c 100644
--- a/modules/PowerManagement_1-2/test/VCNL4020/module_test_VCNL4020.c
+++ b/modules/PowerManagement_1-2/test/VCNL4020/module_test_VCNL4020.c
@@ -43,7 +43,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 static aos_test_vcnl4020data_t _data = {
   /* driver       */ NULL,
   /* timeout      */ MICROSECONDS_PER_SECOND,
-  /* event source */ &aos.events.io,
+  /* event source */ &aos.events.gpio,
   /* event flags  */ 0,
 };
 
@@ -107,7 +107,7 @@ int moduleTestVcnl4020ShellCb(BaseSequentialStream* stream, int argc, char* argv
       case WNW:
         mux = &moduleLldI2cMultiplexer1;
         _data.vcnld = &moduleLldProximity1;
-        _data.evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+        _data.evtflags = MODULE_OS_GPIOEVENTFLAG_IRINT2;
         break;
       case NNW:
       case NNE:
@@ -115,7 +115,7 @@ int moduleTestVcnl4020ShellCb(BaseSequentialStream* stream, int argc, char* argv
       case ESE:
         mux = &moduleLldI2cMultiplexer2;
         _data.vcnld = &moduleLldProximity2;
-        _data.evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+        _data.evtflags = MODULE_OS_GPIOEVENTFLAG_IRINT1;
         break;
       default:
         break;
diff --git a/modules/STM32F407G-DISC1/aosconf.h b/modules/STM32F407G-DISC1/aosconf.h
index 5d01756..96a38d0 100644
--- a/modules/STM32F407G-DISC1/aosconf.h
+++ b/modules/STM32F407G-DISC1/aosconf.h
@@ -33,7 +33,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _AMIRO_OS_CFG_
 #define AMIRO_OS_CFG_VERSION_MAJOR              2
-#define AMIRO_OS_CFG_VERSION_MINOR              0
+#define AMIRO_OS_CFG_VERSION_MINOR              1
 
 #include <stdbool.h>
 
@@ -80,14 +80,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_PROFILE) */
 
 /**
- * @brief   Mask for the control thread to listen to certain IO events.
+ * @brief   Mask for the control thread to listen to certain GPIO events.
  * @note    Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration.
  */
-#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK)
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    MODULE_OS_IOEVENTFLAGS_USERBUTTON
-#else /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
-  #define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK    OS_CFG_MAIN_LOOP_IOEVENT_MASK
-#endif /* !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) */
+#if !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK)
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK MODULE_OS_GPIOEVENTFLAG_USERBUTTON
+#else /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
+  #define AMIROOS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK
+#endif /* !defined(OS_CFG_MAIN_LOOP_GPIOEVENT_FLAGSMASK) */
 
 /**
  * @brief   Timeout value when waiting for events in the main loop in microseconds.
@@ -103,6 +103,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 /*===========================================================================*/
 /**
+ * @name Bootloader configuration
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Identifier of the instaled bootloader (if any).
+ * @note    See aos_bootloader.h file for a list of available settings.
+ */
+#define AMIROOS_CFG_BOOTLOADER                  AOS_BOOTLOADER_NONE
+
+/*===========================================================================*/
+/**
  * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
  * @{
  */
@@ -118,6 +131,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif /* !defined(OS_CFG_SSSP_ENABLE) */
 
 /**
+ * @brief   Flag to indicate, whether the SSSP startup sequence shall be executed by AMiRo-OS.
+ * @details This setting must be false in case another software (e.g. a bootloader) handles the initial stages of the SSSP startup phase.
+ */
+#if !defined(OS_CFG_SSSP_STARTUP)
+  #define AMIROOS_CFG_SSSP_STARTUP              false
+#else
+  #define AMIROOS_CFG_SSSP_STARTUP              OS_CFG_SSSP_STARTUP
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the SSSP shutdown sequence shall be executed by AMiRo-OS.
+ * @details This setting should be false in case another software (e.g. a bootloader) handles the final stages of the SSSP shutdown phase.
+ */
+#if !defined(OS_CFG_SSSP_SHUTDOWN)
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             false
+#else
+  #define AMIROOS_CFG_SSSP_SHUTDOWN             OS_CFG_SSSP_SHUTDOWN
+#endif
+
+/**
+ * @brief   Flag to indicate, whether the module stack initialization (MSI; stage 3 of the SSSP startup phase) shall be executed.
+ * @brief   In order to execute MSI, a broadcast bus (BCB) and according interfaces must be defined.
+ */
+#if !defined(OS_CFG_SSSP_MSI)
+  #define AMIROOS_CFG_SSSP_MSI                  false
+#else
+  #define AMIROOS_CFG_SSSP_MSI                  OS_CFG_SSSP_MSI
+#endif
+
+/**
+ * @brief   Width of the @p aos_sssp_moduleid_t type.
+ * @details Possible settings are 8, 16 and 32.
+ */
+#if !defined(OS_CFG_SSSP_MODULEIDWIDTH)
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        16
+#else
+  #define AMIROOS_CFG_SSSP_MODULEIDWIDTH        OS_CFG_SSSP_MODULEIDWIDTH
+#endif
+
+/**
  * @brief   Flag to set the module as SSSP master.
  * @details There must be only one module with this flag set to true in a system.
  */
diff --git a/modules/STM32F407G-DISC1/module.c b/modules/STM32F407G-DISC1/module.c
index 596d301..8949a9b 100644
--- a/modules/STM32F407G-DISC1/module.c
+++ b/modules/STM32F407G-DISC1/module.c
@@ -142,9 +142,9 @@ ROMCONST apalControlGpio_t moduleGpioUserButton = {
  */
 /*===========================================================================*/
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 ROMCONST char* moduleShellPrompt = "STM32F407Discovery";
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /** @} */
 
diff --git a/modules/STM32F407G-DISC1/module.h b/modules/STM32F407G-DISC1/module.h
index 82bfd5e..168719a 100644
--- a/modules/STM32F407G-DISC1/module.h
+++ b/modules/STM32F407G-DISC1/module.h
@@ -133,30 +133,29 @@ extern ROMCONST apalControlGpio_t moduleGpioUserButton;
 /**
  * @brief   Event flag to be set on a USER_BUTTON interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_USERBUTTON       AOS_IOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
+#define MODULE_OS_GPIOEVENTFLAG_USERBUTTON      AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* user button */                                                           \
-  palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioUserButton.gpio->line);  \
+  palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioUserButton.gpio->line);  \
   palEnableLineEvent(moduleGpioUserButton.gpio->line, APAL2CH_EDGE(moduleGpioUserButton.meta.edge));                  \
 }
 
 /**
- * @brief   Unit test initialization hook.
+ * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* add unit-test shell commands */                                          \
+  /* add test commands to shell */                                            \
 }
 
 /**
@@ -171,13 +170,14 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* don't stop the serial driver so messages can still be printed */         \
 }
 
 /**
  * @brief   HOOK to toggle the LEDs when the user button is pressed.
  */
-#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) {                               \
-  if (eventflags & MODULE_OS_IOEVENTFLAGS_USERBUTTON) {                       \
+#define MODULE_MAIN_LOOP_GPIOEVENT(eventflags) {                              \
+  if (eventflags & MODULE_OS_GPIOEVENTFLAG_USERBUTTON) {                      \
     apalControlGpioState_t buttonstate;                                       \
     apalControlGpioGet(&moduleGpioUserButton, &buttonstate);                  \
     apalControlGpioSet(&moduleGpioLedRed, buttonstate);                       \
@@ -196,6 +196,12 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
+// SSSP is not yet supported on this module
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
+
 /** @} */
 
 /*===========================================================================*/
diff --git a/modules/aos_chconf.h b/modules/aos_chconf.h
index 229750a..f7b039a 100644
--- a/modules/aos_chconf.h
+++ b/modules/aos_chconf.h
@@ -175,7 +175,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * @note    The default is @p TRUE.
  */
 #if !defined(CH_CFG_USE_REGISTRY)
-#define CH_CFG_USE_REGISTRY                 FALSE
+#define CH_CFG_USE_REGISTRY                 TRUE
 #endif
 
 /**
@@ -628,24 +628,30 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * @brief   System structure extension.
  * @details User fields added to the end of the @p ch_system_t structure.
  */
+#if !defined(CH_CFG_SYSTEM_EXTRA_FIELDS)
 #define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
   /* Add threads custom fields here.*/
+#endif
 
 /**
  * @brief   System initialization hook.
  * @details User initialization code added to the @p chSysInit() function
  *          just before interrupts are enabled globally.
  */
+#if !defined(CH_CFG_SYSTEM_INIT_HOOK)
 #define CH_CFG_SYSTEM_INIT_HOOK() {                                         \
   /* Add threads initialization code here.*/                                \
 }
+#endif
 
 /**
  * @brief   Threads descriptor structure extension.
  * @details User fields added to the end of the @p thread_t structure.
  */
+#if !defined(CH_CFG_THREAD_EXTRA_FIELDS)
 #define CH_CFG_THREAD_EXTRA_FIELDS                                          \
   /* Add threads custom fields here.*/
+#endif
 
 /**
  * @brief   Threads initialization hook.
@@ -654,39 +660,49 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * @note    It is invoked from within @p _thread_init() and implicitly from all
  *          the threads creation APIs.
  */
+#if !defined(CH_CFG_THREAD_INIT_HOOK)
 #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
   /* Add threads initialization code here.*/                                \
 }
+#endif
 
 /**
  * @brief   Threads finalization hook.
  * @details User finalization code added to the @p chThdExit() API.
  */
+#if !defined(CH_CFG_THREAD_EXIT_HOOK)
 #define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
   /* Add threads finalization code here.*/                                  \
 }
+#endif
 
 /**
  * @brief   Context switch hook.
  * @details This hook is invoked just before switching between threads.
  */
+#if !defined(CH_CFG_CONTEXT_SWITCH_HOOK)
 #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
   /* Context switch code here.*/                                            \
 }
+#endif
 
 /**
  * @brief   ISR enter hook.
  */
+#if !defined(CH_CFG_IRQ_PROLOGUE_HOOK)
 #define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
   /* IRQ prologue code here.*/                                              \
 }
+#endif
 
 /**
  * @brief   ISR exit hook.
  */
+#if !defined(CH_CFG_IRQ_EPILOGUE_HOOK)
 #define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
   /* IRQ epilogue code here.*/                                              \
 }
+#endif
 
 /**
  * @brief   Idle thread enter hook.
@@ -694,9 +710,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *          should be invoked from here.
  * @note    This macro can be used to activate a power saving mode.
  */
+#if !defined(CH_CFG_IDLE_ENTER_HOOK)
 #define CH_CFG_IDLE_ENTER_HOOK() {                                          \
   /* Idle-enter code here.*/                                                \
 }
+#endif
 
 /**
  * @brief   Idle thread leave hook.
@@ -704,44 +722,54 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *          should be invoked from here.
  * @note    This macro can be used to deactivate a power saving mode.
  */
+#if !defined(CH_CFG_IDLE_LEAVE_HOOK)
 #define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
   /* Idle-leave code here.*/                                                \
 }
+#endif
 
 /**
  * @brief   Idle Loop hook.
  * @details This hook is continuously invoked by the idle thread loop.
  */
+#if !defined(CH_CFG_IDLE_LOOP_HOOK)
 #define CH_CFG_IDLE_LOOP_HOOK() {                                           \
   /* Idle loop code here.*/                                                 \
 }
+#endif
 
 /**
  * @brief   System tick event hook.
  * @details This hook is invoked in the system tick handler immediately
  *          after processing the virtual timers queue.
  */
+#if !defined(CH_CFG_SYSTEM_TICK_HOOK)
 #define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
   /* System tick event code here.*/                                         \
 }
+#endif
 
 /**
  * @brief   System halt hook.
  * @details This hook is invoked in case to a system halting error before
  *          the system is halted.
  */
+#if !defined(CH_CFG_SYSTEM_HALT_HOOK)
 #define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
   /* System halt code here.*/                                               \
 }
+#endif
 
 /**
  * @brief   Trace hook.
  * @details This hook is invoked each time a new record is written in the
  *          trace buffer.
  */
+#if !defined(CH_CFG_TRACE_HOOK)
 #define CH_CFG_TRACE_HOOK(tep) {                                            \
   /* Trace code here.*/                                                     \
 }
+#endif
 
 /** @} */
 
