OSA_TaskCreate MQX-BUG(?)

cancel
Showing results for 
Search instead for 
Did you mean: 

OSA_TaskCreate MQX-BUG(?)

Jump to solution
939 Views
oaf
Contributor IV

Hi,

 

From what I could see, the 'name' parameter is forgotten when create an MQX task (I've added it inside the #if1 / #endif).

File: C:\Freescale\KSDK_1.1.0\platform\osa\src\fsl_os_abstraction_mqx.c

 

osa_status_t OSA_TaskCreate(task_t      task,
                     uint8_t    *name,
                     uint16_t    stackSize,
                     task_stack_t   *stackMem,
                     uint16_t    priority,
                     task_param_tparam,
                     bool        usesFloat,
                     task_handler_t *handler)

{

taskinit_t task_parameters = {

#if 1

    .name = (char *)name,
#endif  
    .exec   = task,
    .stacksize  = stackSize,
    .stackaddr  = stackSize == 0 ? NULL : stackMem,
    .priority   = PRIORITY_OSA_TO_RTOS(priority),
    .exec_param = (void *)param,
};

 

*handler = create_task(&task_parameters);

 

if (MQX_NULL_TASK_ID != *handler)
{
    return kStatus_OSA_Success;
}
else
{
    return kStatus_OSA_Error;
}

}

Labels (1)
Tags (3)
0 Kudos
1 Solution
391 Views
oaf
Contributor IV

Hi,

Sorry, I've not checked my inbox for a long time.

Yes, thanks the problem is solved.

View solution in original post

0 Kudos
5 Replies
391 Views
ivadorazinova
NXP Employee
NXP Employee

Hello Ole Asbjorn Fadum,


please, can you attach whole project?

I will test on my side.

Thank you,

Best Regards,

Iva

0 Kudos
391 Views
oaf
Contributor IV

Hi,

Sorry the project could not be uploaded. We are using a 'MK64FN1M0VMD12 in MAPBGA 144-pin package', and MQX.

A couple of tasks are added with PEx, and one is added with code like this:

        const char *const taskName = "TxTask";

if(OSA_TaskCreate(TXT_MainTask,
        (uint8_t *)taskName,
        TXT_config.stackSize,
            NULL,
            TXT_config.taskPriority,
            NULL,
            false,
            &tmpHandle) == kStatus_OSA_Success)
    {
            TXT_taskHandle = tmpHandle;
    }
    else
    {
            printf("OSA_TaskCreate(TXT_MainTask) FAILED!!!\n");
    }

When inspecting the 'MQX Task List' in the Debug-view my task is shown without a name

0 Kudos
390 Views
ivadorazinova
NXP Employee
NXP Employee

Hello Ole,

please, does my reply solve your issue?

Thank you for your answer,

Iva

0 Kudos
392 Views
oaf
Contributor IV

Hi,

Sorry, I've not checked my inbox for a long time.

Yes, thanks the problem is solved.

View solution in original post

0 Kudos
391 Views
ivadorazinova
NXP Employee
NXP Employee

Hello Ole,

yes and the issue was solved.

"name" parameter was added in KSDK V1.2

osa_status_t OSA_TaskCreate(task_t      task,
                     uint8_t    *name,
                     uint16_t    stackSize,
                     task_stack_t   *stackMem,
                     uint16_t    priority,
                     task_param_tparam,
                     bool        usesFloat,
                     task_handler_t *handler)

{

taskinit_t task_parameters;
task_parameters.exec   = task;
task_parameters.stacksize  = stackSize;
task_parameters.stackaddr  = stackSize == 0 ? NULL : stackMem;
task_parameters.priority   = PRIORITY_OSA_TO_RTOS(priority);
task_parameters.name  = (char *)name;
task_parameters.exec_param = (void *)param;
task_parameters.attributes = MQX_AUTO_START_TASK |

#if MQX_HAS_TIME_SLICE

                             MQX_TIME_SLICE_TASK |

#endif

                             (usesFloat ? MQX_FLOATING_POINT_TASK : 0U);
task_parameters.time_slice = 0U;

*handler = create_task(&task_parameters);

if (MQX_NULL_TASK_ID != *handler)
{
    return kStatus_OSA_Success;
}
else
{
    return kStatus_OSA_Error;
}

}

I hope this helps,

Best Regards,

Iva