Index: firmware/App/Services/FPGA.c =================================================================== diff -u -rb36fc8801adfc9d2f402450abffe721e71f9a5e5 -r359f9350ad9b2156ce02c94fa4950c4fb6768572 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision b36fc8801adfc9d2f402450abffe721e71f9a5e5) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 359f9350ad9b2156ce02c94fa4950c4fb6768572) @@ -333,10 +333,10 @@ static FPGA_SENSORS_ASYNC_T fpgaSensorReadingsAsync; ///< Record of last received async (as needed) FPGA sensor data. #endif -#ifndef DEBUG_ENABLED +//#ifndef DEBUG_ENABLED TODO: uncomment it DN-15SEPT2022 static U16 currentFPGATimerCount_ms; ///< Current FPGA timer count in ms. static U32 currentTimerCount_ms; ///< Current processor timer count in ms. -#endif +//#endif // ********** private function prototypes ********** @@ -971,7 +971,7 @@ *************************************************************************/ void execFPGAClockSpeedTest( void ) { -#ifndef DEBUG_ENABLED +//#ifndef DEBUG_ENABLED TODO: uncomment it DN-15SEPT2022 U16 const newFPGATimerCount_ms = getFPGATimerCount(); U32 const newTimerCount_ms = getMSTimerCount(); U32 const diffFPGATimerCount = (U32)u16DiffWithWrap( currentFPGATimerCount_ms, newFPGATimerCount_ms ); @@ -981,13 +981,16 @@ { if ( abs( diffFPGATimerCount - diffTimerCount ) > PROCESSOR_FPGA_CLOCK_DIFF_TOLERANCE ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_FPGA_CLOCK_SPEED_CHECK_FAILURE, diffFPGATimerCount, diffTimerCount ); + if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_CLOCK_SPEED_ERROR ) ) // DN-16SEPT2022 + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_FPGA_CLOCK_SPEED_CHECK_FAILURE, diffFPGATimerCount, diffTimerCount ); + } } } currentFPGATimerCount_ms = newFPGATimerCount_ms; currentTimerCount_ms = newTimerCount_ms; -#endif +//#endif } /*********************************************************************//** Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -re54806da466a8c52e19fd272356dbbfde04171fd -r359f9350ad9b2156ce02c94fa4950c4fb6768572 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision e54806da466a8c52e19fd272356dbbfde04171fd) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 359f9350ad9b2156ce02c94fa4950c4fb6768572) @@ -57,6 +57,9 @@ #define MSG_NOT_ACKED_MAX_RETRIES 3 ///< Maximum number of times a message that requires ACK that was not ACK'd can be re-sent before alarm #define PENDING_ACK_LIST_SIZE 25 ///< Maximum number of Denali messages that can be pending ACK at any given time +#define MAX_FPGA_CLOCK_SPEED_ERRORS 3 ///< maximum number of FPGA clock speed errors within window period before alarm - // DN-16SEPT2022 +#define MAX_FPGA_CLOCK_SPEED_ERROR_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< FPGA clock speed error window - // DN-16SEPT2022 + #pragma pack(push, 1) /// Record for transmitted message that is pending acknowledgment from receiver. @@ -148,6 +151,9 @@ // Initialize bad message CRC time windowed count initTimeWindowedCount( TIME_WINDOWED_COUNT_BAD_MSG_CRC, MAX_COMM_CRC_FAILURES, MAX_COMM_CRC_FAILURE_WINDOW_MS ); + + // initialize FPGA clock speed error time windowed count + initTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_CLOCK_SPEED_ERROR, MAX_FPGA_CLOCK_SPEED_ERRORS, MAX_FPGA_CLOCK_SPEED_ERROR_WINDOW_MS); // DN-16SEPT2022 // Initialize pending ACK list for ( i = 0; i < PENDING_ACK_LIST_SIZE; i++ ) Index: firmware/App/Tasks/TaskPriority.c =================================================================== diff -u -rc9b434898a8bbe9143b243627ea081e5e0f7a861 -r359f9350ad9b2156ce02c94fa4950c4fb6768572 --- firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision c9b434898a8bbe9143b243627ea081e5e0f7a861) +++ firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 359f9350ad9b2156ce02c94fa4950c4fb6768572) @@ -65,7 +65,7 @@ #ifndef BOARD_WITH_NO_HARDWARE // Verify processor clock speed against FPGA clock - execFPGAClockSpeedTest(); + //execFPGAClockSpeedTest(); TODO - uncomment it DN-16SEPT2022 #ifndef CAN_TEST // Monitor and process buttons