commit 470d0567f56537191ddb8181fa79af3e110ade15
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Thu Apr 20 16:21:27 2017 +0200

    Renamed the interface header file (in ./Target/Source/AMiRo/) from 'interfaces.h' to 'amiroblt.h'.
    The interface was additionally modified:
    - The magic number for identification has been changed from 0xFF669900 to 0x0x412D424C ("A-BL"), making the interface incompatible to older versions.
    - Several macros have been replaced by enums.
    - Some structs and enums have been renamed, making the interface incompatible to version 0.3.
    The memory layout, however, is unchanged so that required operating system tweaks are minimal.

diff --git a/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/lib/STM32F10x_StdPeriph_Driver/stm32f10x_conf.h b/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/lib/STM32F10x_StdPeriph_Driver/stm32f10x_conf.h
index 55bd64b..ef51f31 100644
--- a/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/lib/STM32F10x_StdPeriph_Driver/stm32f10x_conf.h
+++ b/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/lib/STM32F10x_StdPeriph_Driver/stm32f10x_conf.h
@@ -38,7 +38,7 @@
 /*#include "stm32f10x_fsmc.h"*/
 #include "stm32f10x_gpio.h" /* needed for configuring the SPI and UART pins */
 /*#include "stm32f10x_i2c.h"*/
-/*#include "stm32f10x_iwdg.h"*/
+#include "stm32f10x_iwdg.h"
 #include "stm32f10x_pwr.h"
 #include "stm32f10x_rcc.h" /* needed for enabling the SPI and UART peripherals */
 #include "stm32f10x_rtc.h"
diff --git a/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/main.c b/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/main.c
index 9952e71..91ed292 100644
--- a/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/main.c
+++ b/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/main.c
@@ -23,11 +23,11 @@
 * You should have received a copy of the GNU General Public License along with OpenBLT.
 * If not, see <http://www.gnu.org/licenses/>.
 *
-* A special exception to the GPL is included to allow you to distribute a combined work 
-* that includes OpenBLT without being obliged to provide the source code for any 
+* A special exception to the GPL is included to allow you to distribute a combined work
+* that includes OpenBLT without being obliged to provide the source code for any
 * proprietary components. The exception text is included at the bottom of the license
 * file <license.html>.
-* 
+*
 * \endinternal
 ****************************************************************************************/
 
@@ -39,7 +39,7 @@
 #include "stm32f10x_conf.h"                      /* STM32 peripheral drivers           */
 #include "timer.h"
 #include "ARMCM3_STM32/types.h"
-#include "AMiRo/interfaces.h"
+#include "AMiRo/amiroblt.h"
 #include "AMiRo/helper.h"
 
 
@@ -157,7 +157,7 @@ void shutdownToDeepsleep(const blt_bool exec_disambiguation);
 void shutdownToHibernate(const blt_bool exec_disambiguation);
 void shutdownAndRestart(const blt_bool exec_disambiguation);
 
-volatile BlBackupRegister backup_reg;
+volatile blBackupRegister_t backup_reg;
 
 /****************************************************************************************
 * Callback configuration
@@ -168,11 +168,11 @@ void blCallbackShutdownHibernate(void);
 void blCallbackShutdownRestart(void);
 void blCallbackHandleShutdownRequest(void);
 
-const BlCallbackTable cbtable __attribute ((section ("_callback_table"))) = {
+const blCallbackTable_t cbtable __attribute__ ((section ("_callback_table"))) = {
   .magicNumber = BL_MAGIC_NUMBER,
-  .versionMajor = BL_VERSION_MAJOR,
-  .versionMinor = BL_VERSION_MINOR,
-  .versionHotfix = 0,
+  .vBootloader = {BL_VERSION_ID_AMiRoBLT_Release, BL_VERSION_MAJOR, BL_VERSION_MINOR, 0},
+  .vSSSP = {BL_VERSION_ID_SSSP, SSSP_VERSION_MAJOR, SSSP_VERSION_MINOR, 0},
+  .vCompiler = {BL_VERSION_ID_GCC, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__},  // currently only GCC is supported
   .cbShutdownHibernate = blCallbackShutdownHibernate,
   .cbShutdownDeepsleep = blCallbackShutdownDeepsleep,
   .cbShutdownTransportation = blCallbackShutdownTransportation,
@@ -189,7 +189,7 @@ const BlCallbackTable cbtable __attribute ((section ("_callback_table"))) = {
 
 
 /************************************************************************************//**
-** \brief     This is the entry point for the bootloader application and is called 
+** \brief     This is the entry point for the bootloader application and is called
 **            by the reset interrupt vector after the C-startup routines executed.
 ** \return    Program return code.
 **
@@ -276,7 +276,7 @@ int main(void)
 
 
 /************************************************************************************//**
-** \brief     Initializes the microcontroller. 
+** \brief     Initializes the microcontroller.
 ** \return    none.
 **
 ****************************************************************************************/
@@ -286,8 +286,8 @@ static void Init(void)
   blt_int32u pll_multiplier;
 #if (BOOT_FILE_LOGGING_ENABLE > 0) && (BOOT_COM_UART_ENABLE == 0)
   GPIO_InitTypeDef  GPIO_InitStruct;
-  USART_InitTypeDef USART_InitStruct;  
-#endif  
+  USART_InitTypeDef USART_InitStruct;
+#endif
 
   /* reset the RCC clock configuration to the default reset state (for debug purpose) */
   /* set HSION bit */
@@ -302,14 +302,14 @@ static void Init(void)
   RCC->CFGR &= (blt_int32u)0xFF80FFFF;
   /* disable all interrupts and clear pending bits  */
   RCC->CIR = 0x009F0000;
-  /* enable HSE */    
+  /* enable HSE */
   RCC->CR |= ((blt_int32u)RCC_CR_HSEON);
   /* wait till HSE is ready and if Time out is reached exit */
   do
   {
     HSEStatus = RCC->CR & RCC_CR_HSERDY;
-    StartUpCounter++;  
-  } 
+    StartUpCounter++;
+  }
   while((HSEStatus == 0) && (StartUpCounter != 1500));
   /* check if time out was reached */
   if ((RCC->CR & RCC_CR_HSERDY) == RESET)
@@ -323,10 +323,10 @@ static void Init(void)
   FLASH->ACR &= (blt_int32u)((blt_int32u)~FLASH_ACR_LATENCY);
 #if (BOOT_CPU_SYSTEM_SPEED_KHZ > 48000)
   /* configure 2 flash wait states */
-  FLASH->ACR |= (blt_int32u)FLASH_ACR_LATENCY_2;    
-#elif (BOOT_CPU_SYSTEM_SPEED_KHZ > 24000)  
+  FLASH->ACR |= (blt_int32u)FLASH_ACR_LATENCY_2;
+#elif (BOOT_CPU_SYSTEM_SPEED_KHZ > 24000)
   /* configure 1 flash wait states */
