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/CC2640R2F: ROV error when I wrapper a Task_Struct in a user defined struct

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Tool/software: TI-RTOS

Hi, sir,

I met a strange problem. When I wrap a Task_Struct in a user defined struct, ROV will not display the information of tasks.

Here is what I did in raw example multi_role in simplelink_cc2640r2_sdk_1_30_00_25:

struct my_task {
    int task_id;
    int priority;
    uint8_t *name;
    uint32_t stack_size;
    uint8_t *task_stack;
    Task_Struct *task_obj;
};

static struct my_task myMultiRoleTask;

void multi_role_createTask(void)
{
    Task_Params taskParams;

    // Configure task
    Task_Params_init(&taskParams);
    taskParams.stack = mrTaskStack;
    taskParams.stackSize = MR_TASK_STACK_SIZE;
    taskParams.priority = MR_TASK_PRIORITY;

    myMultiRoleTask.name = "multi role";
    myMultiRoleTask.task_id = MR_TASK_PRIORITY;
    myMultiRoleTask.priority = MR_TASK_PRIORITY;
    myMultiRoleTask.stack_size = MR_TASK_STACK_SIZE;
    myMultiRoleTask.task_obj = &mrTask;
    Task_construct(myMultiRoleTask.task_obj, multi_role_taskFxn, &taskParams, NULL);
}

Step 1:

when cc2640 is halt before myMultiRoleTask.task_obj = &mrTask,  everything is OK

but When this sentence is executed, there are something wrong in ROV

And if I use a single Task_Struct mrTask instead of  wrapping it in a struct ,  no errors appeared:

Could anyone tell my why?

I guess that  this error has relationship with data access alignment(Interfaces in ROM are all heavily optimized, so common 4bytes aligned access may cause  exception)?

  • ROV cannot find embedded constructs. Create objects have a linked list that allows ROV to find them all. For several historical reasons, we do not have a linked list of the constructed objects, so the ROV parser needs to find them. It can find globally defined structs, but not ones embedded in other structures.

    If ROV finds a constructed object before it is actually constructed, you may get an error in ROV. It goes away when the construct call is called. We are working on improving that annoyance.

    Todd
  • I have fixed the bug you reported in your earlier thread: e2e.ti.com/.../590729
    I can look into this new problem, if you can attach your executable again.
    Most likely, the cause of the problem is that you have a structure that contains a pointer to a Task structure, and that's a use case we haven't had before.
  • Great! Maybe a newer version sdk will come soon?

    Here I attach the hex and console log and hope these files would help you!5430.multi_role_with_error_rov_info.zip

  • I tested ROV against your executable, and it seems that the Task_Struct pointer inside 'myMultiRoleTask' is detected not as a pointer but as an embedded structure. That means that the memory location containing the pointer together with the locations just above it in the address space are processed as a task object, instead of following the pointer and reading the actual task object. So, ROV is reading some random values and it is detecting that the content of the task object is corrupted.

    This might be more work than the previous bug, so it may not be done for XDCtools 3.50.2.
    Unfortunately, I don't see a good workaround for this. If I figure out something while fixing the bug, I'll update this thread.
  • OK, I got it!

    Thanks for your reply.