DSPRelated.com
Forums

Creating DSP/BIOS TSK dynamically issues

Started by alva...@gmail.com July 21, 2011
Hi all,

I am working with an application that creates a TSK-object dynamically on a C6727 device. The code looks like this:

void func()
{
void processA(unsigned int *ps);
TSK_Handle task;
TSK_Attrs Attr;
Attr = TSK_ATTRS;
Attr.priority = 15;
Attr.stacksize = 1024;

...

task = TSK_create((Fxn)processA,&Attr, ps);
}

void processA(unsigned int *ps)
{
LOG_printf(&trace, "inside processA");
}

This works fine, but my question is: It is possible to return a value from the function called by TSK_create (processA in the example)? For my application, it is interesting that the dynamic TSK returns a value like "true or false" or even a flag.

Setup: CCS v4.1.3.00038, DSP/BIOS v5.41.02.14, SD XDS510USB emulator, C6727 custom board.

Thanks in advance,
Best regards.

_____________________________________
Alvaro-

> I am working with an application that creates a TSK-object
> dynamically on a C6727 device. The code looks like this:
>
> void func()
> {
> void processA(unsigned int *ps);
> TSK_Handle task;
> TSK_Attrs Attr;
> Attr = TSK_ATTRS;
> Attr.priority = 15;
> Attr.stacksize = 1024;
>
> ...
>
> task = TSK_create((Fxn)processA,&Attr, ps);
> }
>
> void processA(unsigned int *ps)
> {
> LOG_printf(&trace, "inside processA");
> }
>
> This works fine, but my question is: It is possible to
> return a value from the function called by TSK_create
> (processA in the example)? For my application, it is
> interesting that the dynamic TSK returns a value like
> "true or false" or even a flag.

Possibly you could create a wrapper, like TSK_create_Ex() that has another param, and the wrapper calls TSK_create()
and does something like wait for the newly created task to do something (set a shared mem var), then returns that var.
So the wrapper might do something 'ugly' but hides it.

Otherwise, maybe you could talk to TI about modifying their BIOS internal code... likely to be a challenging path :-)

-Jeff

> Setup: CCS v4.1.3.00038, DSP/BIOS v5.41.02.14, SD
> XDS510USB emulator, C6727 custom board.

_____________________________________
Ok, it seems to work. Thank you Jeff.

Thanks also for the TI BIOS developers advice; maybe I could... :)

best regards.

Hi all,
>
>I am working with an application that creates a TSK-object dynamically on a C6727 device. The code looks like this:
>
> void func()
> {
> void processA(unsigned int *ps);
> TSK_Handle task;
> TSK_Attrs Attr;
> Attr = TSK_ATTRS;
> Attr.priority = 15;
> Attr.stacksize = 1024;
>
> ...
>
> task = TSK_create((Fxn)processA,&Attr, ps);
> }
>
> void processA(unsigned int *ps)
> {
> LOG_printf(&trace, "inside processA");
> }
>
>This works fine, but my question is: It is possible to return a value from the function called by TSK_create (processA in the example)? For my application, it is interesting that the dynamic TSK returns a value like "true or false" or even a flag.
>
>Setup: CCS v4.1.3.00038, DSP/BIOS v5.41.02.14, SD XDS510USB emulator, C6727 custom board.
>
>Thanks in advance,
>Best regards.
>
>_____________________________________

_____________________________________