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

Fix #410, separate SYSLOG configurable defaults for power on and proc… #625

Merged
merged 1 commit into from
Apr 28, 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
38 changes: 28 additions & 10 deletions cmake/sample_defs/cpu1_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1005,22 +1005,40 @@
#define CFE_PLATFORM_ES_DEFAULT_CDS_REG_DUMP_FILE "/ram/cfe_cds_reg.log"

/**
** \cfeescfg Define Default System Log Mode
** \cfeescfg Define Default System Log Mode following Power On Reset
**
** \par Description:
** Defines the default mode for the operation of the ES System log. The log may
** operate in either Overwrite mode = 0, where once the log becomes full the
** oldest message in the log will be overwritten, or Discard mode = 1, where
** once the log becomes full the contents of the log are preserved and the new
** event is discarded. This constant may hold a value of either 0 or 1
** depending on the desired default log mode. Overwrite Mode = 0, Discard
** Mode = 1.
** Defines the default mode for the operation of the ES System log following a power
** on reset. The log may operate in either Overwrite mode = 0, where once the
** log becomes full the oldest message in the log will be overwritten, or
** Discard mode = 1, where once the log becomes full the contents of the log are
** preserved and the new event is discarded. This constant may hold a value of
** either 0 or 1 depending on the desired default.
** Overwrite Mode = 0, Discard Mode = 1.
**
** \par Limits
** There is a lower limit of 0 and an upper limit of 1 on this configuration
** paramater.
*/
#define CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE 0

/**
** \cfeescfg Define Default System Log Mode following Processor Reset
**
** \par Description:
** Defines the default mode for the operation of the ES System log following a
** processor reset. The log may operate in either Overwrite mode = 0, where once
** the log becomes full the oldest message in the log will be overwritten, or
** Discard mode = 1, where once the log becomes full the contents of the log are
** preserved and the new event is discarded. This constant may hold a value of
** either 0 or 1 depending on the desired default.
** Overwrite Mode = 0, Discard Mode = 1.
**
** \par Limits
** There is a lower limit of 0 and an upper limit of 1 on this configuration
** paramater.
*/
#define CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE 1
#define CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE 1

/**
** \cfeescfg Define Max Number of Performance IDs
Expand Down Expand Up @@ -1997,7 +2015,7 @@
#define CFE_ES_DEFAULT_ER_LOG_FILE CFE_PLATFORM_ES_DEFAULT_ER_LOG_FILE
#define CFE_ES_DEFAULT_PERF_DUMP_FILENAME CFE_PLATFORM_ES_DEFAULT_PERF_DUMP_FILENAME
#define CFE_ES_DEFAULT_CDS_REG_DUMP_FILE CFE_PLATFORM_ES_DEFAULT_CDS_REG_DUMP_FILE
#define CFE_ES_DEFAULT_SYSLOG_MODE CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE
#define CFE_ES_DEFAULT_SYSLOG_MODE CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE
#define CFE_ES_PERF_MAX_IDS CFE_PLATFORM_ES_PERF_MAX_IDS
#define CFE_ES_PERF_DATA_BUFFER_SIZE CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE
#define CFE_ES_PERF_FILTMASK_NONE CFE_PLATFORM_ES_PERF_FILTMASK_NONE
Expand Down
11 changes: 9 additions & 2 deletions fsw/cfe-core/src/es/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,16 @@ int32 CFE_ES_TaskInit(void)
CFE_ES_TaskData.LimitCmd = 4;

/*
** Initialize systemlog to default mode
** Initialize systemlog to default Power On or Processor Reset mode
*/
CFE_ES_ResetDataPtr->SystemLogMode = CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE;
if (CFE_ES_GetResetType(NULL) == CFE_PSP_RST_TYPE_POWERON)
{
CFE_ES_ResetDataPtr->SystemLogMode = CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE;
}
else
{
CFE_ES_ResetDataPtr->SystemLogMode = CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE;
}

/*
** Register event filter table.
Expand Down
16 changes: 14 additions & 2 deletions fsw/cfe-core/unit-test/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2526,15 +2526,27 @@ void TestTask(void)
"CFE_ES_TaskInit",
"Checksum fail");

/* Test successful task main process loop */
/* Test successful task main process loop - Power On Reset Path */
ES_ResetUnitTest();
CFE_ES_Global.TaskTable[1].RecordUsed = true; /* this is needed so CFE_ES_GetAppId works */
CFE_ES_Global.TaskTable[1].AppId = 1;
CFE_ES_ResetDataPtr->ResetVars.ResetType = 2;
UT_Report(__FILE__, __LINE__,
CFE_ES_TaskInit() == CFE_SUCCESS &&
CFE_ES_TaskData.HkPacket.Payload.CFECoreChecksum != 0xFFFF,
"CFE_ES_TaskInit",
"Checksum success");
"Checksum success, POR Path");

/* Test successful task main process loop - Processor Reset Path */
ES_ResetUnitTest();
CFE_ES_Global.TaskTable[1].RecordUsed = true; /* this is needed so CFE_ES_GetAppId works */
CFE_ES_Global.TaskTable[1].AppId = 1;
CFE_ES_ResetDataPtr->ResetVars.ResetType = 1;
UT_Report(__FILE__, __LINE__,
CFE_ES_TaskInit() == CFE_SUCCESS &&
CFE_ES_TaskData.HkPacket.Payload.CFECoreChecksum != 0xFFFF,
"CFE_ES_TaskInit",
"Checksum success, PR Path");

/* Test task main process loop with a register app failure */
ES_ResetUnitTest();
Expand Down