Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cFE Integration candidate: 2021-03-23 #1243

Merged
merged 20 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bedca93
Fix #1033, remove false child tasks statement.
zanzaben Mar 11, 2021
54d5162
Fix #590, Clarify the documentation on SB MsgId
zanzaben Mar 11, 2021
3f596eb
Fix #1226, Add Contributing Guide
arielswalker Mar 16, 2021
a00a788
Fix #1217, locally define BIG/LITTLE order macros
jphickey Mar 10, 2021
10747de
Fix #1195, Avoid implicit conversion from vsnprintf errors
skliper Mar 17, 2021
cd8959b
Fix #1200, Correct local type for CFE_TBL_FindTableInRegistry returns
skliper Mar 17, 2021
6b76dd7
Fix #1200, Report status in CFE_ES_FileWriteByteCntErr event
skliper Mar 17, 2021
ba29f16
Fix #1204, Use mask instead of cast to alter value
skliper Mar 16, 2021
31aae76
Fix #1208, Cast isspace input to unsigned char
skliper Mar 16, 2021
b878c4e
Fix #1221, Use quotes for local includes
skliper Mar 16, 2021
b44c4b6
Merge pull request #1218 from jphickey/fix-1217-bit-order
astrogeco Mar 18, 2021
4b58081
Merge pull request #1193 from zanzaben/fix1033_Update_App_Dev_Guide
astrogeco Mar 18, 2021
68cd788
Merge pull request #1235 from skliper/fix1195-vsnprintf_error
astrogeco Mar 18, 2021
1e05768
Merge pull request #1220 from zanzaben/fix590_clarify_SB_MsgId_doc
astrogeco Mar 18, 2021
cab1e18
Merge pull request #1230 from skliper/fix1208-negative_isspace
astrogeco Mar 18, 2021
63f4eb2
Merge pull request #1231 from skliper/fix1204-alter_with_mask
astrogeco Mar 18, 2021
c642d5e
Merge pull request #1232 from skliper/fix1200-fix_types
astrogeco Mar 18, 2021
6001050
Merge pull request #1228 from skliper/fix1221-include_quotes
astrogeco Mar 18, 2021
0e61b52
Merge pull request #1227 from ArielSAdamsNASA/fix-1226-add_contributi…
astrogeco Mar 18, 2021
313bcc0
IC:2021-03-23 Bump to v6.8.0-rc1+dev436
astrogeco Mar 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributing Guide

