Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r8910c1a21976afcc84fe1d9504916efbc192325d -rcee800793b514f2fccd3776386b6cca41c6340ca --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 8910c1a21976afcc84fe1d9504916efbc192325d) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision cee800793b514f2fccd3776386b6cca41c6340ca) @@ -19,6 +19,7 @@ #include "AlarmLamp.h" #include "BloodFlow.h" #include "Buttons.h" +#include "Compatibility.h" #include "CPLD.h" #include "DialInFlow.h" #include "FPGA.h" @@ -101,7 +102,7 @@ switch ( postState ) { case POST_STATE_START: - postState = POST_STATE_WATCHDOG; + postState = POST_STATE_FW_COMPATIBILITY; #ifdef SKIP_POST postState = POST_STATE_COMPLETED; #endif @@ -165,6 +166,11 @@ postState = handlePOSTStatus( testStatus ); break; + case POST_STATE_FW_COMPATIBILITY: + testStatus = execFWCompatibilityTest(); + postState = handlePOSTStatus( testStatus ); + break; + // Should be last POST case POST_STATE_STUCK_BUTTON: testStatus = execStuckButtonTest(); @@ -261,8 +267,9 @@ } else if ( testStatus == SELF_TEST_STATUS_FAILED ) { - requestAlarmLampPattern( LAMP_PATTERN_FAULT ); + // At least one POST has failed tempPOSTPassed = FALSE; + // Test that failed should have triggered a fault which will request fault mode, so should POST state machine should never see FAILED state and will fault if it does result = POST_STATE_FAILED; } else @@ -272,3 +279,19 @@ return result; } + +/*********************************************************************//** + * @brief + * The execFWCompatibilityTest function executes the firmware compatibility test. + * @details Inputs: watchdogSelfTestState + * @details Outputs: watchdogSelfTestState + * @return in progress, passed, or failed + *************************************************************************/ +static SELF_TEST_STATUS_T execFWCompatibilityTest( void ) +{ + SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; + + // TODO - implement + + return result; +} Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r794f0aea88a5a860448e54e99db6e2e881b22900 -rcee800793b514f2fccd3776386b6cca41c6340ca --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 794f0aea88a5a860448e54e99db6e2e881b22900) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision cee800793b514f2fccd3776386b6cca41c6340ca) @@ -20,8 +20,9 @@ #include "sci.h" #include "sys_dma.h" -#include "FPGA.h" #include "Comm.h" +#include "Compatibility.h" +#include "FPGA.h" #include "SystemCommMessages.h" #include "Utilities.h" @@ -864,12 +865,28 @@ // Check FPGA reported correct ID if ( FPGA_EXPECTED_ID == fpgaHeader.fpgaId ) { - result = SELF_TEST_STATUS_PASSED; + // Check FPGA compatibility w/ firmware + if ( fpgaHeader.fpgaRevMajor > MIN_HD_FPGA_MAJOR ) + { + result = SELF_TEST_STATUS_PASSED; + } + else + { + if ( MIN_HD_FPGA_MAJOR == fpgaHeader.fpgaRevMajor && fpgaHeader.fpgaRev >= MIN_HD_FPGA_MINOR ) + { + result = SELF_TEST_STATUS_PASSED; + } + else + { + result = SELF_TEST_STATUS_FAILED; + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_FPGA_POST_TEST_FAILED, (U32)fpgaHeader.fpgaRevMajor, (U32)fpgaHeader.fpgaRev ) + } + } } else { result = SELF_TEST_STATUS_FAILED; - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_FPGA_POST_TEST_FAILED, (U32)fpgaHeader.fpgaId ) + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_FPGA_POST_TEST_FAILED, (U32)fpgaHeader.fpgaId ) } return result;