commit d54d2f07cf55f262267ac5bae4ff1549e315a0a6
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Fri Mar 16 11:43:09 2018 +0100

    Major overhaul (to version 1.1.0):
    - The bootloader toolchain now works with 32 bit device IDs (DiWheelDrive 1.1 = 0x01000101; PowerManagement 1.1 = 0x01010101; LightRing 1.0 = 0x017F0100).
      However, the system is still compatible to the old numbering scheme and legacy IDs for compatibility reasons.
      As a result, the new bootloader can be used with the old SerialBoot tool and vice versa.
    - In order to allow for 32 bit IDs, the CAN communication as modified.
      Packages which are larger than a single transmit are split into multiple CAN messages.
      An according handshaking mechanism (receiver acknowledges everey message) has been implemented.
      The device ID is not coded into the CAN message identifier anymore, but is transmitted as the first four bytes of the first CAN message of a XCP package transmission.
      However, the two lowermost bit of the CAN message identifier are now used as indicator flags for acknowledgment and subsequent transmission for simple filtering.
    - The bootloaders will not "double blink" the LED anymore, but indicate the XCP connection status.
    - The bootloader version has been incremented to 1.1.0.

diff --git a/Host/Source/SerialBoot/main.c b/Host/Source/SerialBoot/main.c
index a41964d..a05c4ff 100644
--- a/Host/Source/SerialBoot/main.c
+++ b/Host/Source/SerialBoot/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
 ****************************************************************************************/
 
@@ -42,6 +42,7 @@
 #include "xcpmaster.h"                                /* XCP master protocol module    */
 #include "srecord.h"                                  /* S-record file handling        */
 #include "timeutil.h"                                 /* time utility module           */
+#include "stdlib.h"                                   /* ascii to integral conversion  */
 
 
 /****************************************************************************************
@@ -95,28 +96,28 @@ static sb_int32 programCode(sb_file *hSrecord, tSrecordParseResults *fileParseRe
 * Local data declarations
 ****************************************************************************************/
 /** \brief Name of the serial device, such as COM4 or /dev/ttyUSB0. */
-static sb_char serialDeviceName[32]; 
+static sb_char serialDeviceName[32];
 
 /** \brief Id of the bluetooth device, such as 01:23:45:67:89:AB. */
-static sb_char bluetoothID[18]; 
+static sb_char bluetoothID[18];
 
 /** \brief Serial communication speed in bits per second. */
-static sb_uint32 serialBaudrate; 
+static sb_uint32 serialBaudrate;
 
 /** \brief Name of the S-record file. */
-static sb_char *srecordFileName; 
+static sb_char *srecordFileName;
 
 /* program status */
 static sb_uint8 prog_state = 1;
 
 /* id of flashing target */
-static sb_uint8 flashingTargetID = 0;
+static sb_uint32 flashingTargetID = 0;
 
 /* list of program names */
 static sb_char *srecordFileNames[MAX_COUNT_FLASHING_PROGRAMS];
 
 /* list of target ids */
-static sb_uint8 flashingTargetIDs[MAX_COUNT_FLASHING_PROGRAMS];
+static sb_uint32 flashingTargetIDs[MAX_COUNT_FLASHING_PROGRAMS];
 
 /* list of errors */
 static sb_uint8 errors[MAX_COUNT_FLASHING_PROGRAMS];
@@ -181,7 +182,8 @@ sb_int32 main(sb_int32 argc, sb_char *argv[])
     errorDetected = ERROR_NO;
     flashingTargetID = flashingTargetIDs[flashIdx];
     srecordFileName = srecordFileNames[flashIdx];
