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.

RTOS/PROCESSOR-SDK-AM335X: Task definition

Part Number: PROCESSOR-SDK-AM335X

Tool/software: TI-RTOS

hello

every expects

This is Tomiyama from Tokyo.

When I code task in app.cfg file just as bellow:

var task1Params = new Task.Params();
task1Params.instance.name = "taskHeadCyc";
Program.global.taskHeadCyc = Task.create("&taskHeadCyc", task1Params);

Q1.Are there need to write main.c with this code:

    Task_Params_init(&task1Params);
    task1Params.instance->name = "task2";
    task1Params.stackSize = 2048;
    task1Params.arg0 = 2;
    task1Params.priority = 15;
    Error_init(&eb);
    task = Task_create(taskHeadCyc, &task1Params, &eb);
    if (task == NULL) {
        System_printf("Task_create() failed!\n");
        BIOS_exit(0);
    }

Q2.If there are no need to write code with upper code, How can I call the task fuction ?

I need your help.

Thank you very much.

Tomiyama.

  • The RTOS team have been notified. They will respond here.
  • Tomiyama,

    Please follow this example in the Processor SDK RTOS package for AM335x C:\ti\pdk_am335x_1_0_9\packages\MyExampleProjects\USB_DevMsc_evmAM335x_armExampleProject

    It shows you how to setup your tasks for a USB applicaiton.

    You will see that main() looks like below in this example

    int main(void)
    {
    
        Task_Handle task;
        Error_Block eb;
    
        Board_initCfg boardCfg;
        boardCfg = BOARD_INIT_MODULE_CLOCK |
            BOARD_INIT_PINMUX_CONFIG |
            BOARD_INIT_UART_STDIO;
        Board_init(boardCfg);
    
        Error_init(&eb);
        task = Task_create(taskFxn, NULL, &eb);
        if (task == NULL) {
            System_printf("Task_create() failed!\n");
            BIOS_exit(0);
        }

    Lali