Please see our [top-level contributing guide](https://github.com/nasa/cFS/blob/main/CONTRIBUTING.md) for more information on how to contribute.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ The detailed cFE user's guide can be viewed at <https://github.com/nasa/cFS/blob

## Version History

### Development Build: v6.8.0-rc1+dev436

- Adds a local definition of SOFTWARE_BIG/LITTLE_BIT_ORDER directly inside cfe_endian.h to provide a compatible symbol for apps that still require this. This allows CFE to build and run successfully when OSAL stops providing this in `common_types.h`.
- Removes incorrect statements from Application Developers Guide
- Fixes truncation handling on vsnprintf error by adding a cast to avoid implicit conversion
- Clarify the documentation on SB MsgId regarding requirements for command and telemetry messages
- Avoids undefined behavior and resolves static analysis warnings by casting isspace input to unsigned char.
- Updates message module and msgid v1, CFE_MSG_SetMsgId, to use mask instead of cast to alter value. Resolves static analysis warning.
- Updates CFE_ES_FileWriteByteCntErr to report status, not a size_t actual since OS_write returns int32. Use int16 for local type from CFE_TBL_FindTableInRegistry since it's an index, not a status.
- Replaces <> with " in local #includes
- Adds CONTRIBUING.md that links to the main cFS contributing guide.
- See <https://github.com/nasa/cFE/pull/1243>

### Development Build: v6.8.0-rc1+dev412

- Apply standard code style and format
Expand Down
4 changes: 2 additions & 2 deletions cmake/target/inc/target_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#ifndef TARGET_CONFIG_H_
#define TARGET_CONFIG_H_

#include <common_types.h>
#include <cfe_psp_configdata.h>
#include "common_types.h"
#include "cfe_psp_configdata.h"

/**
* Prototype for the main system entry function implemented in CFE ES
Expand Down
9 changes: 6 additions & 3 deletions docs/cFE Application Developers Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,12 @@ deciding on whether to create multiple Applications versus a single
Application with multiple Tasks, the Application Developer should keep
in mind these facts:

- Child Tasks can only execute at a priority equal to or less than the
priority of the Application's Main Task.
- When the Application exits it is the responsiabilty of the
Main Task to safely stop all of its Child Tasks.

- If the Main Task of an Application is stopped, either through
detection of an exception or via command, all Child Tasks are also
stopped.
forcibly stopped in an unsafe manner.

Child Tasks can be useful in both "Software Only" and "Hardware Servicing"
applications.
Expand Down Expand Up @@ -1393,6 +1393,9 @@ on the Software Bus. Depending on the implementation, different
ranges and values are supported, and the values effect the message
header differently.

If you are using the default, MsgID maps directly to the CCSDS Stream ID.
When using the default, for commands use 0x18xx and telemetry use 0x08xx

### 6.1.2 Pipes

The destinations to which SB Messages are sent are called *pipes*. These
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_assert/inc/cfe_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/************************************************************************
** Includes
*************************************************************************/
#include <common_types.h>
#include "common_types.h"

/************************************************************************
** Type Definitions
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_assert/src/cfe_assert_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Includes
*/

#include <cfe.h>
#include "cfe.h"

#include "cfe_assert.h"

Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_assert/src/cfe_assert_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <string.h>
#include <stdbool.h>

#include <cfe.h>
#include "cfe.h"

#include "utbsp.h"
#include "uttest.h"
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testcase/src/cfe_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Includes
*/

#include <cfe.h>
#include "cfe.h"

#include "uttest.h"
#include "utassert.h"
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testrunner/inc/cfe_testrunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/************************************************************************
** Includes
*************************************************************************/
#include <common_types.h>
#include "common_types.h"

/************************************************************************
** Type Definitions
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testrunner/src/cfe_testrunner_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Includes
*/

#include <cfe.h>
#include "cfe.h"

#include "cfe_testrunner.h"

Expand Down
24 changes: 24 additions & 0 deletions modules/core_api/fsw/inc/cfe_endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,30 @@
*/
#include "common_types.h"

/*
* SOFTWARE_BIG/LITTLE_BIT_ORDER COMPATIBILITY MACRO -
*
* This is provided only for backward compatibilty. Do not write any new code that
* uses this macro.
*/
#if !defined(SOFTWARE_BIG_BIT_ORDER) && !defined(SOFTWARE_LITTLE_BIT_ORDER)

#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || defined(__BIG_ENDIAN__) || defined(__ARMEB__) || \
defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__)
/* It is a big-endian target architecture */
#define SOFTWARE_BIG_BIT_ORDER
#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || \
defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) || \
defined(__i386) || defined(__i386__) || defined(__i686) || defined(__i686__) || defined(__x86_64) || \
defined(__x86_64__)
/* It is a little-endian target architecture */
#define SOFTWARE_LITTLE_BIT_ORDER
#else
#error Unknown byte order on this platform
#endif

#endif /* !defined(SOFTWARE_BIG_BIT_ORDER) && !defined(SOFTWARE_LITTLE_BIT_ORDER) */

/* Macro to convert 16/32 bit types from platform "endianness" to Big Endian */
#ifdef SOFTWARE_BIG_BIT_ORDER
#define CFE_MAKE_BIG16(n) (n)
Expand Down
4 changes: 2 additions & 2 deletions modules/core_api/fsw/inc/cfe_tbl_filedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
#ifndef _cfe_tbl_filedef_
#define _cfe_tbl_filedef_

#include <cfe_mission_cfg.h>
#include <common_types.h>
#include "cfe_mission_cfg.h"
#include "common_types.h"
#include "cfe_tbl_extern_typedefs.h" /* for "CFE_TBL_FileHdr_t" definition */
#include "cfe_fs_extern_typedefs.h" /* for "CFE_FS_HDR_DESC_MAX_LEN" definition */

