Index: firmware/.cproject
===================================================================
diff -u -r567a9736641b877ac0028db7481daad2dc65305f -rfc99f47309c9d96f73a2d4696b42d6d302f334a7
--- firmware/.cproject (.../.cproject) (revision 567a9736641b877ac0028db7481daad2dc65305f)
+++ firmware/.cproject (.../.cproject) (revision fc99f47309c9d96f73a2d4696b42d6d302f334a7)
@@ -143,7 +143,7 @@
-
+
Index: firmware/.settings/org.eclipse.cdt.codan.core.prefs
===================================================================
diff -u -r792764062d7b7826af10e030277f18379af4fcd1 -rfc99f47309c9d96f73a2d4696b42d6d302f334a7
--- firmware/.settings/org.eclipse.cdt.codan.core.prefs (.../org.eclipse.cdt.codan.core.prefs) (revision 792764062d7b7826af10e030277f18379af4fcd1)
+++ firmware/.settings/org.eclipse.cdt.codan.core.prefs (.../org.eclipse.cdt.codan.core.prefs) (revision fc99f47309c9d96f73a2d4696b42d6d302f334a7)
@@ -1,3 +1,75 @@
eclipse.preferences.version=1
inEditor=false
onBuild=false
+org.eclipse.cdt.codan.checkers.errnoreturn=Warning
+org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return\\")",implicit\=>false}
+org.eclipse.cdt.codan.checkers.errreturnvalue=Error
+org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused return value\\")"}
+org.eclipse.cdt.codan.checkers.nocommentinside=-Error
+org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Nesting comments\\")"}
+org.eclipse.cdt.codan.checkers.nolinecomment=-Error
+org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Line comments\\")"}
+org.eclipse.cdt.codan.checkers.noreturn=Error
+org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return value\\")",implicit\=>false}
+org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error
+org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Abstract class cannot be instantiated\\")"}
+org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error
+org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Ambiguous problem\\")"}
+org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment in condition\\")"}
+org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error
+org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment to itself\\")"}
+org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No break at end of case\\")",no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false,enable_fallthrough_quickfix_param\=>false}
+org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning
+org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Catching by reference is recommended\\")",unknown\=>false,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error
+org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Circular inheritance\\")"}
+org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning
+org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class members should be properly initialized\\")",skip\=>true}
+org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem=Error
+org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid 'decltype(auto)' specifier\\")"}
+org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Field cannot be resolved\\")"}
+org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function cannot be resolved\\")"}
+org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error
+org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid arguments\\")"}
+org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error
+org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid template argument\\")"}
+org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error
+org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Label statement not found\\")"}
+org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error
+org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Member declaration not found\\")"}
+org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Method cannot be resolved\\")"}
+org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info
+org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Name convention for function\\")",pattern\=>"^[a-z]",macro\=>true,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class has a virtual method and non-virtual destructor\\")"}
+org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error
+org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid overload\\")"}
+org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error
+org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redeclaration\\")"}
+org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redefinition\\")"}
+org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return with parenthesis\\")"}
+org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning
+org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Format String Vulnerability\\")"}
+org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Statement has no effect\\")",macro\=>true,exceptions\=>()}
+org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suggested parenthesis around expression\\")",paramNot\=>false}
+org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suspicious semicolon\\")",else\=>false,afterelse\=>false}
+org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Type cannot be resolved\\")"}
+org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused function declaration\\")",macro\=>true}
+org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused static function\\")",macro\=>true}
+org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning
+org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused variable declaration in file scope\\")",macro\=>true,exceptions\=>("@(\#)","$Id")}
+org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error
+org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol is not resolved\\")"}
Index: firmware/App/Modes/ModeStandby.c
===================================================================
diff -u -r012573b1913d1bfd2357acfadcad6bb20b295ad9 -rfc99f47309c9d96f73a2d4696b42d6d302f334a7
--- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 012573b1913d1bfd2357acfadcad6bb20b295ad9)
+++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision fc99f47309c9d96f73a2d4696b42d6d302f334a7)
@@ -118,17 +118,17 @@
}
_enable_IRQ();
- //if ( TRUE == isFPGAIDValid() )
+ if ( TRUE == isFPGAIDValid() )
{
isFPGAImageValid = TRUE;
}
- //if ( ( TRUE == isFirmwareImageValid ) && ( TRUE == isFPGAImageValid ) )
- //{
+ if ( ( TRUE == isFirmwareImageValid ) && ( TRUE == isFPGAImageValid ) )
+ {
// All good, jump to application
- // jumpToApplication();
- //}
- //else
+ jumpToApplication();
+ }
+ else
{
// TODO do we need to try a few times prior to tansitioning to Idle?
Index: firmware/App/Modes/ModeUpdate.c
===================================================================
diff -u -r893caf9f58a08a2bd31068806e09603041d64add -rfc99f47309c9d96f73a2d4696b42d6d302f334a7
--- firmware/App/Modes/ModeUpdate.c (.../ModeUpdate.c) (revision 893caf9f58a08a2bd31068806e09603041d64add)
+++ firmware/App/Modes/ModeUpdate.c (.../ModeUpdate.c) (revision fc99f47309c9d96f73a2d4696b42d6d302f334a7)
@@ -7,6 +7,7 @@
#include "CommBuffers.h"
#include "Download.h"
+#include "FPGA.h"
#include "ModeUpdate.h"
#include "NVDataMgmt.h"
#include "OperationModes.h"
@@ -85,8 +86,24 @@
{
MODE_SW_UPDATE_STATE_T state = SW_UPDATE_VERIFY_STATE;
- requestNewOperationMode( MODE_STAND );
+ switch( getSWUpdateDestination() )
+ {
+ case UPDATE_FPGA:
+ if ( TRUE == isFPGAFlashComplete() )
+ {
+ requestNewOperationMode( MODE_STAND );
+ }
+ break;
+ case UPDATE_FIRMWARE:
+ requestNewOperationMode( MODE_STAND );
+ break;
+
+ default:
+ // Do nothing
+ break;
+ }
+
return state;
}
Index: firmware/App/Services/Download.c
===================================================================
diff -u -ra858229eb2ab05404dba3e29c95e2d5f7800efe6 -rfc99f47309c9d96f73a2d4696b42d6d302f334a7
--- firmware/App/Services/Download.c (.../Download.c) (revision a858229eb2ab05404dba3e29c95e2d5f7800efe6)
+++ firmware/App/Services/Download.c (.../Download.c) (revision fc99f47309c9d96f73a2d4696b42d6d302f334a7)
@@ -80,6 +80,11 @@
return SWUpdateCommandState;
}
+SW_UPDATE_DESINTATION_T getSWUpdateDestination( void )
+{
+ return (SW_UPDATE_DESINTATION_T)SWUpdateRCVStatus.updateDest;
+}
+
void clearSWUpdateCommandState( void )
{
SWUpdateCommandState = UPDATE_CMD_IDLE;
@@ -235,32 +240,10 @@
if ( SWUpdateRCVStatus.cyberIndex != SW_UPDATE_FINAL_MSG_INDEX )
{
- U16 removeThis;
- U08 index = 0;
- U32 counter;
- U08 test[8];
sizeToWrite = SW_UPDATE_FLASH_BUFFER_SIZE;
+
BOOL done = FALSE;
- /*for ( removeThis = 0; removeThis < SW_UPDATE_FLASH_BUFFER_SIZE; ++removeThis )
- {
- test[ index ] = SWUpdateRCVStatus.SWUpdateBuffer[removeThis];
- if ( index == 7 )
- {
- canTransmit( canREG1, (U32)SW_TEST, test ); // Transmit the FPGA back up to make sure we totally received what we sent
- for ( counter = 0; counter < 6000; counter++ ) {}
- index = 0;
- }
- else
- {
- index += 1;
- }
-
- // TODO this is temporary until the ROTTING is removed from the APP
- // SWUpdateRCVStatus.SWUpdateBuffer[ removeThis ] = 0xFF & ( SWUpdateRCVStatus.SWUpdateBuffer[removeThis] - 27 );
- }*/
- // 3192290
- // 1596144
if ( ( 1596144 - REMOVETHEVAR < SW_UPDATE_FLASH_BUFFER_SIZE ) && ( REMOVETHEVAR != 0 ) )
{
sizeToWrite = 1596144 - REMOVETHEVAR;
Index: firmware/App/Services/Download.h
===================================================================
diff -u -re8511af1e4e9d91cfd3378471869fb0246110870 -rfc99f47309c9d96f73a2d4696b42d6d302f334a7
--- firmware/App/Services/Download.h (.../Download.h) (revision e8511af1e4e9d91cfd3378471869fb0246110870)
+++ firmware/App/Services/Download.h (.../Download.h) (revision fc99f47309c9d96f73a2d4696b42d6d302f334a7)
@@ -16,6 +16,8 @@
SW_UPDATE_CMD_T getSWUpdateCommandState( void );
+SW_UPDATE_DESINTATION_T getSWUpdateDestination( void );
+
void clearSWUpdateCommandState( void );
void sendFPGAAckNackStatus( ACK_NACK_STATUS_T ackNackStatus );
Index: firmware/App/Services/FPGA.c
===================================================================
diff -u -ra858229eb2ab05404dba3e29c95e2d5f7800efe6 -rfc99f47309c9d96f73a2d4696b42d6d302f334a7
--- firmware/App/Services/FPGA.c (.../FPGA.c) (revision a858229eb2ab05404dba3e29c95e2d5f7800efe6)
+++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision fc99f47309c9d96f73a2d4696b42d6d302f334a7)
@@ -61,6 +61,8 @@
#define FPGA_ERASE_FIFO_CMD_OK ( 1 << 11 )
#define FPGA_FLASH_STATUS_OK ( 1 << 15 )
+#define FPGA_PRE_SELF_CONFIG_TIMEOUT_MS 10000
+
typedef enum
{
FPGA_COMM_IDLE = 0,
@@ -121,8 +123,10 @@
U16 fifoRemainingCount;
BOOL isFlashEraseOk;
BOOL isFlashStatusOk;
+ BOOL isFPGAFlashComplete;
U16 flashStatusBits;
- FPGA_FLASH_STATE_T fpgaFlashState;
+ U32 preSelfConfigureStartTimeMS;
+ FPGA_FLASH_STATE_T fpgaFlashState; // TODO remove
U32 startTime;
} FPGA_FLASH_STATUS_T;
@@ -306,9 +310,9 @@
return status;
}
-FPGA_FLASH_STATE_T getFPGAFlashState( void )
+BOOL isFPGAFlashComplete( void )
{
- return fpgaFlashStatus.fpgaFlashState;
+ return fpgaFlashStatus.isFPGAFlashComplete;
}
void signalFPGAToPrepareForUpdate( void )
@@ -340,6 +344,8 @@
{
if ( FALSE == isQueueFull() )
{
+ fpgaFlashStatus.preSelfConfigureStartTimeMS = getMSTimerCount();
+
enqueue( FPGA_SELF_CONFIGURE );
}
}
@@ -677,12 +683,22 @@
if ( FPGA_FLASH_WRITE_DATA == peekFromQueue() )
{
if ( ( fpgaFlashStatus.fifoRemainingCount < SW_UPDATE_FLASH_BUFFER_SIZE ) ||
- ( FALSE == fpgaFlashStatus.isFlashStatusOk ) || ( FALSE == fpgaFlashStatus.isFlashEraseOk ) )
+ ( FALSE == fpgaFlashStatus.isFlashStatusOk ) ||
+ ( FALSE == fpgaFlashStatus.isFlashEraseOk ) )
{
isDequeueAllowed = FALSE;
}
}
+ if ( FPGA_SELF_CONFIGURE == peekFromQueue() )
+ {
+ if ( ( FALSE == didTimeout( fpgaFlashStatus.preSelfConfigureStartTimeMS, FPGA_PRE_SELF_CONFIG_TIMEOUT_MS ) ) ||
+ ( FALSE == fpgaFlashStatus.isFlashStatusOk ) )
+ {
+ isDequeueAllowed = FALSE;
+ }
+ }
+
if ( TRUE == isDequeueAllowed )
{
dequeue();
@@ -693,14 +709,6 @@
requestFlashRegistersStatus();
- // TODo remove
- tempACkStatus = NACK;
- if ( FPGA_SELF_CONFIGURE == fpgaJobsQStatus.fpgaCurrentJob )
- {
- BOOL test = FALSE;
- }
- // TODo remove
-
return state;
}
@@ -716,12 +724,13 @@
jobSize = (U16)fpgaDataLenToWrite;
}
- // TODO remove
- if ( FPGA_FLASH_WRITE_DATA == fpgaJobsQStatus.fpgaCurrentJob )
+ if ( FPGA_SELF_CONFIGURE == fpgaJobsQStatus.fpgaCurrentJob )
{
- BOOL Test = FALSE;
+ // Once self configure is sent the FPGA will be unresponsive so there will be no ack back
+ // Signal FPGA is completed
+ state = FPGA_IDLE_STATE;
+ fpgaFlashStatus.isFPGAFlashComplete = TRUE;
}
- // TODO remove
U08* value2Write = JOBS_SPECS[ fpgaJobsQStatus.fpgaCurrentJob ].fpgaWriteStartAddress;
U16 firstCRCIndex = FPGA_WRITE_CMD_HDR_LEN + jobSize;
Index: firmware/App/Services/FPGA.h
===================================================================
diff -u -r012573b1913d1bfd2357acfadcad6bb20b295ad9 -rfc99f47309c9d96f73a2d4696b42d6d302f334a7
--- firmware/App/Services/FPGA.h (.../FPGA.h) (revision 012573b1913d1bfd2357acfadcad6bb20b295ad9)
+++ firmware/App/Services/FPGA.h (.../FPGA.h) (revision fc99f47309c9d96f73a2d4696b42d6d302f334a7)
@@ -18,7 +18,7 @@
BOOL hasUpdateBeenRequested( void );
BOOL isFPGAIDValid( void );
-FPGA_FLASH_STATE_T getFPGAFlashState( void );
+BOOL isFPGAFlashComplete( void );
void signalFPGAToPrepareForUpdate( void );
void signalFPGAToWriteToFlash( U08* data, U32 len );