Index: firmware/App/Services/CommBuffers.c =================================================================== diff -u -r30f049651877229042e3f8700c8596e5b9a1e0f4 -r421ffbd3887d136b66da26ee3eeb17dcd9a773b8 --- firmware/App/Services/CommBuffers.c (.../CommBuffers.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) +++ firmware/App/Services/CommBuffers.c (.../CommBuffers.c) (revision 421ffbd3887d136b66da26ee3eeb17dcd9a773b8) @@ -153,12 +153,6 @@ // If buffer was full, check persistence - trigger s/w fault if persists if ( TRUE == bufferFull ) { -#ifdef DEBUG_ENABLED - char debugStr[ 100 ]; - sprintf( debugStr, "Buf OF:#%3d,%3d, %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", buffer, len, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7] ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); -#endif clearBuffer( buffer ); // Not first overflow? if ( firstBufferOverflowTimeStamp != 0 ) Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -rd3b7ae356aae29c99cb039713a2e120fdbce5a9c -r421ffbd3887d136b66da26ee3eeb17dcd9a773b8 --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision d3b7ae356aae29c99cb039713a2e120fdbce5a9c) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 421ffbd3887d136b66da26ee3eeb17dcd9a773b8) @@ -54,14 +54,9 @@ // ********** private data ********** -#ifdef DEBUG_ENABLED - static U32 sci1FrameErrorCnt = 0; - static U32 sci1OverrunErrorCnt = 0; -#endif static U32 sci2FrameErrorCnt = 0; ///< FPGA serial frame error counter. static U32 sci2OverrunErrorCnt = 0; ///< FPGA serial overrun error counter. -static U32 can1PassiveCnt = 0; ///< CAN passive mode counter. static U32 can1WarningCnt = 0; ///< CAN warning mode counter. static U32 can1BusOffCnt = 0; ///< CAN buss off mode counter. static U32 can1ParityCnt = 0; ///< CAN parity error counter. @@ -78,7 +73,6 @@ void initInterrupts( void ) { // 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 ); @@ -95,15 +89,6 @@ void phantomInterrupt(void) { // TODO - what to do with phantom interrupts? -#ifdef DEBUG_ENABLED - { - char debugStr[ 256 ]; - - sprintf( debugStr, "HD-phantom interrupt\n" ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); - } -#endif } /*********************************************************************//** @@ -171,63 +156,34 @@ *************************************************************************/ void canErrorNotification(canBASE_t *node, uint32 notification) { -#ifdef DEBUG_ENABLED - char debugStr[ 256 ]; -#endif - if ( node == canREG1 ) - { + { + // Parity error - message RAM is corrupted if ( notification & canLEVEL_PARITY_ERR ) { can1ParityCnt++; if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_PARITY ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_CAN_PARITY_ERROR ) } -#ifdef DEBUG_ENABLED - sprintf( debugStr, "CAN parity error:%5d \n", can1ParityCnt ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); -#endif - } + } + // Bus off - our transmitter has counted 255+ errors else if ( notification & canLEVEL_BUS_OFF ) { can1BusOffCnt++; if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_OFF ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_CAN_OFF_ERROR ) } -#ifdef DEBUG_ENABLED - sprintf( debugStr, "CAN bus off error:%5d \n", can1BusOffCnt ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); -#endif - } + } + // Warning - our transmitter has counted 96+ errors else if ( notification & canLEVEL_WARNING ) { can1WarningCnt++; -#ifdef DEBUG_ENABLED - sprintf( debugStr, "CAN bus warning:%5d \n", can1WarningCnt ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); -#endif } - else if ( notification & canLEVEL_PASSIVE ) - { - can1PassiveCnt++; - if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_CAN_PASSIVE ) ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_CAN_PASSIVE_WARNING ) - } -#ifdef DEBUG_ENABLED - sprintf( debugStr, "CAN passive warning:%5d \n", can1PassiveCnt ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); -#endif - } else { - // Ignore - other notifications undefined + // Ignore - other notifications - unhandled } } } Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r1240b612f790f931825aba86ec37f37eccce9336 -r421ffbd3887d136b66da26ee3eeb17dcd9a773b8 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 1240b612f790f931825aba86ec37f37eccce9336) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 421ffbd3887d136b66da26ee3eeb17dcd9a773b8) @@ -327,14 +327,6 @@ { canTransmit( canREG1, lastCANPacketSentChannel, lastCANPacketSent ); } -#ifdef DEBUG_ENABLED - { - char debugStr[100]; - sprintf( debugStr, "SystemComm-HD resend Last Frame. %2d\n", lastCANPacketSentChannel ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); - } -#endif } // We must be only node on CAN bus - nobody is ACKing our transmitted frames else @@ -343,13 +335,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]; - sprintf( debugStr, "SystemComm-HD is only node.\n" ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - } -#endif } } } @@ -968,13 +953,6 @@ SET_ALARM_WITH_1_U32_DATA( ALARM_ID_COMM_TOO_MANY_BAD_CRCS, (U32)ALARM_SOURCE_HD ); #endif } -#ifdef DEBUG_ENABLED - { - char debugStr[100]; - sprintf( debugStr, "SystemComm-HD-Bad Msg CRC.\n" ); - sendDebugDataToUI( (U08*)debugStr ); - } -#endif } /*********************************************************************//** Index: firmware/source/can.c =================================================================== diff -u -r2112e3143003eaf9584d4be068f7ca89b33c941a -r421ffbd3887d136b66da26ee3eeb17dcd9a773b8 --- firmware/source/can.c (.../can.c) (revision 2112e3143003eaf9584d4be068f7ca89b33c941a) +++ firmware/source/can.c (.../can.c) (revision 421ffbd3887d136b66da26ee3eeb17dcd9a773b8) @@ -517,8 +517,10 @@ */ /* USER CODE BEGIN (5) */ - // Enable EIE (error interrupts) + // Enable EIE (error interrupts) // Enable error interrupts for bus transmission issues. canREG1->CTL |= (uint32)0x00000008U; +// // Enable SIE (error interrupts) // Enable status interrupts for errors on received frames. Not Needed except for some engineering testing. +// canREG1->CTL |= (uint32)0x00000004U; /* USER CODE END */ }