Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -r2830e6300c40e331b274511fa9183937810cc190 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 2830e6300c40e331b274511fa9183937810cc190) @@ -15,6 +15,9 @@ * ***************************************************************************/ +#include "reg_crc.h" // Used to hold reset reason code at startup before bits get cleared +#include "reg_system.h" // Used to access exception status registers for reset reason code at startup + #include "Accel.h" #include "ConcentratePumps.h" #include "ConductivitySensors.h" @@ -344,8 +347,13 @@ // when the event data can be sent if ( ++startPOSTDelayCounter > START_POST_DELAY_COUNT ) { + U32 resetReason = systemREG1->SYSESR | crcREG->PSA_SIGREGL1; // power-on reset bit preserved in an unused CRC register + + systemREG1->SYSESR = systemREG1->SYSESR; // clear reset bit(s) after logging event so subsequent resets can be properly identified as not being power-on resets. + // Send the startup event - SEND_EVENT_WITH_2_U32_DATA( DG_EVENT_STARTUP, 0, 0 ) + SEND_EVENT_WITH_2_U32_DATA( DG_EVENT_STARTUP, systemREG1->DEV, 0x12345678 ) // log startup event w/ device ID bits + SEND_EVENT_WITH_2_U32_DATA( DG_EVENT_STARTUP, resetReason, systemREG1->GBLSTAT ) // log startup event w/ reset reason(s) bits // Send the first submode change event. It is the mode Init and it does not start from a previous // mode previous and current are both published as Init SEND_EVENT_WITH_2_U32_DATA( DG_EVENT_OP_MODE_CHANGE, DG_MODE_INIT, DG_MODE_INIT ) Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r2b6abbe347b2da260a4d46aca233bbfb6a59bf04 -r2830e6300c40e331b274511fa9183937810cc190 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 2b6abbe347b2da260a4d46aca233bbfb6a59bf04) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 2830e6300c40e331b274511fa9183937810cc190) @@ -15,7 +15,7 @@ * ***************************************************************************/ -#include // for memcpy() +#include // for memcpy() #include "reg_system.h" @@ -3761,33 +3761,6 @@ /*********************************************************************//** * @brief - * The handleResendAllAlarmsCommand function handles a request to re-send - * all active DG alarms. - * The sendUIServiceModeResponse function sends out the DG response to a - * UI request to go to service mode. - * @details Inputs: none - * @details Outputs: Service mode request response msg constructed and queued - * @param accepted TRUE if request was accepted, FALSE if not - * @param rejCode Reject reason code explaining why request was rejected - * @return none - *************************************************************************/ -void handleResendAllAlarmsCommand( MESSAGE_T *message ) -{ - BOOL result = FALSE; - - // verify payload length - if ( 0 == message->hdr.payloadLen ) - { - handleResendActiveAlarmsRequest(); - result = TRUE; - } - - // respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); -} - -/*********************************************************************//** - * @brief * The handleCpldStatusRequest function handles a CPLD Status request message. * @details Inputs: none * @details Outputs: message handled Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r2b6abbe347b2da260a4d46aca233bbfb6a59bf04 -r2830e6300c40e331b274511fa9183937810cc190 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 2b6abbe347b2da260a4d46aca233bbfb6a59bf04) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 2830e6300c40e331b274511fa9183937810cc190) @@ -403,9 +403,6 @@ // MSG_ID_HD_OP_MODE BOOL handleSetHDOperationMode( MESSAGE_T *message ); -// MSG_ID_HD_REQUEST_DG_ALARMS -void handleResendAllAlarmsCommand( MESSAGE_T *message ); - // MSG_ID_DG_DRAIN_PUMP_CURRENT_OVERRIDE void handleTestDrainPumpMeasuredCurrentOverride( MESSAGE_T *message ); Index: firmware/source/sys_startup.c =================================================================== diff -u -r3f3729899d6811c763bc8e5ef9baf54a2d5c9cfe -r2830e6300c40e331b274511fa9183937810cc190 --- firmware/source/sys_startup.c (.../sys_startup.c) (revision 3f3729899d6811c763bc8e5ef9baf54a2d5c9cfe) +++ firmware/source/sys_startup.c (.../sys_startup.c) (revision 2830e6300c40e331b274511fa9183937810cc190) @@ -64,6 +64,7 @@ #include "errata_SSWF021_45.h" /* USER CODE BEGIN (1) */ +#include "reg_crc.h" /* USER CODE END */ @@ -150,6 +151,7 @@ if ((SYS_EXCEPTION & POWERON_RESET) != 0U) { /* USER CODE BEGIN (12) */ + crcREG->PSA_SIGREGL1 = SYS_EXCEPTION; /* USER CODE END */ /* Add condition to check whether PLL can be started successfully */ if (_errata_SSWF021_45_both_plls(PLL_RETRIES) != 0U)