-  FLASH->ACR |= (blt_int32u)FLASH_ACR_LATENCY_1;    
+  FLASH->ACR |= (blt_int32u)FLASH_ACR_LATENCY_1;
 #endif
   /* HCLK = SYSCLK */
   RCC->CFGR |= (blt_int32u)RCC_CFGR_HPRE_DIV1;
@@ -354,7 +354,7 @@ static void Init(void)
   }
   /* select PLL as system clock source */
   RCC->CFGR &= (blt_int32u)((blt_int32u)~(RCC_CFGR_SW));
-  RCC->CFGR |= (blt_int32u)RCC_CFGR_SW_PLL;    
+  RCC->CFGR |= (blt_int32u)RCC_CFGR_SW_PLL;
   /* wait till PLL is used as system clock source */
   while ((RCC->CFGR & (blt_int32u)RCC_CFGR_SWS) != (blt_int32u)0x08)
   {
diff --git a/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/makefile b/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/makefile
index 3e82b9a..028f220 100644
--- a/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/makefile
+++ b/Target/Demo/ARMCM3_STM32F103_DiWheelDrive_GCC/Boot/makefile
@@ -120,7 +120,7 @@ main.c \
 ../../../Source/ARMCM3_STM32/flash.h \
 ../../../Source/ARMCM3_STM32/GCC/vectors.c \
 ../../../Source/ARMCM3_STM32/GCC/cstart.c \
-../../../Source/AMiRo/interfaces.h \
+../../../Source/AMiRo/amiroblt.h \
 ../../../Source/AMiRo/helper.h \
 ../../../Source/AMiRo/helper.c
 
diff --git a/Target/Demo/ARMCM3_STM32F103_LightRing_GCC/Boot/main.c b/Target/Demo/ARMCM3_STM32F103_LightRing_GCC/Boot/main.c
index 2be7b14..7189013 100644
--- a/Target/Demo/ARMCM3_STM32F103_LightRing_GCC/Boot/main.c
+++ b/Target/Demo/ARMCM3_STM32F103_LightRing_GCC/Boot/main.c
@@ -23,11 +23,11 @@
 * You should have received a copy of the GNU General Public License along with OpenBLT.
 * If not, see <http://www.gnu.org/licenses/>.
 *
-* A special exception to the GPL is included to allow you to distribute a combined work 
-* that includes OpenBLT without being obliged to provide the source code for any 
+* A special exception to the GPL is included to allow you to distribute a combined work
+* that includes OpenBLT without being obliged to provide the source code for any
 * proprietary components. The exception text is included at the bottom of the license
 * file <license.html>.
-* 
+*
 * \endinternal
 ****************************************************************************************/
 
@@ -39,7 +39,7 @@
 #include "stm32f10x_conf.h"                      /* STM32 peripheral drivers           */
 #include "timer.h"
 #include "ARMCM3_STM32/types.h"
-#include "AMiRo/interfaces.h"
+#include "AMiRo/amiroblt.h"
 #include "AMiRo/helper.h"
 
 
@@ -127,7 +127,7 @@ void shutdownToDeepsleep(const blt_bool exec_disambiguation);
 void shutdownToHibernate(const blt_bool exec_disambiguation);
 void shutdownAndRestart(const blt_bool exec_disambiguation);
 
-volatile BlBackupRegister backup_reg;
+volatile blBackupRegister_t backup_reg;
 
 /****************************************************************************************
 * Callback configuration
@@ -138,11 +138,11 @@ void blCallbackShutdownHibernate(void);
 void blCallbackShutdownRestart(void);
 void blCallbackHandleShutdownRequest(void);
 
-const BlCallbackTable cbtable __attribute__ ((section ("_callback_table"))) = {
+const blCallbackTable_t cbtable __attribute__ ((section ("_callback_table"))) = {
   .magicNumber = BL_MAGIC_NUMBER,
-  .versionMajor = BL_VERSION_MAJOR,
-  .versionMinor = BL_VERSION_MINOR,
-  .versionHotfix = 0,
+  .vBootloader = {BL_VERSION_ID_AMiRoBLT_Release, BL_VERSION_MAJOR, BL_VERSION_MINOR, 0},
+  .vSSSP = {BL_VERSION_ID_SSSP, SSSP_VERSION_MAJOR, SSSP_VERSION_MINOR, 0},
+  .vCompiler = {BL_VERSION_ID_GCC, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__},  // currently only GCC is supported
   .cbShutdownHibernate = blCallbackShutdownHibernate,
   .cbShutdownDeepsleep = blCallbackShutdownDeepsleep,
   .cbShutdownTransportation = blCallbackShutdownTransportation,
@@ -158,7 +158,7 @@ const BlCallbackTable cbtable __attribute__ ((section ("_callback_table"))) = {
 };
 
 /************************************************************************************//**
-** \brief     This is the entry point for the bootloader application and is called 
+** \brief     This is the entry point for the bootloader application and is called
 **            by the reset interrupt vector after the C-startup routines executed.
 ** \return    Program return code.
 **
@@ -219,7 +219,7 @@ int main(void)
 
 
 /************************************************************************************//**
-** \brief     Initializes the microcontroller. 
+** \brief     Initializes the microcontroller.
 ** \return    none.
 **
 ****************************************************************************************/
@@ -229,8 +229,8 @@ static void Init(void)
   blt_int32u pll_multiplier;
 #if (BOOT_FILE_LOGGING_ENABLE > 0) && (BOOT_COM_UART_ENABLE == 0) && (BOOT_GATE_UART_ENABLE == 0)
   GPIO_InitTypeDef  GPIO_InitStruct;
-  USART_InitTypeDef USART_InitStruct;  
-#endif  
+  USART_InitTypeDef USART_InitStruct;
+#endif
 
   /* reset the RCC clock configuration to the default reset state (for debug purpose) */
   /* set HSION bit */
@@ -245,14 +245,14 @@ static void Init(void)
   RCC->CFGR &= (blt_int32u)0xFF80FFFF;
   /* disable all interrupts and clear pending bits  */
   RCC->CIR = 0x009F0000;
-  /* enable HSE */    
+  /* enable HSE */
   RCC->CR |= ((blt_int32u)RCC_CR_HSEON);
   /* wait till HSE is ready and if Time out is reached exit */
   do
   {
     HSEStatus = RCC->CR & RCC_CR_HSERDY;
-    StartUpCounter++;  
-  } 
+    StartUpCounter++;
+  }
   while((HSEStatus == 0) && (StartUpCounter != 1500));
   /* check if time out was reached */
   if ((RCC->CR & RCC_CR_HSERDY) == RESET)
@@ -266,10 +266,10 @@ static void Init(void)
   FLASH->ACR &= (blt_int32u)((blt_int32u)~FLASH_ACR_LATENCY);
 #if (BOOT_CPU_SYSTEM_SPEED_KHZ > 48000)
   /* configure 2 flash wait states */
