This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Not Task Create...Help me.

Other Parts Discussed in Thread: AM3359

hi everyone.

quetion of create task...

 

My Development Environment.

target board : AM335x EVM IDK

IDE : CCS 5(lasted)

sample app : EtherCAT slave

OS : SYS/BIOS

SDK : TI IDK SDK 1.0.0.8

 

console output. 

(1)

TI Industrial SDK Version : 1.0.0.8

 Device name     : AM3359

 Chip Revision   : AM335x ES1.1 [PG2]

 ARM Clock rate  : 600

 Device Type     : EtherCAT Device

TI EtherCAT Demo Application Build - 3.0.0 - running on IDK

Ecat_Open : 0

SYNC0 task started

Protocol task started

I2C_Operation...

HWConfig_Read OK

CAN_Operation...

Please Input

1) ECS_CMD_INTERVAL:500

2) ECS_CMD_INTERVAL:250

3) Read EEPROM

 

Problem code.

(2)

    u8Err = (Uint8)Ecat_Open();

    if(u8Err == 0)     {       

UARTprintf( "Ecat_Open\r\n" );       

//assign application function pointer       

pApplication = &Demo_Application;

      

/* Create tasks */       

 /* Create tree tasks that share a resource*/        

Task_Params_init(&taskParams);        

taskParams.priority = 6;        

taskParams.stackSize = 1512;        

pdiTask = Task_create (PDItask, &taskParams, NULL);

       

Task_Params_init(&taskParams);        

taskParams.priority = 8;        

taskParams.stackSize = 1512;        

sync0Task = Task_create (Sync0task, &taskParams, NULL);

       

Task_Params_init(&taskParams);        

taskParams.priority = 10;        

taskParams.stackSize = 1512;        

ledTaskHndl = Task_create (LEDtask, &taskParams, NULL);

 

Only running Sync0task.

Not running PDItask, LEDtask.

 

My code execute in order to  the methods were used.

(3)

Void Sync0task(UArg arg1, UArg arg2)

{  

Task_Params taskParams;

#ifndef EXEC_FROM_IRAM

#ifndef NO_UART_MSG_APP    

UARTPutString(uartInstance,"SYNC0 task started\n\r");

#endif

#endif    

Task_Params_init(&taskParams);    

taskParams.priority  = 12;    

taskParams.stackSize = 1512;    

protocolTask = Task_create (Protocol_Task, &taskParams, NULL);

    while(1)    

    {        

     PRUSSDRVPruWaitEvent(HOST_SYNC0_EVENT);        

     //Do sync0 event handling        

     DISABLE_ESC_INT();        

     Sync0_Isr();        

     ENABLE_ESC_INT();

    }

 }

Void Protocol_Task( UArg arg1, UArg arg2 )

{  

     UARTPutString(uartInstance,"Protocol task started\n\r");

 

     ECS_I2C_Init();  

     ECS_DCAN_Init();

     while ( 1 )

     {    

         I2C_Operation_Task();    

         CAN_Operation_Task();  

      }

 }

 

(2) to "Task_create (Protocol_Task, &taskParams, NULL)" If you add the "task" not run.

 Due to "UARTprintf( "Ecat_Open\r\n" )" know that the code is executed.

 

thank you.

chae.

 

  • Hi Chae,

    sorry, but I don't understand the problem... Your prints at the top seem to indicate that all the tasks have been started. Did you try single stepping through the code?

    Using a lot of while(1) code might get you stuck in a high prio task... try to insert some task_sleep or _yield.

    Regards.

  • Answer Thank you.

    Confusing. For the key "Sync0task" will be run only.

    This code is not mine. (TI provides the source code).

     for the task creation, I called "task create API" in the Sync0task.

    This is not the correct solution.

    I do not know why you do not create a task.