Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -r8b0c842f94e3c94cecf62f0f913e429def8e5efa -r195f895cd5f580b448db5a251ab7a7f40ba0f40f --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 8b0c842f94e3c94cecf62f0f913e429def8e5efa) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 195f895cd5f580b448db5a251ab7a7f40ba0f40f) @@ -333,7 +333,7 @@ // Check if the primary heaters' internal temperature is above the limit if ( primaryHeatersInternalTemp > HEATERS_MAX_ALLOWED_INTERNAL_TEMPERATURE_C ) { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_PRIMARY_HEATERS_INTERNAL_TEMP_OUT_OF_RANGE, primaryHeatersInternalTemp ); + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_PRIMARY_HEATER_INTERNAL_TEMP_OUT_OF_RANGE, primaryHeatersInternalTemp ); // If it is above the range for the first time, stop the primary heaters // and set the variables Index: firmware/App/DGCommon.h =================================================================== diff -u -r9cfc69328f6b54a6b8e3737dfa24db607105cdd9 -r195f895cd5f580b448db5a251ab7a7f40ba0f40f --- firmware/App/DGCommon.h (.../DGCommon.h) (revision 9cfc69328f6b54a6b8e3737dfa24db607105cdd9) +++ firmware/App/DGCommon.h (.../DGCommon.h) (revision 195f895cd5f580b448db5a251ab7a7f40ba0f40f) @@ -52,7 +52,7 @@ // #define DISABLE_RO_RATIO_CHECK 1 #define DISABLE_COND_SENSOR_CHECK 1 #define DISABLE_MIXING 1 - #define DISABLE_WATER_QUALITY_CHECK 1 +// #define DISABLE_WATER_QUALITY_CHECK 1 #define DISABLE_RTC_CONFIG 1 //#define V_2_SYSTEM 1 #define THD_USING_TRO_CONNECTOR 1 Index: firmware/App/Modes/ModeRecirculate.c =================================================================== diff -u -r9cfc69328f6b54a6b8e3737dfa24db607105cdd9 -r195f895cd5f580b448db5a251ab7a7f40ba0f40f --- firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision 9cfc69328f6b54a6b8e3737dfa24db607105cdd9) +++ firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision 195f895cd5f580b448db5a251ab7a7f40ba0f40f) @@ -107,7 +107,7 @@ // NOTE: The target flow rate should be set prior to setting the start primary heater // because the initial guess in the heaters driver needs the target flow to calculate // the new PWMs for the main and small primary heaters - setROPumpTargetFlowRate( TARGET_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); + setROPumpTargetFlowRate( TARGET_FLUSH_LINES_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); startPrimaryHeater(); #ifndef _VECTORCAST_ Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -r8467f8ff09e382e0991f14d02683080dc811e24e -r195f895cd5f580b448db5a251ab7a7f40ba0f40f --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 8467f8ff09e382e0991f14d02683080dc811e24e) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 195f895cd5f580b448db5a251ab7a7f40ba0f40f) @@ -29,9 +29,6 @@ #include "TaskPriority.h" #include "TaskTimer.h" #include "Utilities.h" -#ifdef DEBUG_ENABLED - #include "SystemCommMessages.h" -#endif /** * @addtogroup Interrupts @@ -45,10 +42,6 @@ // ********** private data ********** -static U32 sci2FrameErrorCnt; ///< SCI2 frame error count. -static U32 sci2OverrunErrorCnt; ///< SCI2 overrun error count. - -static U32 can1PassiveCnt; ///< CAN1 passive count. static U32 can1WarningCnt; ///< CAN1 warning count. static U32 can1BusOffCnt; ///< CAN1 bus offline count. static U32 can1ParityCnt; ///< CAN1 parity count. @@ -62,15 +55,11 @@ *************************************************************************/ void initInterrupts( void ) { - sci2FrameErrorCnt = 0; - sci2OverrunErrorCnt = 0; - can1PassiveCnt = 0; can1WarningCnt = 0; can1BusOffCnt = 0; can1ParityCnt = 0; // initialize various time windowed counts for monitoring CAN & UART errors and warnings - initTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_PASSIVE, MAX_COMM_ERRORS, COMM_ERROR_TIME_WINDOW_MS ); initTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_OFF, MAX_COMM_ERRORS, COMM_ERROR_TIME_WINDOW_MS ); initTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_PARITY, MAX_COMM_ERRORS, COMM_ERROR_TIME_WINDOW_MS ); initTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_UART_FRAME_ERROR, MAX_COMM_ERRORS, COMM_ERROR_TIME_WINDOW_MS ); @@ -87,15 +76,6 @@ void phantomInterrupt( void ) { // TODO - what to do with phantom interrupts? -#ifdef DEBUG_ENABLED - { - char debugStr[ 50 ]; - - strcpy( debugStr, "DG-phantom interrupt\n" ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); - } -#endif } /*********************************************************************//** @@ -166,6 +146,7 @@ { if ( node == canREG1 ) { + // Parity error - message RAM is corrupted if ( notification & canLEVEL_PARITY_ERR ) { can1ParityCnt++; @@ -174,6 +155,7 @@ SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_CAN_PARITY_ERROR ) } } + // Bus off - our transmitter has counted 255+ errors else if ( notification & canLEVEL_BUS_OFF ) { can1BusOffCnt++; @@ -182,62 +164,20 @@ SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_CAN_OFF_ERROR ) } } + // Warning - our transmitter has counted 96+ errors else if ( notification & canLEVEL_WARNING ) { can1WarningCnt++; } - else if ( notification & canLEVEL_PASSIVE ) - { - can1PassiveCnt++; - if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_PASSIVE ) ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_CAN_PASSIVE_WARNING ) - } - } else { - // ignore - other notifications undefined + // Ignore - other notifications - unhandled } } } /*********************************************************************//** * @brief - * The sciNotification function handles UART communication error interrupts. - * Frame and Over-run errors are handled. - * @details Inputs: none - * @details Outputs: UART error interrupts handled. - * @param sci pointer to the SCI peripheral that detected the error - * @param flags error flag(s) - * @return none - *************************************************************************/ -void sciNotification(sciBASE_t *sci, uint32 flags) -{ - if ( sci == scilinREG ) - { - if ( ( flags & SCI_FE_INT ) != 0 ) - { - sci2FrameErrorCnt++; - clearSCI2CommErrors(); - if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_UART_FRAME_ERROR ) ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_UART_FRAME_ERROR ) - } - } - if ( ( flags & SCI_OE_INT ) != 0 ) - { - sci2OverrunErrorCnt++; - clearSCI2CommErrors(); - if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_UART_OVERRUN ) ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_UART_OVERRUN_ERROR ) - } - } - } -} - -/*********************************************************************//** - * @brief * The dmaGroupANotification function handles communication DMA interrupts. * @details Inputs: none * @details Outputs: DMA interrupt is handled. Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r2fff37fa585181917705645494549b5fd4a4d522 -r195f895cd5f580b448db5a251ab7a7f40ba0f40f --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 2fff37fa585181917705645494549b5fd4a4d522) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 195f895cd5f580b448db5a251ab7a7f40ba0f40f) @@ -249,14 +249,6 @@ { canTransmit( canREG1, lastCANPacketSentChannel, lastCANPacketSent ); } -#ifdef DEBUG_ENABLED - { - char debugStr[100]; - strcpy( debugStr, "SystemComm-DG resend Last Frame.\n" ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); - } -#endif } // we must be only node on CAN bus - nobody is ACKing our transmitted frames else @@ -265,11 +257,6 @@ canXmitRetryCtr = MAX_XMIT_RETRIES; signalCANXmitsCompleted(); // clear pending xmit flag clearCANXmitBuffers(); // clear xmit buffers - nothing is going out right now -#ifdef DEBUG_ENABLED - char debugStr[100]; - strcpy( debugStr, "SystemComm-DG is only node.\n" ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); -#endif } // end - are we retrying xmit or are we alone on CAN bus } // end - pending xmit timeout? } // end - transmit in progress or not @@ -857,14 +844,6 @@ { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_COMM_TOO_MANY_BAD_CRCS, 2 ); // 2 for DG } -#ifdef DEBUG_ENABLED - { - char debugStr[100]; - - strcpy( debugStr, "SystemComm-DG-Bad Msg CRC.\n" ); - sendDebugDataToUI( (U08*)debugStr ); - } -#endif } /*********************************************************************//** @@ -1053,6 +1032,10 @@ handleUIClockSyncRequest( message ); break; + case MSG_ID_HD_DG_POST_RESULT_REQUEST: + handleDGPOSTResultRequest( message ); + break; + // NOTE: This case must be last case MSG_ID_DG_TESTER_LOGIN_REQUEST: handleTesterLogInRequest( message ); Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r2fff37fa585181917705645494549b5fd4a4d522 -r195f895cd5f580b448db5a251ab7a7f40ba0f40f --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 2fff37fa585181917705645494549b5fd4a4d522) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 195f895cd5f580b448db5a251ab7a7f40ba0f40f) @@ -3096,6 +3096,40 @@ /*********************************************************************//** * @brief +* The handleDGPOSTResultRequest function handles a request to report DG +* POST results. +* @details Inputs: none +* @details Outputs: message handled +* @param message a pointer to the message to handle +* @return none +*************************************************************************/ +void handleDGPOSTResultRequest( MESSAGE_T *message ) +{ + BOOL status = FALSE; + BOOL result = FALSE; + U08* payloadPtr = message->payload; + + if ( 0 == message->hdr.payloadLen ) + { + if ( TRUE == isPOSTCompleted() ) + { + status = TRUE; + if ( TRUE == isPOSTPassed() ) + { + result = TRUE; + } + sendPOSTFinalResult( result ); + } + } + // If can't respond to request, NAK the message + if ( status != TRUE ) + { + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, status ); + } +} + +/*********************************************************************//** +* @brief * The handleSetDGCalibrationRecord function handles a request to set the DG * calibration data record. * @details Inputs: none Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r2fff37fa585181917705645494549b5fd4a4d522 -r195f895cd5f580b448db5a251ab7a7f40ba0f40f --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 2fff37fa585181917705645494549b5fd4a4d522) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 195f895cd5f580b448db5a251ab7a7f40ba0f40f) @@ -337,6 +337,9 @@ // MSG_ID_UI_DG_SET_RTC_REQUEST void handleUIClockSyncRequest( MESSAGE_T *message ); +// MSG_ID_HD_DG_POST_RESULT_REQUEST +void handleDGPOSTResultRequest( MESSAGE_T *message ); + // MSG_ID_DG_SET_CALIBRATION_DATA void handleSetDGCalibrationRecord( MESSAGE_T *message ); Index: firmware/App/Services/WatchdogMgmt.c =================================================================== diff -u -r5adaa0ae1236d34fca1fc8def7fa107ec470115e -r195f895cd5f580b448db5a251ab7a7f40ba0f40f --- firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision 5adaa0ae1236d34fca1fc8def7fa107ec470115e) +++ firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision 195f895cd5f580b448db5a251ab7a7f40ba0f40f) @@ -15,7 +15,9 @@ * ***************************************************************************/ -#include "CPLD.h" +#include "CPLD.h" +#include "InternalADC.h" +#include "OperationModes.h" #include "SystemCommMessages.h" #include "Timers.h" #include "WatchdogMgmt.h" @@ -28,9 +30,13 @@ // ********** private definitions ********** #define MIN_WATCHDOG_PET_INTERVAL_MS 45 ///< Minimum watchdog pet interval. -#define WATCHDOG_POST_TIMEOUT_MS 100 ///< Watchdog POST timeout in ms. -#define WATCHDOG_RECOVERY_TIME_MS 250 ///< Watchdog recovery time in ms. +#define WATCHDOG_POST_TIMEOUT_MS 500 ///< Watchdog POST timeout in ms. +#define WATCHDOG_RECOVERY_TIME_MS 500 ///< Watchdog recovery time in ms. + +#define MAX_24V_LEVEL_ON_WATCHDOG_EXPIRED 5.0 ///< Maximum voltage on 24V line when watchdog is expired. // TODO - check w/ Systems. Takes time for V to bleed off. Had to raise to 5V. +#define MIN_24V_LEVEL_ON_WATCHDOG_RECOVER 22.6 ///< Minimum voltage on 24V line when watchdog is recovered. + /// List of watchdog states. typedef enum Button_Self_Test_States { @@ -108,10 +114,11 @@ } // check to see if watchdog has expired - if ( getCPLDWatchdogExpired() == PIN_SIGNAL_HIGH ) + if ( getCPLDWatchdogExpired() == PIN_SIGNAL_LOW ) { // ignore expired watchdog until after watchdog POST - if ( WATCHDOG_SELF_TEST_STATE_COMPLETE == watchdogSelfTestState ) + if ( ( WATCHDOG_SELF_TEST_STATE_COMPLETE == watchdogSelfTestState ) || + ( getCurrentOperationMode() != DG_MODE_INIT ) ) { #ifndef DEBUG_ENABLED activateAlarmNoData( ALARM_ID_WATCHDOG_EXPIRED ); @@ -161,22 +168,44 @@ { // waiting here for w.d. test period to prevent this task from checking in - watchdog should expire } - if ( getCPLDWatchdogExpired() == PIN_SIGNAL_HIGH ) + if ( getCPLDWatchdogExpired() == PIN_SIGNAL_LOW ) { - watchdogSelfTestStatus = SELF_TEST_STATUS_PASSED; + F32 v24 = getIntADCVoltageConverted( INT_ADC_MAIN_24_VOLTS ); + + // Verify 24V is down when w.d. expired + if ( v24 > MAX_24V_LEVEL_ON_WATCHDOG_EXPIRED ) + { + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_WATCHDOG_POST_TEST_FAILED, 2.0, v24 ); + watchdogSelfTestStatus = SELF_TEST_STATUS_FAILED; + } } else { - activateAlarmNoData( ALARM_ID_WATCHDOG_POST_TEST_FAILED ); + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_WATCHDOG_POST_TEST_FAILED, 1 ); watchdogSelfTestStatus = SELF_TEST_STATUS_FAILED; } - watchdogSelfTestTimerCount = getMSTimerCount(); - watchdogSelfTestState = WATCHDOG_SELF_TEST_STATE_RECOVER; + watchdogSelfTestTimerCount = getMSTimerCount(); + watchdogSelfTestState = WATCHDOG_SELF_TEST_STATE_RECOVER; break; case WATCHDOG_SELF_TEST_STATE_RECOVER: if ( TRUE == didTimeout( watchdogSelfTestTimerCount, WATCHDOG_RECOVERY_TIME_MS ) ) { + if ( getCPLDWatchdogExpired() == PIN_SIGNAL_HIGH ) + { + F32 v24 = getIntADCVoltageConverted( INT_ADC_MAIN_24_VOLTS ); + + // Verify 24V is down when w.d. recovered + if ( v24 < MIN_24V_LEVEL_ON_WATCHDOG_RECOVER ) + { + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_WATCHDOG_POST_TEST_FAILED, 3.0, v24 ); + watchdogSelfTestStatus = SELF_TEST_STATUS_FAILED; + } + else + { + watchdogSelfTestStatus = SELF_TEST_STATUS_PASSED; + } + } result = watchdogSelfTestStatus; watchdogSelfTestState = WATCHDOG_SELF_TEST_STATE_COMPLETE; }