Skip to content

Commit

Permalink
Merge pull request #530 from nasa/ic-20200226
Browse files Browse the repository at this point in the history
Integration Candidate 20200226
  • Loading branch information
astrogeco committed Feb 28, 2020
2 parents 5802d22 + db85efb commit f1be048
Show file tree
Hide file tree
Showing 12 changed files with 556 additions and 449 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ This repository contains NASA's Core Flight Executive (cFE), which is a framewor
This is a collection of services and associated framework to be located in the `cfe` subdirectory of a cFS Mission Tree. The Core Flight System is bundled at https://github.com/nasa/cFS, which includes build and execution instructions.

## Version Notes

- 6.7.8: DEVELOPMENT
- Updates and cleaned up documentation and requirements
- Fixes incorrect debug messages
- Decrease child task count when one is deleted
- Minor other updates (see https://github.com/nasa/cFE/pull/530)
- 6.7.7: DEVELOPMENT
- Adds a new function, CFE_SB_GetPipeIdByName, which retrieves the pipe ID given a name of a pipe.
- Improvement in error reporting when using a pipe name that is already in use, or when the queue limit has been reached.
Expand Down
846 changes: 473 additions & 373 deletions docs/cFE_FunctionalRequirements.csv
100755 → 100644

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/src/cfe_es.dox
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
high level interface to system control facilities. The ES component is
responsible for starting up and restarting the cFE, starting up, shutting
down, and restarting cFE Applications, logging errors and performance data,
managing device driver services, and providing a persistent memory store
for cFE Applications.
and providing a persistent memory store for cFE Applications.

The interfaces to the ES task include the Ground Interface (commands and
telemetry) and the Application Programmer Interfaces (APIs). The ES task
Expand Down
41 changes: 33 additions & 8 deletions docs/src/main.dox
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,12 @@
<LI> #CFE_ES_ReloadApp - Reload a single cFE Application
<LI> #CFE_ES_DeleteApp - Delete a single cFE Application
</UL>
<LI> Required Application APIs
<LI> Application Behavior APIs
<UL>
<LI> #CFE_ES_RegisterApp - Registers a cFE Application with Executive Services
<LI> #CFE_ES_RunLoop - Checks for Exit, Restart or Reload commands
<LI> #CFE_ES_WaitForStartupSync - Waits for all Apps in Startup Script to complete initialization
<LI> #CFE_ES_WaitForSystemState - Waits for minimum global system state
<LI> #CFE_ES_IncrementTaskCounter - Increments telemetered task counter to indicate task activity
<LI> #CFE_ES_ExitApp - Exit for a cFE Application
</UL>
Expand All @@ -493,11 +494,6 @@
<LI> #CFE_ES_DeleteChildTask - Deletes a task under an existing Application
<LI> #CFE_ES_ExitChildTask - Exit for a cFE Child Task
</UL>
<LI> Driver APIs
<UL>
<LI> \#CFE_ES_RegisterDriver - Registers a Device Driver for a specified device
<LI> \#CFE_ES_UnloadDriver - Removes a Device Driver for a specified device
</UL>
<LI> Critical Data Store APIs
<UL>
<LI> #CFE_ES_RegisterCDS - Reserves space (or obtains previously reserved space)in the Critical Data Store
Expand All @@ -508,20 +504,32 @@
<UL>
<LI> #CFE_ES_PoolCreate - Initializes a Memory Pool created by an Application
<LI> #CFE_ES_PoolCreateEx - Initializes a Memory Pool created by an Application with Application specified block sizes
<LI> #CFE_ES_PoolCreateNoSem - Initializes a Memory Pool created by an Application without using a semaphore
<LI> #CFE_ES_GetPoolBuf - Gets a buffer from a Memory Pool
<LI> #CFE_ES_PutPoolBuf - Releases a buffer to a Memory Pool
<LI> #CFE_ES_GetMemPoolStats - Extracts statistics maintained by the memory pool software
<LI> #CFE_ES_GetPoolBufInfo - Gets info on a buffer previously allocated from a Memory Pool
</UL>
<LI> Performance Monitoring APIs
<UL>
<LI> #CFE_ES_PerfLogEntry - Marks the entry into a performance analyzer segment of code
<LI> #CFE_ES_PerfLogExit - Marks the exit from a performance analyzer segment of code
<LI> #CFE_ES_PerfLogAdd - Adds a mark into the Performance Log
</UL>
<LI> Generic Counter APIs
<UL>
<LI> #CFE_ES_RegisterGenCounter - Registers a generic counter
<LI> #CFE_ES_DeleteGenCounter - Delete previously registered generic counter
<LI> #CFE_ES_IncrementGenCounter - Increments the specified generic counter
<LI> #CFE_ES_SetGenCount - Set the specified generic counter
<LI> #CFE_ES_GetGenCount - Get the specified generic counter count
<LI> #CFE_ES_GetGenCounterIDByName - Get the Id associated with a generic counter name
</UL>
<LI> Miscellaneous APIs
<UL>
<LI> #CFE_ES_CalculateCRC - Calculates a CRC on a block of memory
<LI> #CFE_ES_WriteToSysLog - Writes a debug message to the System Log
<LI> #CFE_ES_WriteToSysLog - Writes a string to the System Log
<LI> #CFE_ES_ProcessCoreException - Process an exception detected by the underlying OS/PSP
</UL>
</UL>

Expand Down Expand Up @@ -550,13 +558,15 @@
<LI> cFE File Header Management APIs
<UL>
<LI> #CFE_FS_ReadHeader - Read the contents of the Standard cFE File Header
<LI> #CFE_FS_InitHeader - Initializes the contents of the Standard cFE File Header
<LI> #CFE_FS_WriteHeader - Write the contents of the Standard cFE File Header
<LI> #CFE_FS_SetTimestamp - Modify the Time Stamp field in the Standard cFE File Header
</UL>
<LI> Compressed File Management APIs
<UL>
<LI> #CFE_FS_IsGzFile - Determines if specified file is a gzip/compressed file
<LI> #CFE_FS_Decompress - Decompresses the specified file to a destination file
<LI> #CFE_FS_GetUncompressedFile - Decompresses the source file to a temporary file created in the temp dir
</UL>
<LI> Filename Utility APIs
<UL>
Expand All @@ -566,10 +576,12 @@

<H4> Software Bus API </H4>
<UL>
<LI> Pipe Creation/Deletion APIs
<LI> Pipe Management APIs
<UL>
<LI> #CFE_SB_CreatePipe - Creates a new software bus pipe
<LI> #CFE_SB_DeletePipe - Deletes a software bus pipe
<LI> #CFE_SB_SetPipeOpts - Set options on a pipe
<LI> #CFE_SB_GetPipeOpts - Get options on a pipe
</UL>
<LI> Message Subscription Control APIs
<UL>
Expand All @@ -582,6 +594,7 @@
<LI> Send/Receive Message APIs
<UL>
<LI> #CFE_SB_SendMsg - Send a software bus message
<LI> #CFE_SB_PassMsg - Passes a software bus message not generated by sending application
<LI> #CFE_SB_RcvMsg - Receive a software bus message
<LI> #CFE_SB_ZeroCopySend - Send a software bus message in "zero copy" mode
</UL>
Expand All @@ -590,6 +603,7 @@
<LI> #CFE_SB_ZeroCopyGetPtr - Get a buffer pointer to use for "zero copy" mode
<LI> #CFE_SB_ZeroCopyReleasePtr - Release an unused "zero copy" mode buffer pointer
<LI> #CFE_SB_ZeroCopySend - Send a software bus message in "zero copy" mode
<LI> #CFE_SB_ZeroCopyPass - Pass an SB message in "zero copy" mode not generated by sending application
</UL>
<LI> Setting Message Characteristics APIs
<UL>
Expand All @@ -601,6 +615,7 @@
<LI> #CFE_SB_TimeStampMsg - Sets the time field in a software bus message with the current spacecraft time
<LI> #CFE_SB_SetCmdCode - Sets the command code field in a software bus message
<LI> #CFE_SB_GenerateChecksum - Computes and sets the checksum field in a software bus message
<LI> #CFE_SB_MessageStringSet - Copies a string into a software bus message
</UL>
<LI> Getting Message Characteristics APIs
<UL>
Expand All @@ -612,13 +627,21 @@
<LI> #CFE_SB_GetMsgTime - Gets the time field from a software bus message
<LI> #CFE_SB_GetCmdCode - Gets the command code field from a software bus message
<LI> #CFE_SB_GetChecksum - Gets the checksum field from a software bus message
<LI> #CFE_SB_GetLastSenderId - Gets the application Info of the sender for the last message
<LI> CFE_SB_MessageStringGet - Copies a string out of a software bus message
</UL>
<LI> Checksum Control APIs
<UL>
<LI> #CFE_SB_GenerateChecksum - Computes and sets the checksum field in a software bus message
<LI> #CFE_SB_GetChecksum - Gets the checksum field from a software bus message
<LI> #CFE_SB_ValidateChecksum - Validates the checksum of a software bus message
</UL>
<LI> Message ID APIs
<UL>
<LI> #CFE_SB_MsgId_Equal - Identifies whether a two CFE_SB_MsgId_t values are equal
<LI> #CFE_SB_MsgIdToValue - Converts a CFE_SB_MsgId_t to a normal integer
<LI> #CFE_SB_ValueToMsgId - Converts a normal integer into a CFE_SB_MsgId_t
</UL>
</UL>

<H4> Table Services API </H4>
Expand Down Expand Up @@ -649,6 +672,7 @@
<UL>
<LI> #CFE_TBL_GetStatus - Obtain current status of pending actions for a table
<LI> #CFE_TBL_GetInfo - Obtain characteristics/information about a specific table
<LI> #CFE_TBL_NotifyByMessage - Request notification via message when table requires management
</UL>
</UL>

Expand Down Expand Up @@ -696,6 +720,7 @@
<LI> Miscellaneous Time APIs
<UL>
<LI> #CFE_TIME_Print - Converts a time value to a character string
<LI> #CFE_TIME_Local1HzISR - Called from the system PSP layer once per second
</UL>
</UL>
**/
Expand Down
7 changes: 1 addition & 6 deletions fsw/cfe-core/src/es/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,12 +1074,7 @@ int32 CFE_ES_CreateChildTask(uint32 *TaskIdPtr,
strncpy((char *)CFE_ES_Global.TaskTable[TaskId].TaskName,TaskName,OS_MAX_API_NAME);
CFE_ES_Global.TaskTable[TaskId].TaskName[OS_MAX_API_NAME - 1] = '\0';
CFE_ES_Global.RegisteredTasks++;

/*
** Increment the "Registered" child task count for the App
*/
CFE_ES_Global.AppTable[AppId].TaskInfo.NumOfChildTasks ++;


ReturnCode = CFE_SUCCESS;
}
else
Expand Down
20 changes: 14 additions & 6 deletions fsw/cfe-core/src/es/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,6 @@ int32 CFE_ES_ParseFileEntry(const char **TokenList, uint32 NumTokens)
EntryPoint, AppName);

}
else if(strcmp(EntryType,"CFE_DRV")==0)
{
CFE_ES_WriteToSysLog("ES Startup: Device Drivers not yet implemented. %s\n",FileName);
}
else
{
CFE_ES_WriteToSysLog("ES Startup: Unexpected EntryType %s in startup file.\n",EntryType);
Expand Down Expand Up @@ -572,7 +568,6 @@ int32 CFE_ES_AppCreate(uint32 *ApplicationIdPtr,
*/
strncpy((char *)CFE_ES_Global.AppTable[i].TaskInfo.MainTaskName, AppName, OS_MAX_API_NAME);
CFE_ES_Global.AppTable[i].TaskInfo.MainTaskName[OS_MAX_API_NAME - 1] = '\0';
CFE_ES_Global.AppTable[i].TaskInfo.NumOfChildTasks = 0;

/*
** Fill out the Task State info
Expand Down Expand Up @@ -1545,6 +1540,7 @@ void CFE_ES_GetAppInfoInternal(uint32 AppId, CFE_ES_AppInfo_t *AppInfoPtr )
int32 ReturnCode;
OS_module_prop_t ModuleInfo;
uint32 TaskIndex;
uint32 i;


CFE_ES_LockSharedData(__func__,__LINE__);
Expand Down Expand Up @@ -1575,7 +1571,19 @@ void CFE_ES_GetAppInfoInternal(uint32 AppId, CFE_ES_AppInfo_t *AppInfoPtr )
strncpy((char *)AppInfoPtr->MainTaskName, (char *)CFE_ES_Global.AppTable[AppId].TaskInfo.MainTaskName,
sizeof(AppInfoPtr->MainTaskName) - 1);
AppInfoPtr->MainTaskName[sizeof(AppInfoPtr->MainTaskName) - 1] = '\0';
AppInfoPtr->NumOfChildTasks = CFE_ES_Global.AppTable[AppId].TaskInfo.NumOfChildTasks;

/*
** Calculate the number of child tasks
*/
AppInfoPtr->NumOfChildTasks = 0;
for (i=0; i<OS_MAX_TASKS; i++ )
{
if ( CFE_ES_Global.TaskTable[i].AppId == AppId && CFE_ES_Global.TaskTable[i].RecordUsed == true
&& CFE_ES_Global.TaskTable[i].TaskId != AppInfoPtr->MainTaskId )
{
AppInfoPtr->NumOfChildTasks++;
}
}

/*
** Get the execution counter for the main task
Expand Down
2 changes: 0 additions & 2 deletions fsw/cfe-core/src/es/cfe_es_apps.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ typedef struct
{
uint32 MainTaskId; /* The Application's Main Task ID */
char MainTaskName[OS_MAX_API_NAME]; /* The Application's Main Task ID */
uint32 NumOfChildTasks; /* Number of Child tasks for an App */

} CFE_ES_MainTaskInfo_t;


Expand Down
16 changes: 8 additions & 8 deletions fsw/cfe-core/src/es/cfe_es_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,14 @@ int32 CFE_ES_SetPerfFilterMaskCmd(const CFE_ES_SetPerfFilterMask_t *data)
Perf->MetaData.FilterMask[cmd->FilterMaskNum] = cmd->FilterMask;

CFE_EVS_SendEvent(CFE_ES_PERF_FILTMSKCMD_EID, CFE_EVS_EventType_DEBUG,
"Set Performance Filter Mask Cmd rcvd, num %d, val 0x%x",
(int)cmd->FilterMaskNum,(unsigned int)cmd->FilterMaskNum);
"Set Performance Filter Mask Cmd rcvd, num %u, val 0x%08X",
(unsigned int)cmd->FilterMaskNum,(unsigned int)cmd->FilterMask);