-  FLASH->ACR |= (blt_int32u)FLASH_ACR_LATENCY_2;    
-#elif (BOOT_CPU_SYSTEM_SPEED_KHZ > 24000)  
+  FLASH->ACR |= (blt_int32u)FLASH_ACR_LATENCY_2;
+#elif (BOOT_CPU_SYSTEM_SPEED_KHZ > 24000)
   /* configure 1 flash wait states */
-  FLASH->ACR |= (blt_int32u)FLASH_ACR_LATENCY_1;    
+  FLASH->ACR |= (blt_int32u)FLASH_ACR_LATENCY_1;
 #endif
   /* HCLK = SYSCLK */
   RCC->CFGR |= (blt_int32u)RCC_CFGR_HPRE_DIV1;
@@ -297,7 +297,7 @@ static void Init(void)
   }
   /* select PLL as system clock source */
   RCC->CFGR &= (blt_int32u)((blt_int32u)~(RCC_CFGR_SW));
-  RCC->CFGR |= (blt_int32u)RCC_CFGR_SW_PLL;    
+  RCC->CFGR |= (blt_int32u)RCC_CFGR_SW_PLL;
   /* wait till PLL is used as system clock source */
   while ((RCC->CFGR & (blt_int32u)RCC_CFGR_SWS) != (blt_int32u)0x08)
   {
@@ -365,7 +365,7 @@ static void Init(void)
   GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING;
   GPIO_InitStruct.GPIO_Pin = GPIO_Pin_3;
   GPIO_Init(GPIOA, &GPIO_InitStruct);
-  /* configure UART communcation parameters */  
+  /* configure UART communcation parameters */
   USART_InitStruct.USART_BaudRate = BOOT_COM_UART_BAUDRATE;
   USART_InitStruct.USART_WordLength = USART_WordLength_8b;
   USART_InitStruct.USART_StopBits = USART_StopBits_1;
diff --git a/Target/Demo/ARMCM3_STM32F103_LightRing_GCC/Boot/makefile b/Target/Demo/ARMCM3_STM32F103_LightRing_GCC/Boot/makefile
index 1db5309..27958a0 100644
--- a/Target/Demo/ARMCM3_STM32F103_LightRing_GCC/Boot/makefile
+++ b/Target/Demo/ARMCM3_STM32F103_LightRing_GCC/Boot/makefile
@@ -121,7 +121,7 @@ main.c \
 ../../../Source/ARMCM3_STM32/flash.h \
 ../../../Source/ARMCM3_STM32/GCC/vectors.c \
 ../../../Source/ARMCM3_STM32/GCC/cstart.c \
-../../../Source/AMiRo/interfaces.h \
+../../../Source/AMiRo/amiroblt.h \
 ../../../Source/AMiRo/helper.h \
 ../../../Source/AMiRo/helper.c
 
diff --git a/Target/Demo/ARMCM4_STM32F405_Power_Management_GCC/Boot/main.c b/Target/Demo/ARMCM4_STM32F405_Power_Management_GCC/Boot/main.c
index 46474f5..af10977 100644
--- a/Target/Demo/ARMCM4_STM32F405_Power_Management_GCC/Boot/main.c
+++ b/Target/Demo/ARMCM4_STM32F405_Power_Management_GCC/Boot/main.c
@@ -23,11 +23,11 @@
 * You should have received a copy of the GNU General Public License along with OpenBLT.
 * If not, see <http://www.gnu.org/licenses/>.
 *
-* A special exception to the GPL is included to allow you to distribute a combined work 
-* that includes OpenBLT without being obliged to provide the source code for any 
+* A special exception to the GPL is included to allow you to distribute a combined work
+* that includes OpenBLT without being obliged to provide the source code for any
 * proprietary components. The exception text is included at the bottom of the license
 * file <license.html>.
-* 
+*
 * \endinternal
 ****************************************************************************************/
 
@@ -39,7 +39,7 @@
 #include "stm32f4xx_conf.h"                      /* STM32 peripheral drivers           */
 #include "com.h"
 #include "ARMCM4_STM32/types.h"
-#include "AMiRo/interfaces.h"
+#include "AMiRo/amiroblt.h"
 #include "AMiRo/helper.h"
 
 /****************************************************************************************
@@ -180,7 +180,7 @@ void shutdownToDeepsleep();
 void shutdownToHibernate();
 void shutdownAndRestart();
 
-volatile BlBackupRegister backup_reg;
+volatile blBackupRegister_t backup_reg;
 
 /****************************************************************************************
 * Callback configuration
@@ -191,11 +191,11 @@ void blCallbackShutdownHibernate(void);
 void blCallbackShutdownRestart(void);
 void blCallbackHandleShutdownRequest(void);
 
-const BlCallbackTable cbtable __attribute__ ((section ("_callback_table"))) = {
+const blCallbackTable_t cbtable __attribute__ ((section ("_callback_table"))) = {
   .magicNumber = BL_MAGIC_NUMBER,
-  .versionMajor = BL_VERSION_MAJOR,
-  .versionMinor = BL_VERSION_MINOR,
-  .versionHotfix = 0,
+  .vBootloader = {BL_VERSION_ID_AMiRoBLT_Release, BL_VERSION_MAJOR, BL_VERSION_MINOR, 0},
+  .vSSSP = {BL_VERSION_ID_SSSP, SSSP_VERSION_MAJOR, SSSP_VERSION_MINOR, 0},
+  .vCompiler = {BL_VERSION_ID_GCC, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__},  // currently only GCC is supported
   .cbShutdownHibernate = blCallbackShutdownHibernate,
   .cbShutdownDeepsleep = blCallbackShutdownDeepsleep,
   .cbShutdownTransportation = blCallbackShutdownTransportation,
@@ -211,7 +211,7 @@ const BlCallbackTable cbtable __attribute__ ((section ("_callback_table"))) = {
 };
 
 /************************************************************************************//**
-** \brief     This is the entry point for the bootloader application and is called 
+** \brief     This is the entry point for the bootloader application and is called
 **            by the reset interrupt vector after the C-startup routines executed.
 ** \return    none.
 **
@@ -321,7 +321,7 @@ void main(void)
 
 
 /************************************************************************************//**
-** \brief     Initializes the microcontroller. 
+** \brief     Initializes the microcontroller.
 ** \return    none.
 **
 ****************************************************************************************/
@@ -334,7 +334,7 @@ static void Init(void)
   USART_InitTypeDef USART_InitStructure;
 #elif (BOOT_COM_CAN_ENABLE > 0 || BOOT_GATE_CAN_ENABLE > 0)
   GPIO_InitTypeDef  GPIO_InitStructure;
-#endif  
+#endif
 
   /* initialize the system and its clocks */
   SystemInit();
@@ -399,7 +399,7 @@ static void Init(void)
   RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
   /* select alternate function for the CAN pins */
   GPIO_PinAFConfig(GPIOA, GPIO_PinSource11, GPIO_AF_CAN1);
-  GPIO_PinAFConfig(GPIOA, GPIO_PinSource12, GPIO_AF_CAN1); 
+  GPIO_PinAFConfig(GPIOA, GPIO_PinSource12, GPIO_AF_CAN1);
   /* configure CAN RX and TX pins */
   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11;
   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
@@ -413,7 +413,7 @@ static void Init(void)
   GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
   GPIO_InitStructure.GPIO_PuPd  = GPIO_PuPd_NOPULL;
   GPIO_Init(GPIOA, &GPIO_InitStructure);
-#endif  
+#endif
 
 } /*** end of Init ***/
 
