Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

RTOS: Do we have to use RTOS Task for running IPC MessageQ example 02?

$
0
0

Tool/software: TI-RTOS

Hi there, I have got the basic IPC example working on the OMAPL138 LCDK.

The SDK is v4.0.0.4 and Linux is 4.9.28

I am trying to modify the example such that , the smain function doesn't use TI-RTOS Task. Is this possible? as I am not able to get this working?? 

/*
* ======== main ========
*/
Int main(Int argc, Char* argv[])
{
Error_Block eb;
Task_Params taskParams;

Log_print0(Diags_ENTRY, "--> main:");

/* must initialize the error block before using it */
Error_init(&eb);

/* create main thread (interrupts not enabled in main on BIOS) */
Task_Params_init(&taskParams);
taskParams.instance->name = "smain";
taskParams.arg0 = (UArg)argc;
taskParams.arg1 = (UArg)argv;
taskParams.stackSize = 0x1000;
Task_create(smain, &taskParams, &eb);

if (Error_check(&eb)) {
System_abort("main: failed to create application startup thread");
}

/* start scheduler, this never returns */
BIOS_start();

/* should never get here */
Log_print0(Diags_EXIT, "<-- main:");
return (0);
}

/*
* ======== smain ========
*/
Void smain(UArg arg0, UArg arg1)
{
Int status = 0;
Error_Block eb;
Bool running = TRUE;

Log_print0(Diags_ENTRY | Diags_INFO, "--> smain:");

Error_init(&eb);

/* initialize modules */
Server_init();

/* turn on Diags_INFO trace */
Diags_setMask("Server+F");

/* loop forever */
while (running) {

/* BEGIN server phase */

/* server setup phase */
status = Server_create();

if (status < 0) {
goto leave;
}

/* server execute phase */
status = Server_exec();

if (status < 0) {
goto leave;
}

/* server shutdown phase */
status = Server_delete();

if (status < 0) {
goto leave;
}

/* END server phase */

} /* while (running) */

/* finalize modules */
Server_exit();

leave:
Log_print1(Diags_EXIT, "<-- smain: %d", (IArg)status);
return;
}


Viewing all articles
Browse latest Browse all 17527

Trending Articles