Skip to content

Commit

Permalink
Update techdev-sois-eds to 2024-03-05 GSFC baseline
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'github-nasa/main' into techdev-sois-eds
  • Loading branch information
jphickey committed Mar 6, 2024
2 parents b60a9f2 + 4577b78 commit 28d53e2
Show file tree
Hide file tree
Showing 49 changed files with 3,466 additions and 1,865 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ jobs:
- name: Confirm Minimum Coverage
run: |
missed_branches=52
missed_lines=18
missed_branches=50
missed_lines=17
branch_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep branches | grep -oP "[0-9]+[0-9]*")
line_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep lines | grep -oP "[0-9]+[0-9]*")
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## Development Build: equuleus-rc1+dev100
- Add runtime TopicId conversion routines to SB
- See <https://github.com/nasa/cFE/pull/2520>

## Development Build: equuleus-rc1+dev96
- change CFE_MSG_Message from union to struct
- Remove unreachable/dead branch in CFE_ES_RunPerfLogDump()
- See <https://github.com/nasa/cFE/pull/2515> and <https://github.com/nasa/cFE/pull/2330>

## Development Build: equuleus-rc1+dev90
- EDS XML file updates
- add EDS cmake hooks
- See <https://github.com/nasa/cFE/pull/2510> and <https://github.com/nasa/cFE/pull/2511>

## Development Build: equuleus-rc1+dev84
- CFE updates needed for generated header compatibility (EDS)
- See <https://github.com/nasa/cFE/pull/2505>
Expand Down
70 changes: 69 additions & 1 deletion modules/cfe_testcase/src/es_task_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,66 @@ void TaskExitFunction(void)
}
}

#define UT_LOCAL_STACK_SIZE 4096
static unsigned long UT_LOCAL_STACK[UT_LOCAL_STACK_SIZE];

void TestCheckStackPointer(void)
{
int32 LocalVar;
cpuaddr VarAddress;
cpuaddr StackAddress;

OS_TaskDelay(10);

VarAddress = (cpuaddr)&LocalVar;
StackAddress = (cpuaddr)UT_LOCAL_STACK;

UtAssert_GT(cpuaddr, VarAddress, StackAddress);
UtAssert_LT(cpuaddr, VarAddress, StackAddress + sizeof(UT_LOCAL_STACK));

CFE_ES_ExitChildTask();
}

void TestCreateChildWithStack(void)
{
CFE_ES_TaskId_t TaskId = CFE_ES_TASKID_UNDEFINED;
int32 RetryCount;
const char * TaskName = "CHILD_W_STACK";
CFE_ES_StackPointer_t StackPointer = UT_LOCAL_STACK;
size_t StackSize = sizeof(UT_LOCAL_STACK);
CFE_ES_TaskPriority_Atom_t Priority = CFE_PLATFORM_ES_PERF_CHILD_PRIORITY;
uint32 Flags = 0;
char TaskNameBuf[16];

UtPrintf("Testing: CFE_ES_CreateChildTask with user-specified stack");

UtAssert_INT32_EQ(
CFE_ES_CreateChildTask(&TaskId, TaskName, TestCheckStackPointer, StackPointer, StackSize, Priority, Flags),
CFE_SUCCESS);

/* wait for task to exit itself */
RetryCount = 0;
while (RetryCount < 10)
{
/*
* poll until CFE_ES_GetTaskName() returns an error, then the task has exited
*
* NOTE: this intentionally does not Assert the status here, because the child task is
* also doing asserts at the time this loop is running. Once the child task finishes,
* it is OK to do asserts from this task again
*/
if (CFE_Assert_STATUS_STORE(CFE_ES_GetTaskName(TaskNameBuf, TaskId, sizeof(TaskNameBuf))) != CFE_SUCCESS)
{
break;
}
OS_TaskDelay(100);
++RetryCount;
}

/* Retroactively confirm that the previous call to CFE_ES_GetTaskName() returned RESOURCEID_NOT_VALID */
CFE_Assert_STATUS_MUST_BE(CFE_ES_ERR_RESOURCEID_NOT_VALID);
}