Expand Down
2 changes: 1 addition & 1 deletion modules/core_api/fsw/inc/cfe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/

/* Development Build Macro Definitions */
#define CFE_BUILD_NUMBER 412 /*!< Development Build: Number of commits since baseline */
#define CFE_BUILD_NUMBER 436 /*!< Development Build: Number of commits since baseline */
#define CFE_BUILD_BASELINE \
"v6.8.0-rc1" /*!< Development Build: git tag that is the base for the current development \
*/
Expand Down
8 changes: 4 additions & 4 deletions modules/core_private/fsw/inc/cfe_es_erlog_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
#ifndef CFE_ES_ERLOG_TYPEDEF_H_
#define CFE_ES_ERLOG_TYPEDEF_H_

#include <common_types.h>
#include <cfe_platform_cfg.h>
#include "common_types.h"
#include "cfe_platform_cfg.h"

#include <cfe_time_extern_typedefs.h> /* Needed for CFE_TIME_SysTime_t */
#include <cfe_es_extern_typedefs.h> /* Needed for CFE_ES_AppId_t */
#include "cfe_time_extern_typedefs.h" /* Needed for CFE_TIME_SysTime_t */
#include "cfe_es_extern_typedefs.h" /* Needed for CFE_ES_AppId_t */

#define CFE_ES_ERLOG_DESCRIPTION_MAX_LENGTH 80

Expand Down
2 changes: 1 addition & 1 deletion modules/core_private/fsw/inc/cfe_es_perfdata_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef CFE_ES_PERFDATA_TYPEDEF_H_
#define CFE_ES_PERFDATA_TYPEDEF_H_

#include <common_types.h>
#include "common_types.h"
#include "cfe_mission_cfg.h" /* Required for CFE_MISSION_ES_PERF_MAX_IDS */
#include "cfe_platform_cfg.h" /* Required for CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE */

Expand Down
2 changes: 1 addition & 1 deletion modules/core_private/fsw/inc/cfe_es_resetdata_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef CFE_ES_RESETDATA_TYPEDEF_H_
#define CFE_ES_RESETDATA_TYPEDEF_H_

#include <common_types.h>
#include "common_types.h"

#include "cfe_time_resetvars_typedef.h" /* Required for CFE_TIME_ResetVars_t definition */
#include "cfe_es_erlog_typedef.h" /* Required for CFE_ES_ERLog_t definition */
Expand Down
4 changes: 2 additions & 2 deletions modules/core_private/fsw/inc/cfe_evs_log_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#ifndef CFE_EVS_LOG_TYPEDEF_H_
#define CFE_EVS_LOG_TYPEDEF_H_

#include <common_types.h>
#include <cfe_platform_cfg.h>
#include "common_types.h"
#include "cfe_platform_cfg.h"

#include "cfe_evs_msg.h" /* Required for CFE_EVS_LongEventTlm_t definition */

Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_syslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ void CFE_ES_SysLog_vsnprintf(char *Buffer, size_t BufferSize, const char *SpecSt
*
* Strip off all trailing whitespace, and add back a single newline
*/
while (StringLen > 0 && isspace((int)Buffer[StringLen - 1]))
while (StringLen > 0 && isspace((unsigned char)Buffer[StringLen - 1]))
{
--StringLen;
}
Expand Down
6 changes: 3 additions & 3 deletions modules/es/fsw/src/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -1990,12 +1990,12 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data)
/* a byte count discrepancy has been*/
/* detected during the file write */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, size_t Actual)
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, int32 Status)
{

CFE_EVS_SendEvent(CFE_ES_FILEWRITE_ERR_EID, CFE_EVS_EventType_ERROR,
"File write,byte cnt err,file %s,request=%u,actual=%u", Filename, (unsigned int)Requested,
(unsigned int)Actual);
"File write,byte cnt err,file %s,request=%u,status=0x%08x", Filename, (unsigned int)Requested,
(unsigned int)Status);

} /* End of CFE_ES_FileWriteByteCntErr() */

Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data);
*/
bool CFE_ES_ValidateHandle(CFE_ES_MemHandle_t Handle);
bool CFE_ES_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength);
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, size_t Actual);
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, int32 Status);

