diff --git a/Host/BootCommander.exe b/Host/BootCommander.exe index 7e5f131b..8588fad9 100644 Binary files a/Host/BootCommander.exe and b/Host/BootCommander.exe differ diff --git a/Host/Source/BootCommander/main.c b/Host/Source/BootCommander/main.c index 2f4c71e9..dcd7ac0f 100644 --- a/Host/Source/BootCommander/main.c +++ b/Host/Source/BootCommander/main.c @@ -467,6 +467,8 @@ static void DisplayProgramUsage(void) printf(" -t7=[timeout] Busy wait timer timeout in milliseconds as a 16-bit\n"); printf(" value (Default = 2000 ms).\n"); printf(" -sk=[file] Seed/key algorithm library filename (Optional).\n"); + printf(" -cm=[value] Connection mode value sent in the XCP connect command,\n"); + printf(" as a 8-bit value (Default=0).\n"); printf("\n"); printf("XCP on RS232 settings (xcp_rs232):\n"); printf(" -d=[name] Name of the communication device. For example COM1 or\n"); @@ -563,6 +565,7 @@ static void DisplaySessionInfo(uint32_t sessionType, void const * sessionSetting { printf("None\n"); } + printf(" -> Connection mode: %hhu\n", xcpSettings->connectMode); } break; } @@ -832,7 +835,8 @@ static void * ExtractSessionSettingsFromCommandLine(int argc, char const * const * -t4=[timeout] -> Erase memory timeout in milliseconds. * -t5=[timeout] -> Program memory and reset timeout in milliseconds. * -t7=[timeout] -> Busy wait timer timeout in milliseconds. - * -sk=[file] -> Seed/key algorithm library filename. + * -sk=[file] -> Seed/key algorithm library filename. + * -cm=[value] -> Connection mode parameter in XCP connect command. */ /* Allocate memory for storing the settings and check the result. */ result = malloc(sizeof(tBltSessionSettingsXcpV10)); @@ -848,6 +852,7 @@ static void * ExtractSessionSettingsFromCommandLine(int argc, char const * const xcpSettings->timeoutT5 = 1000; xcpSettings->timeoutT7 = 2000; xcpSettings->seedKeyFile = NULL; + xcpSettings->connectMode = 0; /* Loop through all the command line parameters, just skip the 1st one because * this is the name of the program, which we are not interested in. */ @@ -907,6 +912,15 @@ static void * ExtractSessionSettingsFromCommandLine(int argc, char const * const /* Continue with next loop iteration. */ continue; } + /* Is this the -cm=[value] parameter? */ + if ( (strstr(argv[paramIdx], "-cm=") != NULL) && + (strlen(argv[paramIdx]) > 4) ) + { + /* Extract the connection mode value. */ + sscanf(&argv[paramIdx][4], "%hhu", &(xcpSettings->connectMode)); + /* Continue with next loop iteration. */ + continue; + } } } break; diff --git a/Host/Source/LibOpenBLT/openblt.c b/Host/Source/LibOpenBLT/openblt.c index 8c05737c..1b7304df 100644 --- a/Host/Source/LibOpenBLT/openblt.c +++ b/Host/Source/LibOpenBLT/openblt.c @@ -137,6 +137,7 @@ LIBOPENBLT_EXPORT void BltSessionInit(uint32_t sessionType, xcpLoaderSettings.timeoutT4 = bltSessionSettingsXcpV10Ptr->timeoutT4; xcpLoaderSettings.timeoutT5 = bltSessionSettingsXcpV10Ptr->timeoutT5; xcpLoaderSettings.timeoutT7 = bltSessionSettingsXcpV10Ptr->timeoutT7; + xcpLoaderSettings.connectMode = bltSessionSettingsXcpV10Ptr->connectMode; xcpLoaderSettings.transport = NULL; xcpLoaderSettings.transportSettings = NULL; /* Link the correct transport layer. */ diff --git a/Host/Source/LibOpenBLT/openblt.h b/Host/Source/LibOpenBLT/openblt.h index dba3bdad..f3aacada 100644 --- a/Host/Source/LibOpenBLT/openblt.h +++ b/Host/Source/LibOpenBLT/openblt.h @@ -116,6 +116,7 @@ typedef struct t_blt_session_settings_xcp_v10 uint16_t timeoutT5; /**< Program memory and reset timeout in milliseonds. */ uint16_t timeoutT7; /**< Busy wait timer timeout in milliseonds. */ char const * seedKeyFile; /**< Seed/key algorithm library filename. */ + uint8_t connectMode; /**< Connection mode parameter in XCP connect command.*/ } tBltSessionSettingsXcpV10; /** \brief Structure layout of the XCP version 1.0 RS232 transport layer settings. The diff --git a/Host/Source/LibOpenBLT/openblt.pas b/Host/Source/LibOpenBLT/openblt.pas index f21073f9..32ec8f32 100644 --- a/Host/Source/LibOpenBLT/openblt.pas +++ b/Host/Source/LibOpenBLT/openblt.pas @@ -82,7 +82,8 @@ type timeoutT4: Word; // Erase memory timeout in milliseonds. timeoutT5: Word; // Program memory and reset timeout in milliseonds. timeoutT7: Word; // Busy wait timer timeout in milliseonds. - seedKeyFile: PAnsiChar; // Seed/key algorithm library filename. + seedKeyFile: PAnsiChar; // Seed/key algorithm library filename. + connectMode: Byte; // Connection mode parameter in XCP connect command. end; // Structure layout of the XCP version 1.0 RS232 transport layer settings. diff --git a/Host/Source/LibOpenBLT/xcploader.c b/Host/Source/LibOpenBLT/xcploader.c index f6ef9020..baa84ac6 100644 --- a/Host/Source/LibOpenBLT/xcploader.c +++ b/Host/Source/LibOpenBLT/xcploader.c @@ -529,7 +529,7 @@ static bool XcpLoaderSendCmdConnect(void) result = true; /* Prepare the command packet. */ cmdPacket.data[0] = XCPLOADER_CMD_CONNECT; - cmdPacket.data[1] = 0; /* normal mode */ + cmdPacket.data[1] = xcpSettings.connectMode; cmdPacket.len = 2; /* Send the packet. */ if (!xcpSettings.transport->SendPacket(&cmdPacket, &resPacket, diff --git a/Host/Source/LibOpenBLT/xcploader.h b/Host/Source/LibOpenBLT/xcploader.h index 503c32b0..84b60907 100644 --- a/Host/Source/LibOpenBLT/xcploader.h +++ b/Host/Source/LibOpenBLT/xcploader.h @@ -91,7 +91,9 @@ typedef struct t_xcp_loader_settings /** \brief Program memory and reset timeout in milliseonds. */ uint16_t timeoutT5; /** \brief Busy wait timer timeout in milliseonds. */ - uint16_t timeoutT7; + uint16_t timeoutT7; + /** \brief Connection mode used in the XCP connect command. */ + uint8_t connectMode; /** \brief Pointer to the transport layer to use during protocol communications. */ tXcpTransport const * transport; /** \brief Pointer to the settings for the transport layer. */ diff --git a/Host/libopenblt.dll b/Host/libopenblt.dll index b85a6b51..0de04829 100644 Binary files a/Host/libopenblt.dll and b/Host/libopenblt.dll differ