CFE_ES_TaskData.CommandCounter++;
}else{
CFE_EVS_SendEvent(CFE_ES_PERF_FILTMSKERR_EID, CFE_EVS_EventType_ERROR,
"Performance Filter Mask Cmd Error,Index(%d)out of range(%d)",
(int)cmd->FilterMaskNum,(int)CFE_ES_PERF_32BIT_WORDS_IN_MASK);
"Performance Filter Mask Cmd Error,Index(%u)out of range(%u)",
(unsigned int)cmd->FilterMaskNum,(unsigned int)CFE_ES_PERF_32BIT_WORDS_IN_MASK);

CFE_ES_TaskData.CommandErrorCounter++;

Expand All @@ -372,15 +372,15 @@ int32 CFE_ES_SetPerfTriggerMaskCmd(const CFE_ES_SetPerfTriggerMask_t *data)
Perf->MetaData.TriggerMask[cmd->TriggerMaskNum] = cmd->TriggerMask;

CFE_EVS_SendEvent(CFE_ES_PERF_TRIGMSKCMD_EID, CFE_EVS_EventType_DEBUG,
"Set Performance Trigger Mask Cmd rcvd,num %d, val 0x%x",
(int)cmd->TriggerMaskNum,(int)cmd->TriggerMaskNum);
"Set Performance Trigger Mask Cmd rcvd,num %u, val 0x%08X",
(unsigned int)cmd->TriggerMaskNum,(unsigned int)cmd->TriggerMask);

