-
Notifications
You must be signed in to change notification settings - Fork 331
Description
Hi,
I'm working on an IMU application that connects and logs IMU data.
I have a function IMU_InitSensor() that initializes the sensor and returns CFE_SUCCESS if initialization succeeds and -1 otherwise. if the return value is -1, the App will exit.
I'm trying to run the app when the sensor is physically disconnected to make sure I get the correct behavior, but I'm getting this error message:
`
1980-012-14:03:21.76253 Application IMU called CFE_ES_ExitApp
EVS Port1 42/1/CFE_ES 48: ES_ProcControlReq: Unknown State ( 1 ) Application IMU.
`
Here is my AppMain:
``
void IMU_AppMain()
{
int32 iStatus = CFE_SUCCESS;
uint32 taskId = 0;
`
/* Start Performance Log entry */
//CFE_ES_PerfLogEntry(IMU_MAIN_TASK_PERF_ID);
/* Perform application initializations */
if (IMU_InitApp() != CFE_SUCCESS)
{
g_IMU_AppData.uiRunStatus = CFE_ES_APP_EXIT;
goto IMU_AppMain_Exit_Tag;
}
else if (IMU_InitSensor() != CFE_SUCCESS)//returns 0 on success and -1 #otherwise
{
g_IMU_AppData.uiRunStatus = CFE_ES_APP_EXIT;
goto IMU_AppMain_Exit_Tag;
}
else {
/* Do not perform performance monitoring on startup sync */
CFE_ES_PerfLogExit(IMU_MAIN_TASK_PERF_ID);
CFE_ES_WaitForStartupSync(IMU_TIMEOUT_MSEC);
CFE_ES_PerfLogEntry(IMU_MAIN_TASK_PERF_ID);
}
iStatus = CFE_ES_CreateChildTask(&taskId,
"IMU Child Task",
IMU_ChildTask,
IMU_CHILD_TASK_STACK_PTR,
IMU_CHILD_TASK_STACK_SIZE,
IMU_CHILD_TASK_PRIO,
0);
if(iStatus != CFE_SUCCESS)
{
g_IMU_AppData.uiRunStatus = CFE_ES_APP_ERROR;
CFE_ES_WriteToSysLog("IMU - Failed to create child task\n");
goto IMU_AppMain_Exit_Tag;
}
/* Application main loop */
while (CFE_ES_RunLoop(&g_IMU_AppData.uiRunStatus) == TRUE)
{
CFE_ES_PerfLogExit(IMU_MAIN_TASK_PERF_ID);
iStatus = IMU_RcvMsg(CFE_SB_POLL);
}
/* Stop Performance Log entry */
CFE_ES_PerfLogExit(IMU_MAIN_TASK_PERF_ID);
IMU_AppMain_Exit_Tag: /* Exit the application */ CFE_ES_WriteToSysLog("IMU - Exiting App...\n"); CFE_ES_ExitApp(g_IMU_AppData.uiRunStatus); }
Any help? Thanks!