void TestCreateChild(void)
{
UtPrintf("Testing: CFE_ES_CreateChildTask");
Expand All @@ -114,7 +174,7 @@ void TestCreateChild(void)
while (CFE_FT_Global.Count != ExpectedCount && Index < 100)
{
OS_TaskDelay(10);
Index ++;
Index++;
}

UtAssert_INT32_GT(CFE_FT_Global.Count, ExpectedCount - 1);
Expand Down Expand Up @@ -292,4 +352,12 @@ void ESTaskTestSetup(void)
UtTest_Add(TestChildTaskName, NULL, NULL, "Test Child Task Name");
UtTest_Add(TestChildTaskDelete, NULL, NULL, "Test Child Tasks Delete");
UtTest_Add(TestExitChild, NULL, NULL, "Test Exit Child");

/*
* NOTE: The custom stack does not work on RTEMS, test is disabled on that platform
* for the time being (custom stack may be deprecated in future CFE release).
*/
#ifndef _RTEMS_OS_
UtTest_Add(TestCreateChildWithStack, NULL, NULL, "Test Child with Custom Stack");
#endif
}
6 changes: 3 additions & 3 deletions modules/core_api/fsw/inc/cfe_msg_api_typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@ typedef enum CFE_MSG_PlaybackFlag
/**
* \brief cFS generic base message
*/
typedef union CFE_MSG_Message CFE_MSG_Message_t;
typedef struct CFE_MSG_Message CFE_MSG_Message_t;

/**
* \brief cFS command header
*/
typedef struct CFE_HDR_CommandHeader CFE_MSG_CommandHeader_t;
typedef struct CFE_MSG_CommandHeader CFE_MSG_CommandHeader_t;

/**
* \brief cFS telemetry header
*/
typedef struct CFE_HDR_TelemetryHeader CFE_MSG_TelemetryHeader_t;
typedef struct CFE_MSG_TelemetryHeader CFE_MSG_TelemetryHeader_t;

#endif /* CFE_MSG_API_TYPEDEFS_H */
119 changes: 119 additions & 0 deletions modules/core_api/fsw/inc/cfe_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,130 @@ static inline CFE_SB_MsgId_t CFE_SB_ValueToMsgId(CFE_SB_MsgId_Atom_t MsgIdValue)
return Result;
}

/*****************************************************************************/
/**
* \brief Converts a topic ID and instance number combination into a MsgID value integer
*
* \par Description
* This function accepts a data pair of topic ID + instance number and returns the
* corresponding MsgID Value (integer) for commands.
*
* \par Assumptions and Notes:
* A topic ID identifies a certain data stream from an application, for example
* the CFE Software bus ground commands (CFE_MISSION_SB_CMD_TOPICID). In
* contrast to MsgID, the topic ID is consistent across all CPUs in a system, whereas
* each CPU instance will have a unique MsgID.
*
* CPU instance numbers are 1-based. The instance number of 0 is reserved
* for "global" MsgID values that are the same on all CPUs. The PSP function
* may be used to obtain the current CPU number for the host processor.
*
* \sa CFE_SB_TlmTopicIdToMsgId(), CFE_PSP_GetProcessorId()
*
* \return Integer representation of the #CFE_SB_MsgId_t
*/
CFE_SB_MsgId_Atom_t CFE_SB_CmdTopicIdToMsgId(uint16 TopicId, uint16 InstanceNum);

/*****************************************************************************/
/**
* \brief Converts a topic ID and instance number combination into a MsgID value integer
*
* \par Description
* This function accepts a data pair of topic ID + instance number and returns the
* corresponding MsgID Value (integer) for telemetry.
*
* \par Assumptions and Notes:
* A topic ID identifies a certain data stream from an application, for example
* the CFE Software bus housekeeping telemetry (CFE_MISSION_SB_HK_TLM_TOPICID). In
* contrast to MsgID, the topic ID is consistent across all CPUs in a system, whereas
* each CPU instance will have a unique MsgID.
*
* CPU instance numbers are 1-based. The instance number of 0 is reserved
* for "global" MsgID values that are the same on all CPUs. The PSP function
* may be used to obtain the current CPU number for the host processor.
*
* \sa CFE_SB_CmdTopicIdToMsgId(), CFE_PSP_GetProcessorId()
*
* \return Integer representation of the #CFE_SB_MsgId_t
*/
CFE_SB_MsgId_Atom_t CFE_SB_TlmTopicIdToMsgId(uint16 TopicId, uint16 InstanceNum);

/*****************************************************************************/
/**
* \brief Converts a topic ID to a MsgID value integer for Global commands
*
* \par Description
* This is a wrapper around CFE_SB_CmdTopicIdToMsgId() for topic IDs which
* are the same on all CPUs within a system (i.e. not specific to a certain
* processor)
*
* \par Assumptions and Notes:
* Global MsgIDs may be used when only a single instance of a service exists
* within the system. The CFE framework does not use this feature for commands,
* but is defined for future use.
*
* \sa CFE_SB_CmdTopicIdToMsgId(), CFE_SB_LocalCmdTopicIdToMsgId()
*
* \return Integer representation of the #CFE_SB_MsgId_t
*/
CFE_SB_MsgId_Atom_t CFE_SB_GlobalCmdTopicIdToMsgId(uint16 TopicId);