@@ -632,7 +632,7 @@ void shutdownToTransportation() {
   IWDG_ReloadCounter();
 
   /* write some information to the backup register */
-  BlBackupRegister backup;
+  blBackupRegister_t backup;
   backup.shutdown_pri_reason = BL_SHUTDOWN_PRI_RSN_TRANSPORT;
   backup.shutdown_sec_reason = BL_SHUTDOWN_SEC_RSN_UNKNOWN;
   backup.wakeup_pri_reason = BL_WAKEUP_PRI_RSN_UNKNOWN;
@@ -668,7 +668,7 @@ void shutdownToDeepsleep() {
    */
 
   /* write some information to the backup register */
-  BlBackupRegister backup;
+  blBackupRegister_t backup;
   backup.shutdown_pri_reason = BL_SHUTDOWN_PRI_RSN_DEEPSLEEP;
   backup.shutdown_sec_reason = BL_SHUTDOWN_SEC_RSN_UNKNOWN;
   backup.wakeup_pri_reason = BL_WAKEUP_PRI_RSN_UNKNOWN;
@@ -701,7 +701,7 @@ void shutdownToHibernate() {
   systemPowerDown();
 
   /* write some information to the backup register */
-  BlBackupRegister backup;
+  blBackupRegister_t backup;
   backup.shutdown_pri_reason = BL_SHUTDOWN_PRI_RSN_HIBERNATE;
   backup.shutdown_sec_reason = BL_SHUTDOWN_SEC_RSN_UNKNOWN;
   backup.wakeup_pri_reason = BL_WAKEUP_PRI_RSN_UNKNOWN;
@@ -730,7 +730,7 @@ void shutdownAndRestart() {
   systemPowerDown();
 
   /* write some information to the backup register */
-  BlBackupRegister backup;
+  blBackupRegister_t backup;
   backup.shutdown_pri_reason = BL_SHUTDOWN_PRI_RSN_RESTART;
   backup.shutdown_sec_reason = BL_SHUTDOWN_SEC_RSN_UNKNOWN;
   backup.wakeup_pri_reason = BL_WAKEUP_PRI_RSN_UNKNOWN;
diff --git a/Target/Demo/ARMCM4_STM32F405_Power_Management_GCC/Boot/makefile b/Target/Demo/ARMCM4_STM32F405_Power_Management_GCC/Boot/makefile
index cc3387b..b7b67e2 100644
--- a/Target/Demo/ARMCM4_STM32F405_Power_Management_GCC/Boot/makefile
+++ b/Target/Demo/ARMCM4_STM32F405_Power_Management_GCC/Boot/makefile
@@ -139,7 +139,7 @@ main.c \
 ../../../Source/ARMCM4_STM32/timer.h \
 ../../../Source/ARMCM4_STM32/GCC/vectors.c \
 ../../../Source/ARMCM4_STM32/GCC/cstart.c \
-../../../Source/AMiRo/interfaces.h \
+../../../Source/AMiRo/amiroblt.h \
 ../../../Source/AMiRo/helper.h \
 ../../../Source/AMiRo/helper.c
 
diff --git a/Target/Source/AMiRo/amiroblt.h b/Target/Source/AMiRo/amiroblt.h
new file mode 100644
index 0000000..2294fbd
--- /dev/null
+++ b/Target/Source/AMiRo/amiroblt.h
@@ -0,0 +1,357 @@
+/**
+ * @file    interfaces.h
+ * @brief   Interfaces to access and interpret information of the bootloader by an operating system.
+ *
+ * @addtogroup  AMiRo-BLT
+ * @details     Data structures and constants to interfere with the bootloader form an operating system.
+ * @{
+ */
+
+#ifndef _AMIROBLT_H_
+#define _AMIROBLT_H_
+
+#include <stdint.h>
+
+/*============================================================================*/
+/**
+ * @defgroup  AMiRo-BLT-IF AMiRo Bootloader Interface
+ * @details   This interface can be used to interface the AMiRo bootloader from an operating system.
+ *
+ * @{
+ */
+/*============================================================================*/
+
+/*============================================================================*/
+/**
+ * @name    Callback Table
+ * @details The callback table is a static struct, located in the MCUs flash memory (ROM) with offset @ref BL_CALLBACK_TABLE_OFFSET .
+ *          It contains version information and a bunch of callback function pointers.
+ */
+///@{
+
+/**
+ * @brief   The offset from the flash memory base address to where the @ref blCallbackTable_t struct is stored.
+ * @note    This offset must correspond with the @p _callback_table section in file @p memory.x of the bootloader.
+ */
+#define BL_CALLBACK_TABLE_OFFSET                  0x000001C0u
+
+/**
+ * @brief   The memory address where the @ref blCallbackTable_t struct is located in flash memory.
+ * @note    This adress must correspond with the @p _callback_table section in file @p memory.x of the bootloader.
+ * @deprecated  The @ref BL_CALLBACK_TABLE_OFFSET macro must be used for new software.
+ */
+#define BL_CALLBACK_TABLE_ADDRESS                 ((blCallbackTable_t*)(0x08000000u + BL_CALLBACK_TABLE_OFFSET))
+
+/**
+ * @brief   The major version number of the bootloader.
+ */
+#define BL_VERSION_MAJOR                          1
+
+/**
+ * @brief   The minor version number of the bootloader.
+ */
+#define BL_VERSION_MINOR                          0
+
+/**
+ * @brief   The major version number of the implemented SSSP (Startup & Shutdown Synchronization Protocol).
+ */
+#define SSSP_VERSION_MAJOR                        1
+
+/**
+ * @brief   The minor version number of the implemented SSSP (Startup & Shutdown Synchronization Protocol).
+ */
+#define SSSP_VERSION_MINOR                        1
+
+/**
+ * @brief   A struct to define a version in a generic way.
+ */
+struct blVersion_t {
+  const uint8_t identifier;   /**< The identifier can be used if the version can be ambiguous.  */
+  const uint8_t major;        /**< Major version number.                                        */
+  const uint8_t minor;        /**< Minor version number.                                        */
+  const uint8_t patch;        /**< Patch level number.                                          */
+} __attribute__((packed));
+
+/**
+ * @brief   Synonym for simplified access.
+ */
+typedef struct blVersion_t blVersion_t;
+
+/**
+ * @brief   An enum that defines possible values for the 'identifier' member of the @p blVersion_t struct.
+ * @note    The values must be in (unsigned) 8 bit integer range.
+ */
+enum blVersionIdentifier_t {
+  BL_VERSION_ID_UNKNOWN                   = 0x00u,  /**< Unknown identifier                                       */
+  BL_VERSION_ID_NA                        = 0xFFu,  /**< Identifier not applicable                                */
+  BL_VERSION_ID_AMiRoBLT_PreAlpha         = 0x01u,  /**< AMiRo-BLT pre-alpha identifier.                          */
+  BL_VERSION_ID_AMiRoBLT_Alpha            = 0x02u,  /**< AMiRo-BLT alpha version identifier.                      */
+  BL_VERSION_ID_AMiRoBLT_Beta             = 0x03u,  /**< AMiRo-BLT beta version identifier.                       */
+  BL_VERSION_ID_AMiRoBLT_ReleaseCandidate = 0x04u,  /**< AMiRo-BLT release candidate (RC) identifier.             */
+  BL_VERSION_ID_AMiRoBLT_Release          = 0x05u,  /**< AMiRo-BLT release version identifier.                    */
+  BL_VERSION_ID_SSSP                      = 0x01u,  /**< Startup & Shutdown Synchronization Protocol identifier.  */
+  BL_VERSION_ID_GCC                       = 0x01u,  /**< Gnu Compiler Collection identifier.                      */
+};
+
+/**
+ * @brief   A magic number to detect whether the callback table exists.
+ * @details The magic number can be interpreted as four character string "A-BL".
+ *          The according hexadecimal values are 0x41, 0x2D, 0x42, and 0x4C.
+ *          The according 32 bit integer is 0x412D424C.
+ */
+#define BL_MAGIC_NUMBER                           ((uint32_t)(('A'<<24) | ('-'<<16) | ('B'<<8) | ('L'<<0)))
+
+/**
+ * @brief   This struct contains information about the bootloader version and pointers to several callback function.
+ *          It is located at the constant address @ref BL_CALLBACK_TABLE_OFFSET in the flash memory.
+ * @note    Sicne the actual implementations of the callback functions are optional, the pointers must be checked not to be @p NULL before use!
+ */
+struct blCallbackTable_t {
+  const uint32_t magicNumber;                     /**< A magic number that can be used for sanity checks. @sa BL_MAGIC_NUMBER.            */
+  const blVersion_t vBootloader;                  /**< Version information about the bootloader.                                          */
+  const blVersion_t vSSSP;                        /**< Version information about the Startup & Shutdown Synchronization Protocol (SSSP).  */
+  const blVersion_t vCompiler;                    /**< Version information about the used compiler.                                       */
+  /**
+   * @brief   Callback function pointer to enter hibernate mode.
+   * @details In hibernate mode, the system enters maximum power-saving mode, but will wake up periodically in order to read some sensors.
+   */
+  void (*const cbShutdownHibernate)(void);
+  /**
+   * @brief   Callback function pointer to enter deepsleep mode.
+   * @details In deepsleep mode, the system enters maximum power-saving mode, but basic sensors (e.g. charging plug) can wake the system.
+   */
+  void (*const cbShutdownDeepsleep)(void);
+  /**
+   * @brief   Callback function pointer to enter transportation mode.
+   * @details In transportation mode, the system enters maximum power-saving mode and all wakeup signals are deactivated.
+   *          Thus, the only way to reactivate the system will be a hard reset.
+   */
+  void (*const cbShutdownTransportation)(void);   /**< Callback function pointer to enter transportation mode. */
+  /**
+   * @brief   Callback function pointer to restart the system.
+   */
+  void (*const cbShutdownRestart)(void);
+  /**
+   * @brief   Callback function pointer to handle a shutdown request from another module.
+   * @details Depending on the result of the disambiguation procedure, the module will enter the requested low-power mode.
+   */
+  void (*const cbHandleShutdownRequest)(void);
+  void (*const cb5)(void);                        /**< Reserved but currently unused callback function pointer. */
+  void (*const cb6)(void);                        /**< Reserved but currently unused callback function pointer. */
+  void (*const cb7)(void);                        /**< Reserved but currently unused callback function pointer. */
+  void (*const cb8)(void);                        /**< Reserved but currently unused callback function pointer. */
+  void (*const cb9)(void);                        /**< Reserved but currently unused callback function pointer. */
+  void (*const cb10)(void);                       /**< Reserved but currently unused callback function pointer. */
+  void (*const cb11)(void);                       /**< Reserved but currently unused callback function pointer. */
+} __attribute__((__packed__));
+
+/**
+ * @brief Synonym for simplified access.
+ */
+typedef struct blCallbackTable_t blCallbackTable_t;
+
+///@}
+/*============================================================================*/
+
+/*============================================================================*/
+/**
+ * @name    Backup Register
+ * @details For the STM32F4 MCU (PowerManagement), the backup register contains additional information about the last shutdown and wakeup of the system.
+ */
+///@{
+
+/**
+ * @brief   Number of the RTC backup register in which some persistent information is stored.
+ * @note    In the RTC section of the STM32F4 reference manual, the RTC backup registers are named @p RTC_BKPxR, where x is the register number.
+ */
+#define BL_RTC_BACKUP_REG                         0
+
+/**
+ * @brief   This union is used for interpretation of the content of the backup register.
+ */
+union blBackupRegister_t {
+  /**
+   * @brief The raw data of the register.
+   */
+  uint32_t raw;
+
+  /**
+   * @brief A struct to interpret the content of the register.
+   */
+  struct {
+    /**
+     * @brief The primary reason for the last system shutdown.
+     * @note  The content of this member is enum-like.
+     * @sa    BL_SHUTDOWN_PRI_RSN_UNKNOWN, BL_SHUTDOWN_PRI_RSN_HIBERNATE, BL_SHUTDOWN_PRI_RSN_DEEPSLEEP, BL_SHUTDOWN_PRI_RSN_TRANSPORT, BL_SHUTDOWN_PRI_RSN_RESTART
+     */
+    uint8_t shutdown_pri_reason;
+
+    /**
+     * @brief The secondary reason for the last system shutdown.
+     * @note  The content of this member is enum-like.
+     * @sa    BL_SHUTDOWN_SEC_RSN_UNKNOWN
+     */
+    uint8_t shutdown_sec_reason;
+
+    /**
+     * @brief The primary reason for the last system wakeup.
+     * @note  The content of this member is bitmask-like.
+     * @sa    BL_WAKEUP_PRI_RSN_UNKNOWN, BL_WAKEUP_PRI_RSN_LPWRRST, BL_WAKEUP_PRI_RSN_WWDGRST, BL_WAKEUP_PRI_RSN_IWDGRST, BL_WAKEUP_PRI_RSN_SFTRST, BL_WAKEUP_PRI_RSN_PORRST, BL_WAKEUP_PRI_RSN_PINRST, BL_WAKEUP_PRI_RSN_BORRST, BL_WAKEUP_PRI_RSN_WKUP
+     */
+    uint8_t wakeup_pri_reason;
+
+    /**
+     * @brief The secondary reason for the last system wakeup.
+     * @note  The content of this member is bitmask-like.
+     * @sa    BL_WAKEUP_SEC_RSN_UNKNOWN, BL_WAKEUP_SEC_RSN_UART, BL_WAKEUP_SEC_RSN_PWRPLUG, BL_WAKEUP_SEC_RSN_VSYSHIGH, BL_WAKEUP_SEC_RSN_VSYSLOW, BL_WAKEUP_SEC_RSN_TOUCH, BL_WAKEUP_SEC_RSN_ACCEL, BL_WAKEUP_SEC_RSN_RSVD
+     */
+    uint8_t wakeup_sec_reason;
+  } __attribute__((__packed__));
+};
+
+/**
+ * @brief   Synonym for simplified access.
+ */
+typedef union blBackupRegister_t blBackupRegister_t;
+
+/**
+ * @brief   An enum defining identifiers for possible reasons for system shutdown.
+ * @note    The values must be in (unsigned) 8 bit integer range.
+ */
+enum blShutdownReason_t {
+  /**
+   * @brief The reason was not set or the register was reset.
+   */
+  BL_SHUTDOWN_PRI_RSN_UNKNOWN   = 0x00u,
+
+  /**
+   * @brief The system was shut down to enter hibernate mode.
+   */
+  BL_SHUTDOWN_PRI_RSN_HIBERNATE = 0x01u,
+
+  /**
+   * @brief The system was shut down to enter deepsleep mode.
+   */
+  BL_SHUTDOWN_PRI_RSN_DEEPSLEEP = 0x02u,
+
+  /**
+   * @brief The system was shut down to enter transportation mode.
+   */
+  BL_SHUTDOWN_PRI_RSN_TRANSPORT = 0x03u,
+
+  /**
+   * @brief The system was shut down to restart.
+   */
+  BL_SHUTDOWN_PRI_RSN_RESTART   = 0x04u,
+
+  /**
+   * @brief   The default shutdown mode.
+   * @details This mode is used, if the shutdown sequence was triggered by another module than the PowerManagement.
+   */
+  BL_SHUTDOWN_PRI_RSN_DEFAULT   = BL_SHUTDOWN_PRI_RSN_DEEPSLEEP,
+
+  /**
+   * @brief The reason was not set or the regsiter was reset.
+   */
+  BL_SHUTDOWN_SEC_RSN_UNKNOWN   = 0x00u,
+};
+
+/**
+ * @brief   An enum defining identifiers for possible reasons for system wakeup.
+ * @note    The values must be in (unsigned) 8 bit integer range.
+ */
+enum blWakeupReason_t {
+  /**
+   * @brief The reason could not be determined.
+   */
+  BL_WAKEUP_PRI_RSN_UNKNOWN    = 0x00u,
+
+  /**
+   * @brief The system was reset because of the low-power management configuration.
+   */
+  BL_WAKEUP_PRI_RSN_LPWRRST    = 0x01u,
+
+  /**
+   * @brief The system was woken by the window watchdog.
+   */
+  BL_WAKEUP_PRI_RSN_WWDGRST    = 0x02u,
+
+  /**
+   * @brief The system was woken by the independant watchdog.
+   */
+  BL_WAKEUP_PRI_RSN_IWDGRST    = 0x04u,
+
+  /**
+   * @brief The system was reset by software.
+   */
+  BL_WAKEUP_PRI_RSN_SFTRST     = 0x08u,
+
+  /**
+   * @brief The system was woken by a power-on/power-down reset.
+   */
+  BL_WAKEUP_PRI_RSN_PORRST     = 0x10u,
+
+  /**
+   * @brief The system was reset via the NRST pin.
+   */
+  BL_WAKEUP_PRI_RSN_PINRST     = 0x20u,
+
+  /**
+   * @brief The system was woken by a power-on/power-down, or a brownout reset.
+   */
+  BL_WAKEUP_PRI_RSN_BORRST     = 0x40u,
+
+  /**
+   * @brief The system was woken via the WKUP pin.
+   */
+  BL_WAKEUP_PRI_RSN_WKUP       = 0x80u,
+
+  /**
+   * @brief The reason could not be determined.
+   */
+  BL_WAKEUP_SEC_RSN_UNKNOWN    = 0x00u,
+
+  /**
+   * @brief The WKUP pin was triggered by the UART signal.
+   */
+  BL_WAKEUP_SEC_RSN_UART       = 0x01u,
+
+  /**
+   * @brief The WKUP pin was triggered by plugging in a power plug.
+   */
+  BL_WAKEUP_SEC_RSN_PWRPLUG    = 0x02u,
+
+  /**
+   * @brief The internal ADC detected a system voltage higher than the configured threshold.
+   * @note  Usually the threshold is set to 9V.
+   */
+  BL_WAKEUP_SEC_RSN_VSYSHIGH   = 0x04u,
+
+  /**
+   * @brief The internal ADC detected a system voltage lower than the configured threshold.
+   */
+  BL_WAKEUP_SEC_RSN_VSYSLOW    = 0x08u,
+
+  /**
+   * @brief The WKUP pin was triggered by an interrupt from the touch sensors.
+   */
+  BL_WAKEUP_SEC_RSN_TOUCH      = 0x10u,
+
+  /**
+   * @brief The WKUP pin was triggered by an interrupt from the accelerometer.
+   */
+  BL_WAKEUP_SEC_RSN_ACCEL      = 0x20u,
+
+  /**
+   * @brief Reserved value that must not be used right now, but might become valid in a future version.
+   */
+  BL_WAKEUP_SEC_RSN_RSVD       = 0xC0u,
+};
+
+///@}
+
+/** @} */
+
+#endif // _AMIROBLT_H_
+
+/** @} */
diff --git a/Target/Source/AMiRo/interfaces.h b/Target/Source/AMiRo/interfaces.h
deleted file mode 100644
index 32d4fc9..0000000
--- a/Target/Source/AMiRo/interfaces.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/**
- * @file    interfaces.h
- * @brief   Interfaces to access and interpret information of the bootloader by an operating system.
- *
- * @addtogroup  AMiRo-BLT
- * @details     Data structures and constants to interfere with the bootloader form an operating system.
- * @{
- */
-
-#ifndef BL_INTERFACES_H
-#define BL_INTERFACES_H
-
-#include <stdint.h>
-
-/*===========================================================================*/
-/**
- * @defgroup  AMiRo-BLT-IF Bootloader Interface
- * @details   This interface can be used to interface the AMiRo bootloader from an operating system.
- *
- * @{
- */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/**
- * @name    Callback Table
- * @details The callback table is a static struct, located at address @ref BL_CALLBACK_TABLE_ADDRESS in the MCUs flash memory (ROM).
- *          It contains version information and a bunch of callback function pointers.
- */
-///@{
-
-/**
- * @brief   The memory address where the @ref BlCallbackTable struct is located in flash memory.
- * @note    This address must correspond with the @p _callback_table section in file @p memory.x of the bootloader.
- */
-#define BL_CALLBACK_TABLE_ADDRESS                 (uint32_t)(0x08000000u + 0x01C0u)
-
-/**
- * @brief   A magic number to detect whether the callback table exists.
- */
-#define BL_MAGIC_NUMBER                           ((uint32_t)0xFF669900u)
-
-/**
- * @brief   The major version number of the bootloader.
- */
-#define BL_VERSION_MAJOR                          0
-
-/**
- * @brief   The minor version number of the bootloader.
- */
-#define BL_VERSION_MINOR                          3
-
-/**
- * @brief   The major version number of the implemented SSSP (Startup & Synchronization Protocol).
- */
-#define SSSP_VERSION_MAJOR                        1
-
-/**
- * @brief   The minor version number of the implemented SSSP (Startup & Synchronization Protocol).
- */
-#define SSSP_VERSION_MINOR                        1
-
-/**
- * @brief   This struct contains information about the bootloader version and pointers to several callback function.
- *          It is located at the constant address @ref BL_CALLBACK_TABLE_ADDRESS in the flash memory.
- * @note    Sicne the actual implementations of the callback functions are optional, the pointers must be checked not to be @p NULL before use!
- */
-struct BlCallbackTable {
-  const uint32_t magicNumber;                     /**< A magic number that can be used for sanity checks. @sa BL_MAGIC_NUMBER */
-  const uint32_t versionMajor;                    /**< The major version number of the bootloader. @sa BL_VERSION_MAJOR */
-  const uint32_t versionMinor;                    /**< The minor version number of the bootloader. @sa BL_VERSION_MINOR */
-  const uint32_t versionHotfix;                   /**< The hotfix indicator of the bootloader. */
-  /**
-   * @brief   Callback function pointer to enter hibernate mode.
-   * @details In hibernate mode, the system enters maximum power-saving mode, but will wake up periodically in order to read some sensors.
-   */
-  void (*const cbShutdownHibernate)(void);
-  /**
-   * @brief   Callback function pointer to enter deepsleep mode.
-   * @details In deepsleep mode, the system enters maximum power-saving mode, but basic sensors (e.g. charging plug) can wake the system.
-   */
-  void (*const cbShutdownDeepsleep)(void);
-  /**
-   * @brief   Callback function pointer to enter transportation mode.
-   * @details In transportation mode, the system enters maximum power-saving mode and all wakeup signals are deactivated.
-   *          Thus, the only way to reactivate the system will be a hard reset.
-   */
-  void (*const cbShutdownTransportation)(void);   /**< Callback function pointer to enter transportation mode. */
-  /**
-   * @brief   Callback function pointer to restart the system.
-   */
-  void (*const cbShutdownRestart)(void);
-  /**
-   * @brief   Callback function pointer to handle a shutdown request from another module.
-   * @details Depending on the result of the disambiguation procedure, the module will enter the requested low-power mode.
-   */
-  void (*const cbHandleShutdownRequest)(void);
-  void (*const cb5)(void);                        /**< Reserved but currently unused callback function pointer. */
-  void (*const cb6)(void);                        /**< Reserved but currently unused callback function pointer. */
-  void (*const cb7)(void);                        /**< Reserved but currently unused callback function pointer. */
-  void (*const cb8)(void);                        /**< Reserved but currently unused callback function pointer. */
-  void (*const cb9)(void);                        /**< Reserved but currently unused callback function pointer. */
-  void (*const cb10)(void);                       /**< Reserved but currently unused callback function pointer. */
-  void (*const cb11)(void);                       /**< Reserved but currently unused callback function pointer. */
-};
-
-/**
- * @brief Synonym for simplified access.
- */
-typedef struct BlCallbackTable BlCallbackTable;
-
-///@}
-/*===========================================================================*/
-
-/*===========================================================================*/
-/**
- * @name    Backup Register
- * @details For the STM32F4 MCU (PowerManagement), the backup register contains additional information about the last shutdown and wakeup of the system.
- */
-///@{
-
-/**
- * @brief   Number of the RTC backup register in which some persistent information is stored.
- * @note    In the RTC section of the STM32F4 reference manual, the RTC backup registers are named @p RTC_BKPxR, where x is the register number.
- */
-#define BL_RTC_BACKUP_REG                         0
-
-/**
- * @brief   This union is used for interpretation of the content of the backup register.
- */
-union BlBackupRegister {
-  /**
-   * @brief The raw data of the register.
-   */
-  uint32_t raw;
-
-  /**
-   * @brief A struct to interpret the content of the register.
-   */
-  struct {
-    /**
-     * @brief The primary reason for the last system shutdown.
-     * @note  The content of this member is enum-like.
-     * @sa    BL_SHUTDOWN_PRI_RSN_UNKNOWN, BL_SHUTDOWN_PRI_RSN_HIBERNATE, BL_SHUTDOWN_PRI_RSN_DEEPSLEEP, BL_SHUTDOWN_PRI_RSN_TRANSPORT, BL_SHUTDOWN_PRI_RSN_RESTART
-     */
-    uint8_t shutdown_pri_reason;
-
-    /**
-     * @brief The secondary reason for the last system shutdown.
-     * @note  The content of this member is enum-like.
-     * @sa    BL_SHUTDOWN_SEC_RSN_UNKNOWN
-     */
-    uint8_t shutdown_sec_reason;
-
-    /**
-     * @brief The primary reason for the last system wakeup.
-     * @note  The content of this member is bitmask-like.
-     * @sa    BL_WAKEUP_PRI_RSN_UNKNOWN, BL_WAKEUP_PRI_RSN_LPWRRST, BL_WAKEUP_PRI_RSN_WWDGRST, BL_WAKEUP_PRI_RSN_IWDGRST, BL_WAKEUP_PRI_RSN_SFTRST, BL_WAKEUP_PRI_RSN_PORRST, BL_WAKEUP_PRI_RSN_PINRST, BL_WAKEUP_PRI_RSN_BORRST, BL_WAKEUP_PRI_RSN_WKUP
-     */
-    uint8_t wakeup_pri_reason;
-
-    /**
-     * @brief The secondary reason for the last system wakeup.
-     * @note  The content of this member is bitmask-like.
-     * @sa    BL_WAKEUP_SEC_RSN_UNKNOWN, BL_WAKEUP_SEC_RSN_UART, BL_WAKEUP_SEC_RSN_PWRPLUG, BL_WAKEUP_SEC_RSN_VSYSHIGH, BL_WAKEUP_SEC_RSN_VSYSLOW, BL_WAKEUP_SEC_RSN_TOUCH, BL_WAKEUP_SEC_RSN_ACCEL, BL_WAKEUP_SEC_RSN_RSVD
-     */
-    uint8_t wakeup_sec_reason;
-  };
-};
-typedef union BlBackupRegister BlBackupRegister;
-
-/**
- * @brief The reason was not set or the register was reset.
- */
-#define BL_SHUTDOWN_PRI_RSN_UNKNOWN               0x00u
-
-/**
- * @brief The system was shut down to enter hibernate mode.
- */
-#define BL_SHUTDOWN_PRI_RSN_HIBERNATE             0x01u
-
-/**
- * @brief The system was shut down to enter deepsleep mode.
- */
-#define BL_SHUTDOWN_PRI_RSN_DEEPSLEEP             0x02u
-
-/**
- * @brief The system was shut down to enter transportation mode.
- */
-#define BL_SHUTDOWN_PRI_RSN_TRANSPORT             0x03u
-
-/**
- * @brief The system was shut down to restart.
- */
-#define BL_SHUTDOWN_PRI_RSN_RESTART               0x04u
-
-/**
- * @brief   The default shutdown mode.
- * @details This mode is used, if the shutdown sequence was triggered by another module than the PowerManagement.
- */
-#define BL_SHUTDOWN_PRI_RSN_DEFAULT               BL_SHUTDOWN_PRI_RSN_DEEPSLEEP
-
-
-
-/**
- * @brief The reason was not set or the regsiter was reset.
- */
-#define BL_SHUTDOWN_SEC_RSN_UNKNOWN               0x00u
-
-
-
-/**
- * @brief The reason could not be determined.
- */
-#define BL_WAKEUP_PRI_RSN_UNKNOWN                 0x00u
-
-/**
- * @brief The system was reset because of the low-power management configuration.
- */
-#define BL_WAKEUP_PRI_RSN_LPWRRST                 0x01u
-
-/**
- * @brief The system was woken by the window watchdog.
- */
-#define BL_WAKEUP_PRI_RSN_WWDGRST                 0x02u
-
-/**
- * @brief The system was woken by the independant watchdog.
- */
-#define BL_WAKEUP_PRI_RSN_IWDGRST                 0x04u
-
-/**
- * @brief The system was reset by software.
- */
-#define BL_WAKEUP_PRI_RSN_SFTRST                  0x08u
-
-/**
- * @brief The system was woken by a power-on/power-down reset.
- */
-#define BL_WAKEUP_PRI_RSN_PORRST                  0x10u
-
-/**
- * @brief The system was reset via the NRST pin.
- */
-#define BL_WAKEUP_PRI_RSN_PINRST                  0x20u
-
-/**
- * @brief The system was woken by a power-on/power-down, or a brownout reset.
- */
-#define BL_WAKEUP_PRI_RSN_BORRST                  0x40u
-
-/**
- * @brief The system was woken via the WKUP pin.
- */
-#define BL_WAKEUP_PRI_RSN_WKUP                    0x80u
-
-
-
-/**
- * @brief The reason could not be determined.
- */
-#define BL_WAKEUP_SEC_RSN_UNKNOWN                 0x00u
-
-/**
- * @brief The WKUP pin was triggered by the UART signal.
- */
-#define BL_WAKEUP_SEC_RSN_UART                    0x01u
-
-/**
- * @brief The WKUP pin was triggered by plugging in a power plug.
- */
-#define BL_WAKEUP_SEC_RSN_PWRPLUG                 0x02u
-
-/**
- * @brief The internal ADC detected a system voltage higher than the configured threshold.
- * @note  Usually the threshold is set to 9V.
- */
-#define BL_WAKEUP_SEC_RSN_VSYSHIGH                0x04u
-
-/**
- * @brief The internal ADC detected a system voltage lower than the configured threshold.
- */
-#define BL_WAKEUP_SEC_RSN_VSYSLOW                 0x08u
-
-/**
- * @brief The WKUP pin was triggered by an interrupt from the touch sensors.
- */
-#define BL_WAKEUP_SEC_RSN_TOUCH                   0x10u
-
-/**
- * @brief The WKUP pin was triggered by an interrupt from the accelerometer.
- */
-#define BL_WAKEUP_SEC_RSN_ACCEL                   0x20u
-
-/**
- * @brief Reserved value that must not be used right now, but might become valid in a future version.
- */
-#define BL_WAKEUP_SEC_RSN_RSVD                    0xC0u
-
-///@}
-
-/** @} */
-
-#endif // BL_INTERFACES_H
-
-/** @} */
diff --git a/Target/Source/ARMCM3_STM32/can.c b/Target/Source/ARMCM3_STM32/can.c
index a5a5b4b..1dcafc6 100644
--- a/Target/Source/ARMCM3_STM32/can.c
+++ b/Target/Source/ARMCM3_STM32/can.c
@@ -379,9 +379,9 @@ blt_int8u CanReceivePacket(blt_int8u *data)
   blt_int8u  length = 0;
 
   static blt_int8u readData[BOOT_COM_RX_MAX_DATA];
-  static receivedLen = 0;
-  static lastLen = 0;
-  static toReceive = 0;
+  static blt_int8u receivedLen = 0;
+  static blt_int8u lastLen = 0;
+  static blt_int8u toReceive = 0;
   blt_int8u canData[8];
   blt_int8u restLen;
   blt_int8u canLength;
diff --git a/Target/Source/ARMCM4_STM32/can.c b/Target/Source/ARMCM4_STM32/can.c
index 5d3b812..1b9ea70 100644
--- a/Target/Source/ARMCM4_STM32/can.c
+++ b/Target/Source/ARMCM4_STM32/can.c
@@ -455,9 +455,9 @@ blt_int8u CanReceivePacket(blt_int8u *data)
   blt_int8u  length = 0;
 
   static blt_int8u readData[BOOT_COM_RX_MAX_DATA];
-  static receivedLen = 0;
-  static lastLen = 0;
-  static toReceive = 0;
+  static blt_int8u receivedLen = 0;
+  static blt_int8u lastLen = 0;
+  static blt_int8u toReceive = 0;
   blt_int8u canData[8];
   blt_int8u restLen;
   blt_int8u canLength;
diff --git a/Target/Source/com.h b/Target/Source/com.h
index 0a16c5f..d2abc7b 100644
--- a/Target/Source/com.h
+++ b/Target/Source/com.h
@@ -137,6 +137,7 @@ void            ComTransmitPacket(blt_int8u *data, blt_int16u len);
 blt_bool        ComIsConnected(void);
 #if (BOOTLOADER_OF_MAIN_DEVICE > 0)
 blt_bool        ComWasConnectedToMain(void);
+void            ComTransmitPacketDirect(blt_int8u *data, blt_int8u len);
 #endif /* BOOTLOADER_OF_MAIN_DEVICE > 0 */
 
 #endif /* BOOT_COM_ENABLE > 0 */