/*************************************************************************/

Expand Down
7 changes: 5 additions & 2 deletions modules/evs/fsw/src/cfe_evs_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,11 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1
ExpandedLength =
vsnprintf((char *)LongEventTlm.Payload.Message, sizeof(LongEventTlm.Payload.Message), MsgSpec, ArgPtr);

/* Were any characters truncated in the buffer? */
if (ExpandedLength >= sizeof(LongEventTlm.Payload.Message))
/*
* If vsnprintf is bigger than message size, mark with truncation character
* Note negative returns (error from vsnprintf) will just leave the message as-is
*/
if (ExpandedLength >= (int)sizeof(LongEventTlm.Payload.Message))
{
/* Mark character before zero terminator to indicate truncation */
LongEventTlm.Payload.Message[sizeof(LongEventTlm.Payload.Message) - 2] = CFE_EVS_MSG_TRUNCATED;
Expand Down
5 changes: 3 additions & 2 deletions modules/msg/fsw/src/cfe_msg_msgid_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ int32 CFE_MSG_SetMsgId(CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t MsgId)
return CFE_MSG_BAD_ARGUMENT;
}

MsgPtr->CCSDS.Pri.StreamId[0] = (uint8)(msgidval >> 8);
MsgPtr->CCSDS.Pri.StreamId[1] = (uint8)(msgidval);
/* Shift and mask bytes to be endian agnostic */
MsgPtr->CCSDS.Pri.StreamId[0] = (msgidval >> 8) & 0xFF;
MsgPtr->CCSDS.Pri.StreamId[1] = msgidval & 0xFF;

return CFE_SUCCESS;
}
9 changes: 5 additions & 4 deletions modules/tbl/fsw/src/cfe_tbl_task_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
CFE_TBL_File_Hdr_t TblFileHeader;
osal_id_t FileDescriptor;
int32 Status;
int16 RegIndex;
CFE_TBL_RegistryRec_t * RegRecPtr;
CFE_TBL_LoadBuff_t * WorkingBufferPtr;
char LoadFilename[OS_MAX_PATH_LEN];
Expand All @@ -379,17 +380,17 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
if (Status == CFE_SUCCESS)
{
/* Locate specified table in registry */
Status = CFE_TBL_FindTableInRegistry(TblFileHeader.TableName);
RegIndex = CFE_TBL_FindTableInRegistry(TblFileHeader.TableName);

if (Status == CFE_TBL_NOT_FOUND)
if (RegIndex == CFE_TBL_NOT_FOUND)
{
CFE_EVS_SendEvent(CFE_TBL_NO_SUCH_TABLE_ERR_EID, CFE_EVS_EventType_ERROR,
"Unable to locate '%s' in Table Registry", TblFileHeader.TableName);
}
else
{
/* Translate the registry index into a record pointer */
RegRecPtr = &CFE_TBL_Global.Registry[Status];
RegRecPtr = &CFE_TBL_Global.Registry[RegIndex];

if (RegRecPtr->DumpOnly)
{
Expand Down Expand Up @@ -1321,7 +1322,7 @@ int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDSCmd_t *data)
char TableName[CFE_TBL_MAX_FULL_NAME_LEN];
CFE_TBL_CritRegRec_t * CritRegRecPtr = NULL;
uint32 i;
uint32 RegIndex;
int16 RegIndex;
int32 Status;

/* Make sure all strings are null terminated before attempting to process them */
Expand Down
2 changes: 1 addition & 1 deletion modules/tbl/ut-coverage/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,7 @@ void Test_CFE_TBL_Manage(void)
{
int32 RtnCode;
bool EventsCorrect;
int32 RegIndex;
int16 RegIndex;
CFE_TBL_RegistryRec_t * RegRecPtr;
CFE_TBL_LoadBuff_t * WorkingBufferPtr;
UT_Table1_t TestTable1;
Expand Down