CFE_ES_TaskData.CommandCounter++;

}else{
CFE_EVS_SendEvent(CFE_ES_PERF_TRIGMSKERR_EID, CFE_EVS_EventType_ERROR,
"Performance Trigger Mask Cmd Error,Index(%d)out of range(%d)",
(int)cmd->TriggerMaskNum,(int)CFE_ES_PERF_32BIT_WORDS_IN_MASK);
"Performance Trigger Mask Cmd Error,Index(%u)out of range(%u)",
(unsigned int)cmd->TriggerMaskNum,(unsigned int)CFE_ES_PERF_32BIT_WORDS_IN_MASK);

CFE_ES_TaskData.CommandErrorCounter++;
}
Expand Down
1 change: 0 additions & 1 deletion fsw/cfe-core/src/es/cfe_es_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,6 @@ void CFE_ES_CreateObjects(void)
*/
strncpy((char *)CFE_ES_Global.AppTable[j].TaskInfo.MainTaskName, (char *)CFE_ES_ObjectTable[i].ObjectName, OS_MAX_API_NAME);
CFE_ES_Global.AppTable[j].TaskInfo.MainTaskName[OS_MAX_API_NAME - 1] = '\0';
CFE_ES_Global.AppTable[j].TaskInfo.NumOfChildTasks = 0;