/*****************************************************************************/
/**
* \brief Converts a topic ID to a MsgID value integer for Global telemetry
*
* \par Description
* This is a wrapper around CFE_SB_TlmTopicIdToMsgId() for topic IDs which
* are the same on all CPUs within a system (i.e. not specific to a certain
* processor)
*
* \par Assumptions and Notes:
* Global MsgIDs may be used when only a single instance of a service exists
* within the system. An example for such telemetry is the time synchronization
* service published by CFE_TIME.
*
* \sa CFE_SB_TlmTopicIdToMsgId(), CFE_SB_LocalTlmTopicIdToMsgId()
*
* \return Integer representation of the #CFE_SB_MsgId_t
*/
CFE_SB_MsgId_Atom_t CFE_SB_GlobalTlmTopicIdToMsgId(uint16 TopicId);

/*****************************************************************************/
/**
* \brief Converts a topic ID to a MsgID value integer for local commands
*
* \par Description
* This is a wrapper around CFE_SB_CmdTopicIdToMsgId() for topic IDs which
* are unique on all CPUs within a system (i.e. specific to a certain
* processor)
*
* \par Assumptions and Notes:
* This assumes the caller is referring to a service running on the same
* processor instance as itself.
*
* \sa CFE_SB_CmdTopicIdToMsgId(), CFE_SB_LocalTlmTopicIdToMsgId()
*
* \return Integer representation of the #CFE_SB_MsgId_t
*/
CFE_SB_MsgId_Atom_t CFE_SB_LocalCmdTopicIdToMsgId(uint16 TopicId);

/*****************************************************************************/
/**
* \brief Converts a topic ID to a MsgID value integer for local telemetry
*
* \par Description
* This is a wrapper around CFE_SB_TlmTopicIdToMsgId() for topic IDs which
* are unique on all CPUs within a system (i.e. specific to a certain
* processor)
*
* \par Assumptions and Notes:
* This assumes the caller is referring to a service running on the same
* processor instance as itself.
*
* \sa CFE_SB_TlmTopicIdToMsgId(), CFE_SB_LocalCmdTopicIdToMsgId()
*
* \return Integer representation of the #CFE_SB_MsgId_t
*/
CFE_SB_MsgId_Atom_t CFE_SB_LocalTlmTopicIdToMsgId(uint16 TopicId);

/** @} */
Expand Down
12 changes: 6 additions & 6 deletions modules/core_api/fsw/inc/cfe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
#define CFE_VERSION_H

/* Development Build Macro Definitions */
#define CFE_BUILD_NUMBER 84 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_NUMBER 100 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_BASELINE "equuleus-rc1" /**< @brief Development: Reference git tag for build number */
#define CFE_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */
#define CFE_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */
#define CFE_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */

/* See \ref cfsversions for definitions */
#define CFE_MAJOR_VERSION 6 /*!< @brief Major version number */
#define CFE_MINOR_VERSION 7 /*!< @brief Minor version number */
#define CFE_REVISION 0 /*!< @brief Revision version number. Value of 0 indicates a development version.*/
#define CFE_MAJOR_VERSION 6 /*!< @brief Major version number */
#define CFE_MINOR_VERSION 7 /*!< @brief Minor version number */
#define CFE_REVISION 0 /*!< @brief Revision version number. Value of 0 indicates a development version.*/

/**
* @brief Last official release.
Expand Down Expand Up @@ -63,7 +63,7 @@

/**
* @brief Max Version String length.
*
*
* Maximum length that a cFE version string can be.
*/
#define CFE_CFG_MAX_VERSION_STR_LEN 256
Expand Down
5 changes: 3 additions & 2 deletions modules/core_api/ut-stubs/src/cfe_config_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ uint32 CFE_Config_GetValue(CFE_ConfigId_t ConfigId)
* Generated stub function for CFE_Config_GetVersionString()
* ----------------------------------------------------
*/
void CFE_Config_GetVersionString(char *Buf, size_t Size, const char *Component, const char *SrcVersion, const char *CodeName, const char *LastOffcRel)
void CFE_Config_GetVersionString(char *Buf, size_t Size, const char *Component, const char *SrcVersion,
const char *CodeName, const char *LastOffcRel)
{
UT_GenStub_AddParam(CFE_Config_GetVersionString, char *, Buf);
UT_GenStub_AddParam(CFE_Config_GetVersionString, size_t , Size);
UT_GenStub_AddParam(CFE_Config_GetVersionString, size_t, Size);
UT_GenStub_AddParam(CFE_Config_GetVersionString, const char *, Component);
UT_GenStub_AddParam(CFE_Config_GetVersionString, const char *, SrcVersion);
UT_GenStub_AddParam(CFE_Config_GetVersionString, const char *, CodeName);
Expand Down
Loading

0 comments on commit 28d53e2

Please sign in to comment.