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

Integration Candidate: 2020-09-23 #912

Merged
merged 13 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ The detailed cFE user's guide can be viewed at <https://github.com/nasa/cFS/blob

## Version History

### Development Build: 6.8.0-rc1+dev105
- Removes dependency on CCSDS version define.
- Removes old name and id defines.
- CFE_ES_CalculateCRC default stub behavior.
- Replaces calls to OS_open and OS_creat
- Replaces UT_Text with UtPrintf
- Updates variable checks in read_targetconfig

- See <https://github.com/nasa/cFE/pull/912>

### Development Build: 6.8.0-rc1+dev91

- Sets Revision to 99 for development build.
Expand Down
5 changes: 1 addition & 4 deletions cmake/arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ function(add_cfe_tables APP_NAME TBL_SRC_FILES)
# current content of a dependency (rightfully so).
add_custom_command(
OUTPUT "${TABLE_DESTDIR}/${TBLWE}.tbl"
COMMAND ${CMAKE_C_COMPILER} ${TBL_CFLAGS}
-DCFE_PLATFORM_CPU_ID=${${TGT}_PROCESSORID}
-DCFE_PLATFORM_CPU_NAME="${TGT}"
-c -o ${TBLWE}.o ${TBL_SRC}
COMMAND ${CMAKE_C_COMPILER} ${TBL_CFLAGS} -c -o ${TBLWE}.o ${TBL_SRC}
COMMAND ${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl ${TBLWE}.o
DEPENDS ${MISSION_BINARY_DIR}/tools/elf2cfetbl/elf2cfetbl ${TBL_SRC}
WORKING_DIRECTORY ${TABLE_DESTDIR}
Expand Down
4 changes: 2 additions & 2 deletions cmake/global_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ function(read_targetconfig)
endwhile()

foreach(CPUNAME ${MISSION_CPUNAMES})
if (DEFINED SIMULATION)
if (SIMULATION)
# if simulation use simulation system architecture for all targets
set(TOOLCHAIN_NAME "${SIMULATION}")
elseif (DEFINED ${CPUNAME}_SYSTEM)
elseif (${CPUNAME}_SYSTEM)
# get the target system arch identifier string
set(TOOLCHAIN_NAME "${${CPUNAME}_SYSTEM}")
else()
Expand Down
99 changes: 70 additions & 29 deletions cmake/sample_defs/cpu1_msgids.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,53 +41,94 @@

#include "cfe_mission_cfg.h"

/**
* \brief Platform command message ID base offset
*
* Example mechanism for setting default command bits and deconflicting MIDs across multiple
* platforms in a mission. For any sufficiently complex mission this method is
* typically replaced by a centralized message ID management scheme.
*
* 0x1800 - Nominal value for default message ID implementation (V1). This sets the command
* field and the secondary header present field. Typical V1 command MID range
* is 0x1800-1FFF. Additional cpus can deconflict message IDs by incrementing
* this value to provide sub-allocations (0x1900 for example).
* 0x0080 - Command bit for MISSION_MSGID_V2 message ID implementation (V2). Although
* this can be used for the value below due to the relatively small set
* of MIDs in the framework it will not scale so an alternative
* method of deconfliction is recommended.
*/
#define CFE_PLATFORM_CMD_MID_BASE 0x1800

/**
* \brief Platform telemetry message ID base offset
*
* 0x0800 - Nominal for message ID V1
* 0x0000 - Potential value for MISSION_MSGID_V2, but limited to a range of
* 0x0000-0x007F since the command bit is 0x0080. Alternative
* method of deconfliction is recommended.
*
* See #CFE_PLATFORM_CMD_MID_BASE for more information
*/
#define CFE_PLATFORM_TLM_MID_BASE 0x0800

/**
* \brief "Global" command message ID base offset
*
* 0x1860 - Nominal value for message ID V1
* 0x00E0 - Potential value for MISSION_MSGID_V2, note command bit is 0x0080.
* Works in limited cases only, alternative method of deconfliction
* is recommended.
* See #CFE_PLATFORM_CMD_MID_BASE for more information
*/
#define CFE_PLATFORM_CMD_MID_BASE_GLOB 0x1860

/*
** cFE Command Message Id's
*/
#define CFE_EVS_CMD_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_EVS_CMD_MSG /* 0x1801 */
#define CFE_EVS_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_CMD_MSG /* 0x1801 */
/* Message ID 0x1802 is available */
#define CFE_SB_CMD_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_SB_CMD_MSG /* 0x1803 */
#define CFE_TBL_CMD_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_TBL_CMD_MSG /* 0x1804 */
#define CFE_TIME_CMD_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_TIME_CMD_MSG /* 0x1805 */
#define CFE_ES_CMD_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_ES_CMD_MSG /* 0x1806 */
#define CFE_SB_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_CMD_MSG /* 0x1803 */
#define CFE_TBL_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_CMD_MSG /* 0x1804 */
#define CFE_TIME_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_CMD_MSG /* 0x1805 */
#define CFE_ES_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_CMD_MSG /* 0x1806 */

#define CFE_ES_SEND_HK_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_ES_SEND_HK_MSG /* 0x1808 */
#define CFE_EVS_SEND_HK_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_EVS_SEND_HK_MSG /* 0x1809 */
#define CFE_ES_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_ES_SEND_HK_MSG /* 0x1808 */
#define CFE_EVS_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_EVS_SEND_HK_MSG /* 0x1809 */
/* Message ID 0x180A is available */
#define CFE_SB_SEND_HK_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_SB_SEND_HK_MSG /* 0x180B */
#define CFE_TBL_SEND_HK_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_TBL_SEND_HK_MSG /* 0x180C */
#define CFE_TIME_SEND_HK_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_TIME_SEND_HK_MSG /* 0x180D */
#define CFE_SB_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SEND_HK_MSG /* 0x180B */
#define CFE_TBL_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TBL_SEND_HK_MSG /* 0x180C */
#define CFE_TIME_SEND_HK_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_SEND_HK_MSG /* 0x180D */

#define CFE_SB_SUB_RPT_CTRL_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_SB_SUB_RPT_CTRL_MSG /* 0x180E */
#define CFE_SB_SUB_RPT_CTRL_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_SB_SUB_RPT_CTRL_MSG /* 0x180E */

#define CFE_TIME_TONE_CMD_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_TIME_TONE_CMD_MSG /* 0x1810 */
#define CFE_TIME_1HZ_CMD_MID CFE_MISSION_CMD_MID_BASE1 + CFE_MISSION_TIME_1HZ_CMD_MSG /* 0x1811 */
#define CFE_TIME_TONE_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_TONE_CMD_MSG /* 0x1810 */
#define CFE_TIME_1HZ_CMD_MID CFE_PLATFORM_CMD_MID_BASE + CFE_MISSION_TIME_1HZ_CMD_MSG /* 0x1811 */


/*
** cFE Global Command Message Id's
*/
#define CFE_TIME_DATA_CMD_MID CFE_MISSION_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_DATA_CMD_MSG /* 0x1860 */
#define CFE_TIME_SEND_CMD_MID CFE_MISSION_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_SEND_CMD_MSG /* 0x1862 */
#define CFE_TIME_DATA_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_DATA_CMD_MSG /* 0x1860 */
#define CFE_TIME_SEND_CMD_MID CFE_PLATFORM_CMD_MID_BASE_GLOB + CFE_MISSION_TIME_SEND_CMD_MSG /* 0x1862 */


/*
** CFE Telemetry Message Id's
*/
#define CFE_ES_HK_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_ES_HK_TLM_MSG /* 0x0800 */
#define CFE_EVS_HK_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_EVS_HK_TLM_MSG /* 0x0801 */
#define CFE_ES_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_HK_TLM_MSG /* 0x0800 */
#define CFE_EVS_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_HK_TLM_MSG /* 0x0801 */
/* Message ID 0x0802 is available */
#define CFE_SB_HK_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_SB_HK_TLM_MSG /* 0x0803 */
#define CFE_TBL_HK_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_TBL_HK_TLM_MSG /* 0x0804 */
#define CFE_TIME_HK_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_TIME_HK_TLM_MSG /* 0x0805 */
#define CFE_TIME_DIAG_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_TIME_DIAG_TLM_MSG /* 0x0806 */
#define CFE_EVS_LONG_EVENT_MSG_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_EVS_LONG_EVENT_MSG_MSG /* 0x0808 */
#define CFE_EVS_SHORT_EVENT_MSG_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG /* 0x0809 */
#define CFE_SB_STATS_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_SB_STATS_TLM_MSG /* 0x080A */
#define CFE_ES_APP_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_ES_APP_TLM_MSG /* 0x080B */
#define CFE_TBL_REG_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_TBL_REG_TLM_MSG /* 0x080C */
#define CFE_SB_ALLSUBS_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_SB_ALLSUBS_TLM_MSG /* 0x080D */
#define CFE_SB_ONESUB_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_SB_ONESUB_TLM_MSG /* 0x080E */
#define CFE_ES_MEMSTATS_TLM_MID CFE_MISSION_TLM_MID_BASE1 + CFE_MISSION_ES_MEMSTATS_TLM_MSG /* 0x0810 */
#define CFE_SB_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_HK_TLM_MSG /* 0x0803 */
#define CFE_TBL_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_HK_TLM_MSG /* 0x0804 */
#define CFE_TIME_HK_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_HK_TLM_MSG /* 0x0805 */
#define CFE_TIME_DIAG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TIME_DIAG_TLM_MSG /* 0x0806 */
#define CFE_EVS_LONG_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_LONG_EVENT_MSG_MSG /* 0x0808 */
#define CFE_EVS_SHORT_EVENT_MSG_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_EVS_SHORT_EVENT_MSG_MSG /* 0x0809 */
#define CFE_SB_STATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_STATS_TLM_MSG /* 0x080A */
#define CFE_ES_APP_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_APP_TLM_MSG /* 0x080B */
#define CFE_TBL_REG_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_TBL_REG_TLM_MSG /* 0x080C */
#define CFE_SB_ALLSUBS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ALLSUBS_TLM_MSG /* 0x080D */
#define CFE_SB_ONESUB_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ONESUB_TLM_MSG /* 0x080E */
#define CFE_ES_MEMSTATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_MEMSTATS_TLM_MSG /* 0x0810 */

#endif
9 changes: 2 additions & 7 deletions cmake/sample_defs/cpu1_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
#ifndef _cfe_platform_cfg_
#define _cfe_platform_cfg_

/*
** Allow reference to CFE_MISSION_SPACECRAFT_ID (see CFE_TBL_VALID_ definitions below)
*/
#include "cfe_mission_cfg.h"

/**
** \cfesbcfg Maximum Number of Unique Message IDs SB Routing Table can hold
**
Expand Down Expand Up @@ -1742,7 +1737,7 @@
** \par Limits
** This value can be any 32 bit unsigned integer.
*/
#define CFE_PLATFORM_TBL_VALID_SCID_1 (CFE_MISSION_SPACECRAFT_ID)
#define CFE_PLATFORM_TBL_VALID_SCID_1 (0x42)
#define CFE_PLATFORM_TBL_VALID_SCID_2 (CFE_PLATFORM_TBL_U32FROM4CHARS('a', 'b', 'c', 'd'))

/**
Expand Down Expand Up @@ -1776,7 +1771,7 @@
** \par Limits
** This value can be any 32 bit unsigned integer.
*/
#define CFE_PLATFORM_TBL_VALID_PRID_1 (10)
#define CFE_PLATFORM_TBL_VALID_PRID_1 (1)
#define CFE_PLATFORM_TBL_VALID_PRID_2 (CFE_PLATFORM_TBL_U32FROM4CHARS('a', 'b', 'c', 'd'))
#define CFE_PLATFORM_TBL_VALID_PRID_3 0
#define CFE_PLATFORM_TBL_VALID_PRID_4 0
Expand Down
71 changes: 0 additions & 71 deletions cmake/sample_defs/sample_mission_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,6 @@
#define _cfe_mission_cfg_


/**
** \cfemissioncfg Spacecraft ID
**
** \par Description:
** This defines the value that is returned by the call to
** CFE_PSP_GetSpacecraftId.
**
** \par Limits
** The cFE does not place a limit on this configuration paramter.
** CCSDS allocates 8 bits for this field in the standard VCDU.
*/
#define CFE_MISSION_SPACECRAFT_ID 0x42


/**
** \cfemissioncfg cFE SB message format
**
** \par Description:
** Dictates the message format used by the cFE.
**
** \par Limits
** All versions of the cFE currently support only CCSDS as the message format
** Defining MESSAGE_FORMAT_IS_CCSDS_VER_2 implements the APID extended header format
** MESSAGE_FORMAT_IS_CCSDS_VER_2 is optional
*/
/* #define MESSAGE_FORMAT_IS_CCSDS_VER_2 */
#undef MESSAGE_FORMAT_IS_CCSDS_VER_2


/**
** \cfesbcfg Maximum SB Message Size
**
Expand Down Expand Up @@ -335,48 +306,6 @@
#define CFE_MISSION_TBL_MAX_NAME_LENGTH 16


/**
** \cfemissioncfg cFE Message ID Base Numbers
**
** \par Description:
** Message Id base numbers for the cFE messages
** These will now differ in format when using CCSDS version 2 as they will no longer
** include the Secondary Header Flag and CCSDS version bits.
**
** NOTES: cFE MsgIds are the sum of the base numbers and the portable msg
** numbers.
**
** For MESSAGE_FORMAT_IS_CCSDS_VER_2 These base MsgIds values are dependent on the
** values returned by the following SB Macros to form a 16 bit message ID (default
** macro definitions are in cfe_sb_msg_id_utils.h, default values below are
** representative of default macro definitions) :
** CFE_SB_CMD_MESSAGE_TYPE, CFE_SB_RD_APID_FROM_MSGID
** CFE_SB_RD_SUBSYS_ID_FROM_MSGID and CFE_SB_RD_TYPE_FROM_MSGID
**
** \par Limits
** Must be less than CFE_PLATFORM_SB_HIGHEST_VALID_MSGID
*/
#ifndef MESSAGE_FORMAT_IS_CCSDS_VER_2
#define CFE_MISSION_CMD_MID_BASE1 0x1800
#define CFE_MISSION_TLM_MID_BASE1 0x0800
#else
#define CFE_MISSION_CMD_MID_BASE1 0x0080
#define CFE_MISSION_TLM_MID_BASE1 0x0000
#endif

#define CFE_MISSION_CMD_APPID_BASE1 1
#define CFE_MISSION_TLM_APPID_BASE1 0

#ifndef MESSAGE_FORMAT_IS_CCSDS_VER_2
#define CFE_MISSION_CMD_MID_BASE_GLOB 0x1860
#define CFE_MISSION_TLM_MID_BASE_GLOB 0x0860
#else
#define CFE_MISSION_CMD_MID_BASE_GLOB 0x00E0
#define CFE_MISSION_TLM_MID_BASE_GLOB 0x0060
#endif



/**
** \cfemissioncfg cFE Portable Message Numbers for Commands
**
Expand Down
29 changes: 13 additions & 16 deletions docs/src/cfe_sb.dox
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,29 @@
All commands, telemetry, and other data that are passed between the ground and
the spacecraft, and between subsystems of the spacecraft, are considered to be
messages. The most common message format is CCSDS (Consultative Committee for
Space Data Systems).

The cFE software bus was designed with 'hooks' to allow message formats other
than CCSDS to be used. The APIs that are used to set and get message header
fields are intentionally designed to be decoupled from CCSDS.
Space Data Systems) in <a href="https://public.ccsds.org/Pubs/133x0b2.pdf">
CCSDS Space Packet Protocol</a>, but can be customized by replacing the message module.

There are two general types of messages - commands (or command packets) and
telemetry (or telemetry packets). Command packets are sent to a particular
software task from the ground (or another task). Telemetry packets are sent
from a particular software task to the ground (or other tasks).

Each packet begins with a header that includes the message identifier, often
abbreviated as MsgId or message ID. The MsgId for CCSDS messages is the first
16 bits of the packet. The message 'type' indicator (command or telemetry) is
embedded in the Message ID. The header also contains a packet length field and a
packet sequence field. The packet sequence field is incremented by the software
bus for telemetry packets each time a packet is sent. The software bus does not
increment the sequence field for command packets. See the section named 'Packet
Sequence Values' for more detail.

The concept of a message identifier is utilized to provide abstraction
from header implementation, often abbreviated as message ID, MsgId, or MID.
Header and message identifier values should not be accessed directly to
avoid implementation specific dependencies.

Telemetry packets typically contain a timestamp that indicates when the packet
was produced. Command packets typically contain a command code that identifies
the particular type of command.

The software bus provides APIs for 'setting' and 'getting' the fields in the
header of the message.
The message module provides APIs for 'setting' and 'getting' the fields in the
header of the message. The message module was separated from software bus
to enable users to customize message headers without requiring clone and
own of the entire cfe repository. To customize, remove the built in msg
module from the build and replace with custom implementation. See sample
target definitions folder for examples.

Following the header is the user defined message data.

Expand Down
6 changes: 2 additions & 4 deletions fsw/cfe-core/src/es/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,13 @@ void CFE_ES_StartApplications(uint32 ResetType, const char *StartFilePath )
/*
** Open the file in the volatile disk.
*/
Status = OS_open( CFE_PLATFORM_ES_VOLATILE_STARTUP_FILE, OS_READ_ONLY, 0);
Status = OS_OpenCreate(&AppFile, CFE_PLATFORM_ES_VOLATILE_STARTUP_FILE, OS_FILE_FLAG_NONE, OS_READ_ONLY);

if ( Status >= 0 )
{
CFE_ES_WriteToSysLog ("ES Startup: Opened ES App Startup file: %s\n",
CFE_PLATFORM_ES_VOLATILE_STARTUP_FILE);
FileOpened = true;
AppFile = OS_ObjectIdFromInteger(Status);
}
else
{
Expand All @@ -120,13 +119,12 @@ void CFE_ES_StartApplications(uint32 ResetType, const char *StartFilePath )
/*
** Try to Open the file passed in to the cFE start.
*/
Status = OS_open( (const char *)StartFilePath, OS_READ_ONLY, 0);
Status = OS_OpenCreate(&AppFile, StartFilePath, OS_FILE_FLAG_NONE, OS_READ_ONLY);

if ( Status >= 0 )
{
CFE_ES_WriteToSysLog ("ES Startup: Opened ES App Startup file: %s\n",StartFilePath);
FileOpened = true;
AppFile = OS_ObjectIdFromInteger(Status);
}
else
{
Expand Down
3 changes: 1 addition & 2 deletions fsw/cfe-core/src/es/cfe_es_erlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ bool CFE_ES_RunERLogDump(uint32 ElapsedTime, void *Arg)
}

FileSize = 0;
Status = OS_creat(State->DataFileName, OS_WRITE_ONLY);
Status = OS_OpenCreate(&fd, State->DataFileName, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY);
if(Status < 0)
{
CFE_EVS_SendEvent(CFE_ES_ERLOG2_ERR_EID,CFE_EVS_EventType_ERROR,
Expand All @@ -216,7 +216,6 @@ bool CFE_ES_RunERLogDump(uint32 ElapsedTime, void *Arg)
}
else
{
fd = OS_ObjectIdFromInteger(Status);
CFE_FS_InitHeader(&FileHdr, CFE_ES_ER_LOG_DESC, CFE_FS_SubType_ES_ERLOG);

/* write the cFE header to the file */
Expand Down
9 changes: 3 additions & 6 deletions fsw/cfe-core/src/es/cfe_es_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,9 @@ bool CFE_ES_RunPerfLogDump(uint32 ElapsedTime, void *Arg)
{
case CFE_ES_PerfDumpState_OPEN_FILE:
/* Create the file to dump to */
Status = OS_creat(State->DataFileName, OS_WRITE_ONLY);
if (Status >= 0)
{
State->FileDesc = OS_ObjectIdFromInteger(Status);
}
else
Status = OS_OpenCreate(&State->FileDesc, State->DataFileName,
OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY);
if (Status < 0)
{
State->FileDesc = OS_OBJECT_ID_UNDEFINED;
CFE_EVS_SendEvent(CFE_ES_PERF_LOG_ERR_EID,CFE_EVS_EventType_ERROR,
Expand Down
Loading