-    printf("\nFlash %i: Flashing %s on device %i\n\n", flashIdx+1, srecordFileName, flashingTargetID);
+    printf("\nFlash %i: Flashing %s on device 0x%08X\n\n", flashIdx+1, srecordFileName, flashingTargetID);
+
     if (flashProgram() == PROG_RESULT_ERROR) {
       closeSerialPort();
       openSerialPortConnect(0);
@@ -278,14 +280,14 @@ static void DisplayProgramInput(void) {
   printf("Programming will start immediately in following order:\n");
   sb_uint8 idx;
   for (idx=0; idx<countFlashingPrograms; idx++) {
-    printf("  %i) device %i: %s\n", idx+1, flashingTargetIDs[idx], srecordFileNames[idx]);
+    printf("  %i) device 0x%08X: %s\n", idx+1, flashingTargetIDs[idx], srecordFileNames[idx]);
   }
 }
 
 
 /************************************************************************************//**
 ** \brief     Parses the command line arguments. A fixed amount of arguments is expected.
-**            The program should be called as: 
+**            The program should be called as:
 **              SerialBoot -d[device] -b[baudrate] [s-record file]
 ** \param     argc Number of program parameters.
 ** \param     argv array to program parameter strings.
@@ -330,7 +332,7 @@ static sb_uint8 ParseCommandLine(sb_int32 argc, sb_char *argv[])
         printf("The bluetooth ID %s has not the format xx:xx:xx:xx:xx:xx\n", &argv[paramIdx][2]);
         return SB_FALSE;
       }
-      // copy the bluetooth id and set flag that this parameter was found 
+      // copy the bluetooth id and set flag that this parameter was found
       strcpy(serialDeviceName, &argv[paramIdx][2]);
       paramAfound = SB_TRUE;
       comIsUart = SB_FALSE;
@@ -359,7 +361,7 @@ static sb_uint8 ParseCommandLine(sb_int32 argc, sb_char *argv[])
       }
       if (registerRTSvalue > 1 || registerRTSvalue < 0 || setValue[1] != 0x0) {
         registerRTSvalue = 0;
-	printf("Not allowed value for RTS register. RTS=[0,1]\n");
+        printf("Not allowed value for RTS register. RTS=[0,1]\n");
         return SB_FALSE;
       }
       paramRTSfound = SB_TRUE;
@@ -414,7 +416,7 @@ static sb_uint8 ParseCommandLine(sb_int32 argc, sb_char *argv[])
       srecordfound = SB_TRUE;
     }
   }
-  
+
   /* verify if all parameters were found */
   if ( ( ((paramDfound == SB_FALSE) || (paramBfound == SB_FALSE)) && (paramAfound == SB_FALSE)) || (srecordfound == SB_FALSE) )
   {
@@ -445,7 +447,7 @@ static void printErrors(void) {
       printf("\n%i ERRORs detected!\nOnly in the following %i cases SerialBoot updated the firmware:\n", detected, countFlashingPrograms-detected);
       for (errorIdx=0; errorIdx<countFlashingPrograms; errorIdx++) {
         if (errors[errorIdx] == ERROR_NO) {
-          printf(" * Flash %i: %s on device %i\n", errorIdx+1, srecordFileNames[errorIdx], flashingTargetIDs[errorIdx]);
+          printf(" * Flash %i: %s on device 0x%08X\n", errorIdx+1, srecordFileNames[errorIdx], flashingTargetIDs[errorIdx]);
         }
       }
       printf("In the following %i cases SerialBoot could not update the firmware:\n", detected);
@@ -459,7 +461,7 @@ static void printErrors(void) {
           case ERROR_FILE:
             printf("The file %s couldn't be read!\n", srecordFileNames[errorIdx]); break;
           case ERROR_DEVICE:
-            printf("No connection to device %i!\n", flashingTargetIDs[errorIdx]); break;
+            printf("No connection to device 0x%08X!\n", flashingTargetIDs[errorIdx]); break;
           default:
             printf("Couldn't specify the error. Please check output above!\n"); break;
         }
@@ -504,12 +506,8 @@ static sb_int32 flashProgram(void) {
   tSrecordLineParseResults lineParseResults;
 
   /* -------------------- start the firmware update procedure ------------------------ */
-  printf("Starting firmware update for \"%s\" on device %i (0x", srecordFileName, flashingTargetID);
-  if (flashingTargetID < 16)
-  {
-    printf("0");
-  }
-  printf("%X)\nUsing %s @ %u bits/s\n", flashingTargetID, serialDeviceName, serialBaudrate);
+  printf("Starting firmware update for \"%s\" on device 0x%08X\n", srecordFileName, flashingTargetID);
+  printf("Using %s @ %u bits/s\n", serialDeviceName, serialBaudrate);
 
   /* -------------------- prepare programming session -------------------------------- */
   if (prepareProgrammingSession(&hSrecord, &fileParseResults) == PROG_RESULT_ERROR) {
@@ -707,11 +705,7 @@ static sb_int32 buildConnection(sb_uint8 start) {
     } else if (flashingTargetID == 0) {
       printf("Try to connect to device...");
     } else {
-      printf("Try to connect to device 0x");
-      if (flashingTargetID < 16) {
-        printf("0");
-      }
-      printf("%X...", flashingTargetID);
+      printf("Try to connect to device 0x%08X...", flashingTargetID);
     }
   }
   /* now keep retrying until we get a response */
