Index: firmware/App/Modes/Update.c =================================================================== diff -u -r1581e96d8d520cfa7ee7a27030a240ed0155c697 -r72831229355e23d75b0e48dbbf134cf0b3e77001 --- firmware/App/Modes/Update.c (.../Update.c) (revision 1581e96d8d520cfa7ee7a27030a240ed0155c697) +++ firmware/App/Modes/Update.c (.../Update.c) (revision 72831229355e23d75b0e48dbbf134cf0b3e77001) @@ -8,7 +8,7 @@ * @file Update.c * * @author (last) Dana Rich -* @date (last) 7-March-2023 +* @date (last) 25-April-2023 * * @author (original) Dana Rich * @date (original) 7-March-2023 @@ -41,35 +41,13 @@ /*********************************************************************//** * @brief - * Sets the flag in FLASH that indicates the devices requests to enter into - * update mode from the bootloader. - * @details Inputs: none - * @details Outputs: Memory location reflects desired status - * @return none - *************************************************************************/ -bool setBootloaderFlag( void ) -{ - register uint32_t src = (uint32_t)&g_pulUpdateSuccess[1]; - register uint32_t dst = APP_STATUS_ADDRESS; - unsigned int bytes = 16; - - Fapi_issueProgrammingCommand((uint32_t *)dst, - (uint8_t *)src, - (uint32_t) bytes, - 0, - 0, - Fapi_AutoEccGeneration); - - while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy); - - return (FAPI_GET_FSM_STATUS == Fapi_Status_Success); -} - -/*********************************************************************//** - * @brief * Sets the software reset bits [15-14] of the System Exception Control * Register. Setting bit 15, or clearing bit 14 will cause a system * software reset. + * + * This will leave the device in a state where the bootloader will not be + * left until the next power cycle or a command the start the main app + * is received by the bootloader. * @details Inputs: none * @details Outputs: RM46x reboots * @return none Index: firmware/App/Modes/Update.h =================================================================== diff -u -r329acf53eb90ccf47c5b3f68623b87ec38de5fda -r72831229355e23d75b0e48dbbf134cf0b3e77001 --- firmware/App/Modes/Update.h (.../Update.h) (revision 329acf53eb90ccf47c5b3f68623b87ec38de5fda) +++ firmware/App/Modes/Update.h (.../Update.h) (revision 72831229355e23d75b0e48dbbf134cf0b3e77001) @@ -19,7 +19,6 @@ #define __UPDATE_H__ void startBootloader( void ); -bool setBootloaderFlag( void ); void rebootSystemNow( void ); #endif /* __UPDATE_H__ */ Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r329acf53eb90ccf47c5b3f68623b87ec38de5fda -r72831229355e23d75b0e48dbbf134cf0b3e77001 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 329acf53eb90ccf47c5b3f68623b87ec38de5fda) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 72831229355e23d75b0e48dbbf134cf0b3e77001) @@ -1185,6 +1185,18 @@ handleSetHDServiceTime( message ); break; + case MSG_ID_HD_SET_ENTER_BOOTLOADER: + handleSetBootloaderRequest( message ); + break; + + case MSG_ID_HD_ENTER_BOOTLOADER_NOW: + handleEnterBootloaderNowRequest( message ); + break; + + case MSG_ID_HD_REBOOT_NOW: + handleRebootNowRequest( message ); + break; + // NOTE: this always must be the last case case MSG_ID_TESTER_LOGIN_REQUEST: handleTesterLogInRequest( message ); Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r329acf53eb90ccf47c5b3f68623b87ec38de5fda -r72831229355e23d75b0e48dbbf134cf0b3e77001 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 329acf53eb90ccf47c5b3f68623b87ec38de5fda) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 72831229355e23d75b0e48dbbf134cf0b3e77001) @@ -8095,11 +8095,8 @@ { BOOL result = FALSE; - // verify payload length - if ( 0 == message->hdr.payloadLen ) - { - result = setBootloaderFlag(); - } + // For now, there's no flag to set to stay in bootloader, + // this might change in the future, so leave message. // respond to request sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); @@ -8131,7 +8128,8 @@ /*********************************************************************//** * @brief * The handleEnterBootloaderNowRequest function handles a - * request immediately jump to the bootloader application. + * request to reboot the system. A software reset will cause the bootloader + * to stay active for XX seconds. * @details Inputs: none * @details Outputs: message handled * @param message : a pointer to the message to handle @@ -8147,7 +8145,7 @@ if (result) { // Jump to the bootloader, there is no coming back from this. - startBootloader(); + rebootSystemNow(); } }