/*
** Create the task
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/inc/cfe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
** release that contains changes deemed to be of similar impact, even if there are no actual changes to the API.
**
** The Minor number shall be incremented on release to indicate the addition of features to the API,
** which do not break the existin code. It may also be incremented for a release that contains changes deemed
** which do not break the existing code. It may also be incremented for a release that contains changes deemed
** to be of similar impact, even if there are no actual updates to the API.
**
** The Implementation Revision Version number shall be incremented on changes to software in the master branch,
Expand Down Expand Up @@ -74,7 +74,7 @@
*/
#define CFE_MAJOR_VERSION 6
#define CFE_MINOR_VERSION 7
#define CFE_REVISION 7
#define CFE_REVISION 8


#endif /* _cfe_version_ */
54 changes: 17 additions & 37 deletions fsw/cfe-core/unit-test/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,26 +908,6 @@ void TestApps(void)
"CFE_ES_StartApplications",
"Start application; successful");

/* Test parsing the startup script with an invalid CFE driver type */
ES_ResetUnitTest();
{
const char *TokenList[] =
{
"CFE_DRV",
"/cf/apps/tst_lib.bundle",
"TST_LIB_Init",
"TST_LIB",
"0",
"0",
"0x0",
"1"
};
UT_Report(__FILE__, __LINE__,
CFE_ES_ParseFileEntry(TokenList, 8) == CFE_ES_ERR_APP_CREATE,
"CFE_ES_ParseFileEntry",
"Unimplemented CFE driver type");
}

/* Test parsing the startup script with an unknown entry type */
ES_ResetUnitTest();
{
Expand Down Expand Up @@ -4306,8 +4286,8 @@ void TestAPI(void)
char CDSName[CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + 2];
int i;
uint32 ExceptionContext = 0;
int32 Return;
uint8 Data[12];
int32 Return;
uint8 Data[12];
uint32 ResetType;
uint32 *ResetTypePtr;
uint32 AppId;
Expand All @@ -4318,6 +4298,7 @@ void TestAPI(void)
uint32 CounterCount;
CFE_ES_CDSHandle_t CDSHandle;
CFE_ES_TaskInfo_t TaskInfo;
CFE_ES_AppInfo_t AppInfo;

#ifdef UT_VERBOSE
UT_Text("Begin Test API\n");
Expand Down Expand Up @@ -4797,12 +4778,20 @@ void TestAPI(void)
CFE_ES_Global.AppTable[0].AppState = CFE_ES_AppState_RUNNING;
CFE_ES_Global.AppTable[0].TaskInfo.MainTaskId = 15;
OS_TaskCreate(&CFE_ES_Global.TaskTable[1].TaskId, NULL, NULL, NULL,
0, 0, 0);
UT_Report(__FILE__, __LINE__,
CFE_ES_DeleteChildTask(CFE_ES_Global.TaskTable[1].TaskId) ==
CFE_SUCCESS,
"CFE_ES_DeleteChildTask",
"Delete child task successful");
0, 0, 0);
Return = CFE_ES_GetAppInfo(&AppInfo,CFE_ES_Global.TaskTable[1].AppId);
UtAssert_True(Return == CFE_SUCCESS,
"CFE_ES_GetAppInfo() return=%x", (unsigned int)Return);
UtAssert_True(AppInfo.NumOfChildTasks == 1,
"AppInfo.NumOfChildTaskss == %u", (unsigned int)AppInfo.NumOfChildTasks);
Return = CFE_ES_DeleteChildTask(CFE_ES_Global.TaskTable[1].TaskId);
UtAssert_True(Return == CFE_SUCCESS,
"DeleteChildResult() return=%x", (unsigned int)Return);
Return = CFE_ES_GetAppInfo(&AppInfo,CFE_ES_Global.TaskTable[1].AppId);
UtAssert_True(Return == CFE_SUCCESS,
"CFE_ES_GetAppInfo() return=%x", (unsigned int)Return);
UtAssert_True(AppInfo.NumOfChildTasks == 0,
"AppInfo.NumOfChildTaskss == %u", (unsigned int)AppInfo.NumOfChildTasks);

/* Test deleting a child task with an OS task delete failure */
ES_ResetUnitTest();
Expand Down Expand Up @@ -7062,15 +7051,6 @@ void TestStaticApp(void)
"CFE_ES_StartStaticApplications",
"*Not implemented* Initialize static shared library; successful");

/* Test successful device driver initialization */
ES_ResetUnitTest();
CFE_ES_StaticStartupTable[0].ObjectType = CFE_ES_STATIC_DRV;
CFE_ES_StartStaticApplications(CFE_PSP_RST_TYPE_PROCESSOR);
UT_Report(__FILE__, __LINE__,
UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_NO_MESSAGE]),
"CFE_ES_StartStaticApplications",
"*Not implemented* Device drivers not yet implemented");

/* Test successful static application initialization null action */
ES_ResetUnitTest();
CFE_ES_StaticStartupTable[0].ObjectType = CFE_ES_STATIC_NULL;
Expand Down
Loading

0 comments on commit f1be048

Please sign in to comment.