Sign in

username:

password:



Not a member?

Search c6x



Search tips

Subscribe to c6x



c6x by Keywords

AD535 | BIOS | Booting | Bootloader | C621 | C6211 | C6415 | C671 | C6711 | C6711DSK | C6713 | CCS | Chassaing | COFF | DAT | DM64 | DM642 | DMA | DSK671 | DSK6711 | EDM | EDMA | EMIF | Emulator | EVM | EVM620 | FFT | FIR | GPIO | Halting | HPI | HWI | IDK | JTAG | LDB | LDH | LDW | Linker | LMS | LOG_printf | Matlab | McBSP | MEM_alloc | MIPS | PCI | PCM3003 | Pipeline | Profiling | QDM | Reset | ROM | RTDX | Sampling | SDRAM | Stack | TEB | THS1206 | TMS320C621 | TMS320C6416 | TMS320C6711 | TMS320C6713 | UART | Vector Table | XBUS | XDS560

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | TMS320C6x | DSP/BIOS Task compile issue

Technical discussions about the TI C6000 DSPs (including the c62x, c64x and c67x DSPs).

  

Post a new Thread

DSP/BIOS Task compile issue - balasubramanian vaidhyanathan - Sep 24 6:21:25 2008

I got my trial project to compile... Only because my file name was .cpp and
i changed to .c it compiled.... i find this strange in DSP/BIOS... Has anyone
faced this issue before?

______________________________
Start your Android Ice Cream Sandwich development on TI's AM35x Sitara ARM Cortex-A8 processor today.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: DSP/BIOS Task compile issue - William C Bonner - Sep 24 12:16:11 2008

When you couldn't get your project to compile, was it giving you errors, 
or was it simply ignoring your code?

I seem to remember something like this from when I was starting with the 
TI compiler. I am pretty sure I set a flag to cause it to recognize the 
.cpp extension as a c++ file. The extension used for recognizing a C++ 
code file varied between compilers for a long time.  Many recognized .cc 
or .C while using .c for standard C code.

balasubramanian vaidhyanathan wrote:
> I got my trial project to compile... Only because my file name was 
> .cpp and i changed to .c it compiled.... i find this strange in 
> DSP/BIOS... Has anyone faced this issue before?



______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Issue understanding this code - balasubramanian vaidhyanathan - Sep 24 20:50:37 2008

Hi
 
  Below is the code I yanked out of TI BIOS User guide. Now what i cant
understand is this, the writer task has an id. In the document it says there are
three writers. So does that mean i have to create three tasks and connect them
to _writer and give same priority and run this code so that i can have 3
writers?. I tried running with 2 writers and the code does not behave as told. I
ran with only one task and in the reader() task i removed the 2 in the loop and
the code exited properly. Please explain.I have highlighted my confusing points
in bold....
 
regards
Bala 
 
#include <std.h>
#include <log.h>
#include <mem.h>
#include <que.h>
#include <sys.h>
#include <tsk.h>
#include "queuecfg.h"
#define NUMMSGS     3      /* number of messages */
#define NUMWRITERS 3
typedef struct MsgObj {
    QUE_Elem    elem;      /* first field for QUE */
 int id;
    Char        val;       /* message value */
} MsgObj, *Msg;
 
/*
 *  ======== main ========
 */
Void main()
{
 int i;
 MsgObj *msg;
 Uns mask;
 mask=TRC_LOGTSK|TRC_LOGSWI|TRC_STSSWI|TRC_LOGCLK;
 TRC_enable(TRC_GBLHOST|TRC_GBLTARG|mask);
 msg=(MsgObj *)MEM_alloc(0,NUMMSGS*sizeof(MsgObj),0);
 if(msg==MEM_ILLEGAL)
 {
  SYS_abort("Memory allocation failed \n");
 }
 for(i=0;i<NUMMSGS;msg++,i++)
 {
  QUE_put(&freeQueue,msg);
 }
}
/* reader code */
void reader()
{
 Msg msg;
 Int i;
 for(i=0;i<NUMMSGS*2;i++)
 {
  SEM_pend(&sem,SYS_FOREVER);
  msg=QUE_get(&msgQueue);
  LOG_printf(&trace,"read '%c' from (%d)
.",msg->val,msg->id);
  QUE_put(&freeQueue,msg);
 }
 LOG_printf(&trace,"reader done\n");
}

/* writer code */
void writer(Int id)
{
 Msg msg;
 Int i;

 for(i=0;i<NUMMSGS;i++)
 {
  /* Get msg from the free queue*/
  if(QUE_empty(&freeQueue))
  {
 
   SYS_abort("Empty free queue\n");
  }
  msg=QUE_get(&freeQueue);
  /*fill in value*/
  msg->id=id;
  msg->val=(i& 0xf)+'a';
  LOG_printf(&trace,"(%d) writing '%c'...",id,msg->val);
  QUE_put(&msgQueue,msg);
  SEM_post(&sem);
 }
 LOG_printf(&trace,"Writer is done\n");
}

--- On Wed, 9/24/08, William C Bonner <w...@wimsworld.com> wrote:

From: William C Bonner <w...@wimsworld.com>
Subject: Re: [c6x] DSP/BIOS Task compile issue
To: "balasubramanian vaidhyanathan" <i...@yahoo.com>
Cc: c...@yahoogroups.com
Date: Wednesday, September 24, 2008, 11:04 AM

When you couldn't get your project to compile, was it giving you errors, 
or was it simply ignoring your code?

I seem to remember something like this from when I was starting with the 
TI compiler. I am pretty sure I set a flag to cause it to recognize the 
.cpp extension as a c++ file. The extension used for recognizing a C++ 
code file varied between compilers for a long time.  Many recognized .cc 
or .C while using .c for standard C code.

balasubramanian vaidhyanathan wrote:
> I got my trial project to compile... Only because my file name was 
> .cpp and i changed to .c it compiled.... i find this strange in 
> DSP/BIOS... Has anyone faced this issue before?

______________________________
Start your Android Ice Cream Sandwich development on TI's AM35x Sitara ARM Cortex-A8 processor today.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: DSP/BIOS Task compile issue - balasubramanian vaidhyanathan - Sep 24 20:50:48 2008

How does one pass arguments to a task.... Like in the writer reader example
in TI DSP/BIOS user guide page 4.53 using queues and semaphores I want the write
task to take different id's.. Is it different tasks that i shud configure in cdb
file?. I did that still it did not happen when i printed out the id value.....
can you clarify?
--- On Wed, 9/24/08, William C Bonner <w...@wimsworld.com> wrote:

From: William C Bonner <w...@wimsworld.com>
Subject: Re: [c6x] DSP/BIOS Task compile issue
To: "balasubramanian vaidhyanathan" <i...@yahoo.com>
Cc: c...@yahoogroups.com
Date: Wednesday, September 24, 2008, 11:04 AM

When you couldn't get your project to compile, was it giving you errors, 
or was it simply ignoring your code?

I seem to remember something like this from when I was starting with the 
TI compiler. I am pretty sure I set a flag to cause it to recognize the 
.cpp extension as a c++ file. The extension used for recognizing a C++ 
code file varied between compilers for a long time.  Many recognized .cc 
or .C while using .c for standard C code.

balasubramanian vaidhyanathan wrote:
> I got my trial project to compile... Only because my file name was 
> .cpp and i changed to .c it compiled.... i find this strange in 
> DSP/BIOS... Has anyone faced this issue before?

______________________________
Start your Android Ice Cream Sandwich development on TI's AM35x Sitara ARM Cortex-A8 processor today.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Issue understanding this code - Richard Williams - Sep 25 0:27:31 2008

balasub...

Here is a usable version of the code.
I have not had a chance to run it, so cannot assure no keypunch errors.

I suggest you read the TI document: spru625i.pdf
"TMS320C28x DSP/BIOS 5.32
Application Programming Interface
      (API) Reference Guide"

As it clearly states what needs to be done to perform the task you are trying
to
perform.

==============================
#include <std.h>

#include <log.h>
#include <mem.h>
#include <que.h>
#include <sys.h>
#include <tsk.h>

#include "queuecfg.h"

#define NUMMSGS 3 /* number of messages */
#define NUMWRITERS 3

typedef struct MsgObj {
QUE_Elem elem; /* first field for QUE */
int id;
Char val; /* message value */
} Msg_Obj;
struct QUE_Obj *pQUE_Handle;
struct QUE_Attrs{ /* queue atributes */
Int dummy; /* dummy */
};
QUE_Attrs QUE_ATTRS = {0}; /* default attribute values */

/*
* ======== main ========
*/
Void main()
{
int i;
Uns mask;

    mask=TRC_LOGTSK|TRC_LOGSWI|TRC_STSSWI|TRC_LOGCLK;
    TRC_enable(TRC_GBLHOST|TRC_GBLTARG|mask); // get everything going
 
     // create the queue, used QUE_Handle rather than freeQueue
    pQUE_Handle = QUE_create( &QUE_ATTRS )
    return;
} /* end of function: main() */
/* reader code */
void reader()
{
Msg_Obj *reader_pMsg;
Int i;

    for i=0; i<NUMMSGS; i++)
    {
        SEM_pend(&sem,SYS_FOREVER);     // wait for message to be available

        if ((QUE_Obj)(reader_pMsg = QUE_get(pQUE_Handle)) != pQUE_Handle)
        { // then, queue not empty
            reader_pMsg = QUE_get(pQUE_Handle); 
                                        // get ptr to msg at tail of freeQueue
                                        // also moves freeQueue tail 
                                        // to next entry

            LOG_printf(&trace,"read '%c' from (%d) .",
                       reader_pMsg->val,
                       reader_pMsg->id);
        } // endif(queue not empty)
    } // endfor()

    LOG_printf(&trace,"reader done\n");
    return;
} /* end of function: reader() */
/* writer code */
void writer(Int id)
{
Msg_Obj writer_Msg;  // area to create new message(s)
Int i;               // loop counter

    for(i=0; i<NUMMSGS; i++) 
        // put NUMMSGS new messages into queue
        // each message put at new head of queue
    {
        /*fill in values */
        writer_Msg->id=id;
        writer_Msg->val=(i& 0xf)+'a';

        LOG_printf(&trace,"(%d) writing '%c'...",
                   id, 
                   writer_Msg->val);

        QUE_put(pQUE_Handle, &writer_Msg); 
            // copies local message area
            // to head of pQUE_Handle queue 
            // and increments the head to
            // the next entry in queue
                                        
        SEM_post(&sem);
            // indicate another MsgObj available queue
    } // endfor()

    LOG_printf(&trace,"Writer is done\n");
    return;
} /* end of function: writer() */
-------------------------------

---------- Original Message -----------
From: balasubramanian vaidhyanathan <i...@yahoo.com>
To: William C Bonner <w...@wimsworld.com>
Cc: c...@yahoogroups.com
Sent: Wed, 24 Sep 2008 15:13:18 -0700 (PDT)
Subject: [c6x] Issue understanding this code

> Hi
>  
>   Below is the code I yanked out of TI BIOS User guide. Now what i 
> cant understand is this, the writer task has an id. In the document it 
> says there are three writers. So does that mean i have to create three 
> tasks and connect them to _writer and give same priority and run this 
> code so that i can have 3 writers?. I tried running with 2 writers and 
> the code does not behave as told. I ran with only one task and in the 
> reader() task i removed the 2 in the loop and the code exited 
> properly. Please explain.I have highlighted my confusing points in
bold....
>  
> regards
> Bala 
>  
> #include <std.h>
> #include <log.h>
> #include <mem.h>
> #include <que.h>
> #include <sys.h>
> #include <tsk.h>
> #include "queuecfg.h"
> #define NUMMSGS     3      /* number of messages */
> #define NUMWRITERS 3
> typedef struct MsgObj {
>     QUE_Elem    elem;      /* first field for QUE */
>  int id;
>     Char        val;       /* message value */
> } MsgObj, *Msg;
>  
> /*
>  *  ======== main ========
>  */
> Void main()
> {
>  int i;
>  MsgObj *msg;
>  Uns mask;
>  mask=TRC_LOGTSK|TRC_LOGSWI|TRC_STSSWI|TRC_LOGCLK;
>  TRC_enable(TRC_GBLHOST|TRC_GBLTARG|mask);
>  msg=(MsgObj *)MEM_alloc(0,NUMMSGS*sizeof(MsgObj),0);
>  if(msg==MEM_ILLEGAL)
>  {
>   SYS_abort("Memory allocation failed \n");
>  }
>  for(i=0;i<NUMMSGS;msg++,i++)
>  {
>   QUE_put(&freeQueue,msg);
>  }
> }
> /* reader code */
> void reader()
> {
>  Msg msg;
>  Int i;
>  for(i=0;i<NUMMSGS*2;i++)
>  {
>   SEM_pend(&sem,SYS_FOREVER);
>   msg=QUE_get(&msgQueue);
>   LOG_printf(&trace,"read '%c' from (%d)
.",msg->val,msg->id);
>   QUE_put(&freeQueue,msg);
>  }
>  LOG_printf(&trace,"reader done\n");
> }
> 
> /* writer code */
> void writer(Int id)
> {
>  Msg msg;
>  Int i;
> 
>  for(i=0;i<NUMMSGS;i++)
>  {
>   /* Get msg from the free queue*/
>   if(QUE_empty(&freeQueue))
>   {
>  
>    SYS_abort("Empty free queue\n");
>   }
>   msg=QUE_get(&freeQueue);
>   /*fill in value*/
>   msg->id=id;
>   msg->val=(i& 0xf)+'a';
>   LOG_printf(&trace,"(%d) writing
'%c'...",id,msg->val);
>   QUE_put(&msgQueue,msg);
>   SEM_post(&sem);
>  }
>  LOG_printf(&trace,"Writer is done\n");
> }
> 
> --- On Wed, 9/24/08, William C Bonner <w...@wimsworld.com> wrote:
> 
> From: William C Bonner <w...@wimsworld.com>
> Subject: Re: [c6x] DSP/BIOS Task compile issue
> To: "balasubramanian vaidhyanathan" <i...@yahoo.com>
> Cc: c...@yahoogroups.com
> Date: Wednesday, September 24, 2008, 11:04 AM
> 
> When you couldn't get your project to compile, was it giving you 
> errors, or was it simply ignoring your code?
> 
> I seem to remember something like this from when I was starting with 
> the TI compiler. I am pretty sure I set a flag to cause it to 
> recognize the .cpp extension as a c++ file. The extension used for 
> recognizing a C++ code file varied between compilers for a long time.  
> Many recognized .cc or .C while using .c for standard C code.
> 
> balasubramanian vaidhyanathan wrote:
> > I got my trial project to compile... Only because my file name was 
> > .cpp and i changed to .c it compiled.... i find this strange in 
> > DSP/BIOS... Has anyone faced this issue before?
> >
> >
------- End of Original Message -------






(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Issue understanding this code - Richard Williams - Sep 25 1:21:23 2008

balasub,,,
I ran the code,  I now see why the 'freeQueue' was being initialized with
pointer to messages/
I.E.
The QUE_Get() and QUE_Put() only transfer a pointer to a message, rather than
the actual message content.

So I am wrong in the elimination of the freeQueue.
Sorry about that.
BTW:
The code is also missing the following, probably just after the #include
statements:
void reader(void); // declaration for the reader task
void writer(Int taskId); // declaration for the writer task

The code is missing the following statements:
extern SEM_Obj sem;
extern QUE_Obj msgQueue;
extern QUE_Obj freeQueue;
extern LOG_Obj trace;

And each of the writer_Msg variables that I wrote, need to be changed to a
pointer, etc.

If you want, I can send along a more realistic version.

R. Williams

---------- Original Message -----------
From: balasubramanian vaidhyanathan <i...@yahoo.com>
To: William C Bonner <w...@wimsworld.com>
Cc: c...@yahoogroups.com
Sent: Wed, 24 Sep 2008 15:13:18 -0700 (PDT)
Subject: [c6x] Issue understanding this code

> Hi
>  
>   Below is the code I yanked out of TI BIOS User guide. Now what i 
> cant understand is this, the writer task has an id. In the document it 
> says there are three writers. So does that mean i have to create three 
> tasks and connect them to _writer and give same priority and run this 
> code so that i can have 3 writers?. I tried running with 2 writers and 
> the code does not behave as told. I ran with only one task and in the 
> reader() task i removed the 2 in the loop and the code exited 
> properly. Please explain.I have highlighted my confusing points in
bold....
>  
> regards
> Bala 
>  
> #include <std.h>
> #include <log.h>
> #include <mem.h>
> #include <que.h>
> #include <sys.h>
> #include <tsk.h>
> #include "queuecfg.h"
> #define NUMMSGS     3      /* number of messages */
> #define NUMWRITERS 3
> typedef struct MsgObj {
>     QUE_Elem    elem;      /* first field for QUE */
>  int id;
>     Char        val;       /* message value */
> } MsgObj, *Msg;
>  
> /*
>  *  ======== main ========
>  */
> Void main()
> {
>  int i;
>  MsgObj *msg;
>  Uns mask;
>  mask=TRC_LOGTSK|TRC_LOGSWI|TRC_STSSWI|TRC_LOGCLK;
>  TRC_enable(TRC_GBLHOST|TRC_GBLTARG|mask);
>  msg=(MsgObj *)MEM_alloc(0,NUMMSGS*sizeof(MsgObj),0);
>  if(msg==MEM_ILLEGAL)
>  {
>   SYS_abort("Memory allocation failed \n");
>  }
>  for(i=0;i<NUMMSGS;msg++,i++)
>  {
>   QUE_put(&freeQueue,msg);
>  }
> }
> /* reader code */
> void reader()
> {
>  Msg msg;
>  Int i;
>  for(i=0;i<NUMMSGS*2;i++)
>  {
>   SEM_pend(&sem,SYS_FOREVER);
>   msg=QUE_get(&msgQueue);
>   LOG_printf(&trace,"read '%c' from (%d)
.",msg->val,msg->id);
>   QUE_put(&freeQueue,msg);
>  }
>  LOG_printf(&trace,"reader done\n");
> }
> 
> /* writer code */
> void writer(Int id)
> {
>  Msg msg;
>  Int i;
> 
>  for(i=0;i<NUMMSGS;i++)
>  {
>   /* Get msg from the free queue*/
>   if(QUE_empty(&freeQueue))
>   {
>  
>    SYS_abort("Empty free queue\n");
>   }
>   msg=QUE_get(&freeQueue);
>   /*fill in value*/
>   msg->id=id;
>   msg->val=(i& 0xf)+'a';
>   LOG_printf(&trace,"(%d) writing
'%c'...",id,msg->val);
>   QUE_put(&msgQueue,msg);
>   SEM_post(&sem);
>  }
>  LOG_printf(&trace,"Writer is done\n");
> }
> 
> --- On Wed, 9/24/08, William C Bonner <w...@wimsworld.com> wrote:
> 
> From: William C Bonner <w...@wimsworld.com>
> Subject: Re: [c6x] DSP/BIOS Task compile issue
> To: "balasubramanian vaidhyanathan" <i...@yahoo.com>
> Cc: c...@yahoogroups.com
> Date: Wednesday, September 24, 2008, 11:04 AM
> 
> When you couldn't get your project to compile, was it giving you 
> errors, or was it simply ignoring your code?
> 
> I seem to remember something like this from when I was starting with 
> the TI compiler. I am pretty sure I set a flag to cause it to 
> recognize the .cpp extension as a c++ file. The extension used for 
> recognizing a C++ code file varied between compilers for a long time.  
> Many recognized .cc or .C while using .c for standard C code.
> 
> balasubramanian vaidhyanathan wrote:
> > I got my trial project to compile... Only because my file name was 
> > .cpp and i changed to .c it compiled.... i find this strange in 
> > DSP/BIOS... Has anyone faced this issue before?
> >
> >
------- End of Original Message -------


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Issue understanding this code - balasubramanian vaidhyanathan - Sep 25 10:30:15 2008

Hi,
=A0
=A0=A0=A0 How do i get the LOG to show three writers here.I cant understand=
 how the Id is passed... Can you throw some light on this?... I understand =
there are three writers in that example... When i see the logs i see the id=
 being 1 always in my LOGs but in the example in the document they show dif=
ferent ids... How are the Ids to the writer passed...=20
=A0=A0=A0=20

--- On Wed, 9/24/08, Richard Williams <r...@lewiscounty.com> wrote:

From: Richard Williams <r...@lewiscounty.com>
Subject: Re: [c6x] Issue understanding this code
To: i...@yahoo.com, "William C Bonner" <w...@wimsworld.com>
Cc: c...@yahoogroups.com
Date: Wednesday, September 24, 2008, 11:32 PM

balasub,,,
I ran the code,  I now see why the 'freeQueue' was being initialized
with
pointer to messages/
I.E.
The QUE_Get() and QUE_Put() only transfer a pointer to a message, rather th=
an
the actual message content.

So I am wrong in the elimination of the freeQueue.
Sorry about that.
BTW:
The code is also missing the following, probably just after the #include
statements:
void reader(void); // declaration for the reader task
void writer(Int taskId); // declaration for the writer task

The code is missing the following statements:
extern SEM_Obj sem;
extern QUE_Obj msgQueue;
extern QUE_Obj freeQueue;
extern LOG_Obj trace;

And each of the writer_Msg variables that I wrote, need to be changed to a
pointer, etc.

If you want, I can send along a more realistic version.

R. Williams

---------- Original Message -----------
From: balasubramanian vaidhyanathan <i...@yahoo.com>
To: William C Bonner <w...@wimsworld.com>
Cc: c...@yahoogroups.com
Sent: Wed, 24 Sep 2008 15:13:18 -0700 (PDT)
Subject: [c6x] Issue understanding this code

> Hi
> =A0
> =A0 Below is the code I yanked out of TI BIOS User guide. Now what i=20
> cant understand is this, the writer task has an id. In the document it=20
> says there are three writers. So does that mean i have to create three=20
> tasks and connect them to _writer and give same priority and run this=20
> code so that i can have 3 writers?. I tried running with 2 writers and=20
> the code does not behave as told. I ran with only one task and in the=20
> reader() task i removed the 2 in the loop and the code exited=20
> properly. Please explain.I have highlighted my confusing points in
bold....
> =A0
> regards
> Bala=20
> =A0
> #include <std.h>
> #include <log.h>
> #include <mem.h>
> #include <que.h>
> #include <sys.h>
> #include <tsk.h>
> #include "queuecfg.h"
> #define NUMMSGS=A0=A0=A0=A0 3=A0=A0=A0=A0=A0 /* number of messages */
> #define NUMWRITERS 3
> typedef struct MsgObj {
> =A0=A0=A0 QUE_Elem=A0=A0=A0 elem;=A0=A0=A0=A0=A0 /* first field for QUE *=
/
> =A0int id;
> =A0=A0=A0 Char=A0=A0=A0=A0=A0=A0=A0 val;=A0=A0=A0=A0=A0=A0 /* message val=
ue */
> } MsgObj, *Msg;
> =A0
> /*
> =A0*=A0 =3D=3D=3D=3D=3D=3D=3D=3D main =3D=3D=3D=3D=3D=3D=3D=3D
> =A0*/
> Void main()
> {
> =A0int i;
> =A0MsgObj *msg;
> =A0Uns mask;
> =A0mask=3DTRC_LOGTSK|TRC_LOGSWI|TRC_STSSWI|TRC_LOGCLK;
> =A0TRC_enable(TRC_GBLHOST|TRC_GBLTARG|mask);
> =A0msg=3D(MsgObj *)MEM_alloc(0,NUMMSGS*sizeof(MsgObj),0);
> =A0if(msg=3D=3DMEM_ILLEGAL)
> =A0{
> =A0=A0SYS_abort("Memory allocation failed \n");
> =A0}
> =A0for(i=3D0;i<NUMMSGS;msg++,i++)
> =A0{
> =A0=A0QUE_put(&freeQueue,msg);
> =A0}
> }
> /* reader code */
> void reader()
> {
> =A0Msg msg;
> =A0Int i;
> =A0for(i=3D0;i<NUMMSGS*2;i++)
> =A0{
> =A0=A0SEM_pend(&sem,SYS_FOREVER);
> =A0=A0msg=3DQUE_get(&msgQueue);
> =A0=A0LOG_printf(&trace,"read '%c' from (%d)
.",msg->val,msg->id);
> =A0=A0QUE_put(&freeQueue,msg);
> =A0}
> =A0LOG_printf(&trace,"reader done\n");
> }
>=20
> /* writer code */
> void writer(Int id)
> {
> =A0Msg msg;
> =A0Int i;
>=20
> =A0for(i=3D0;i<NUMMSGS;i++)
> =A0{
> =A0=A0/* Get msg from the free queue*/
> =A0=A0if(QUE_empty(&freeQueue))
> =A0=A0{
> =A0
> =A0=A0=A0SYS_abort("Empty free queue\n");
> =A0=A0}
> =A0=A0msg=3DQUE_get(&freeQueue);
> =A0=A0/*fill in value*/
> =A0=A0msg->id=3Did;
> =A0=A0msg->val=3D(i& 0xf)+'a';
> =A0=A0LOG_printf(&trace,"(%d) writing
'%c'...",id,msg->val);
> =A0=A0QUE_put(&msgQueue,msg);
> =A0=A0SEM_post(&sem);
> =A0}
> =A0LOG_printf(&trace,"Writer is done\n");
> }
>=20
> --- On Wed, 9/24/08, William C Bonner <w...@wimsworld.com> wrote:
>=20
> From: William C Bonner <w...@wimsworld.com>
> Subject: Re: [c6x] DSP/BIOS Task compile issue
> To: "balasubramanian vaidhyanathan"
<i...@yahoo.com>
> Cc: c...@yahoogroups.com
> Date: Wednesday, September 24, 2008, 11:04 AM
>=20
> When you couldn't get your project to compile, was it giving you=20
> errors, or was it simply ignoring your code?
>=20
> I seem to remember something like this from when I was starting with=20
> the TI compiler. I am pretty sure I set a flag to cause it to=20
> recognize the .cpp extension as a c++ file. The extension used for=20
> recognizing a C++ code file varied between compilers for a long time. =
=20
> Many recognized .cc or .C while using .c for standard C code.
>=20
> balasubramanian vaidhyanathan wrote:
> > I got my trial project to compile... Only because my file name was=20
> > .cpp and i changed to .c it compiled.... i find this strange in=20
> > DSP/BIOS... Has anyone faced this issue before?
> >
> >
------- End of Original Message -------

=20=20=20=20=20=20







______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Issue understanding this code - Richard Williams - Sep 25 11:38:38 2008

balasub...

In the BIOS configuration, where the tasks are documented, there is a section
on
passed parameters.
*I think* that is where the task/thread number would be passed.

R. Williams
---------- Original Message -----------
From: balasubramanian vaidhyanathan <i...@yahoo.com>
To: Richard Williams <r...@lewiscounty.com>
Cc: c...@yahoogroups.com
Sent: Thu, 25 Sep 2008 07:24:17 -0700 (PDT)
Subject: Re: [c6x] Issue understanding this code

> Hi,
>  
>     How do i get the LOG to show three writers here.I cant understand 
> how the Id is passed... Can you throw some light on this?... I 
> understand there are three writers in that example... When i see the 
> logs i see the id being 1 always in my LOGs but in the example in the 
> document they show different ids... How are the Ids to the writer
passed...
>    
> 
> --- On Wed, 9/24/08, Richard Williams <r...@lewiscounty.com> wrote:
> 
> From: Richard Williams <r...@lewiscounty.com>
> Subject: Re: [c6x] Issue understanding this code
> To: i...@yahoo.com, "William C Bonner"
<w...@wimsworld.com>
> Cc: c...@yahoogroups.com
> Date: Wednesday, September 24, 2008, 11:32 PM
> 
> balasub,,,
> 
> I ran the code,  I now see why the 'freeQueue' was being initialized
> with
> pointer to messages/
> I.E.
> The QUE_Get() and QUE_Put() only transfer a pointer to a message,
>  rather than the actual message content.
> 
> So I am wrong in the elimination of the freeQueue.
> Sorry about that.
> BTW:
> The code is also missing the following, probably just after the 
> #include statements: void reader(void); // declaration for the reader task
> void writer(Int taskId); // declaration for the writer task
> 
> The code is missing the following statements:
> extern SEM_Obj sem;
> extern QUE_Obj msgQueue;
> extern QUE_Obj freeQueue;
> extern LOG_Obj trace;
> 
> And each of the writer_Msg variables that I wrote, need to be changed 
> to a pointer, etc.
> 
> If you want, I can send along a more realistic version.
> 
> R. Williams
> 
> ---------- Original Message -----------
> From: balasubramanian vaidhyanathan <i...@yahoo.com>
> To: William C Bonner <w...@wimsworld.com>
> Cc: c...@yahoogroups.com
> Sent: Wed, 24 Sep 2008 15:13:18 -0700 (PDT)
> Subject: [c6x] Issue understanding this code
> 
> > Hi
> >  
> >   Below is the code I yanked out of TI BIOS User guide. Now what i
> > cant understand is this, the writer task has an id. In the document
it
> > says there are three writers. So does that mean i have to create
three
> > tasks and connect them to _writer and give same priority and run this
> > code so that i can have 3 writers?. I tried running with 2 writers
and
> > the code does not behave as told. I ran with only one task and in the
> > reader() task i removed the 2 in the loop and the code exited
> > properly. Please explain.I have highlighted my confusing points in
> bold....
> >  
> > regards
> > Bala
> >  
> > #include <std.h>
> > #include <log.h>
> > #include <mem.h>
> > #include <que.h>
> > #include <sys.h>
> > #include <tsk.h>
> > #include "queuecfg.h"
> > #define NUMMSGS     3      /* number of messages */
> > #define NUMWRITERS 3
> > typedef struct MsgObj {
> >     QUE_Elem    elem;      /* first field for QUE */
> >  int id;
> >     Char        val;       /* message value */
> > } MsgObj, *Msg;
> >  
> > /*
> >  *  ======== main ========
> >  */
> > Void main()
> > {
> >  int i;
> >  MsgObj *msg;
> >  Uns mask;
> >  mask=TRC_LOGTSK|TRC_LOGSWI|TRC_STSSWI|TRC_LOGCLK;
> >  TRC_enable(TRC_GBLHOST|TRC_GBLTARG|mask);
> >  msg=(MsgObj *)MEM_alloc(0,NUMMSGS*sizeof(MsgObj),0);
> >  if(msg==MEM_ILLEGAL)
> >  {
> >   SYS_abort("Memory allocation failed \n");
> >  }
> >  for(i=0;i<NUMMSGS;msg++,i++)
> >  {
> >   QUE_put(&freeQueue,msg);
> >  }
> > }
> > /* reader code */
> > void reader()
> > {
> >  Msg msg;
> >  Int i;
> >  for(i=0;i<NUMMSGS*2;i++)
> >  {
> >   SEM_pend(&sem,SYS_FOREVER);
> >   msg=QUE_get(&msgQueue);
> >   LOG_printf(&trace,"read '%c' from (%d)
> .",msg->val,msg->id);
> >   QUE_put(&freeQueue,msg);
> >  }
> >  LOG_printf(&trace,"reader done\n");
> > }
> >
> > /* writer code */
> > void writer(Int id)
> > {
> >  Msg msg;
> >  Int i;
> >
> >  for(i=0;i<NUMMSGS;i++)
> >  {
> >   /* Get msg from the free queue*/
> >   if(QUE_empty(&freeQueue))
> >   {
> >  
> >    SYS_abort("Empty free queue\n");
> >   }
> >   msg=QUE_get(&freeQueue);
> >   /*fill in value*/
> >   msg->id=id;
> >   msg->val=(i& 0xf)+'a';
> >   LOG_printf(&trace,"(%d) writing
> '%c'...",id,msg->val);
> >   QUE_put(&msgQueue,msg);
> >   SEM_post(&sem);
> >  }
> >  LOG_printf(&trace,"Writer is done\n");
> > }
> >
> > --- On Wed, 9/24/08, William C Bonner <w...@wimsworld.com>
wrote:
> >
> > From: William C Bonner <w...@wimsworld.com>
> > Subject: Re: [c6x] DSP/BIOS Task compile issue
> > To: "balasubramanian vaidhyanathan"
> <i...@yahoo.com>
> > Cc: c...@yahoogroups.com
> > Date: Wednesday, September 24, 2008, 11:04 AM
> >
> > When you couldn't get your project to compile, was it giving you
> > errors, or was it simply ignoring your code?
> >
> > I seem to remember something like this from when I was starting with
> > the TI compiler. I am pretty sure I set a flag to cause it to
> > recognize the .cpp extension as a c++ file. The extension used for
> > recognizing a C++ code file varied between compilers for a long time.
> > Many recognized .cc or .C while using .c for standard C code.
> >
> > balasubramanian vaidhyanathan wrote:
> > > I got my trial project to compile... Only because my file name
was
> > > .cpp and i changed to .c it compiled.... i find this strange in
> > > DSP/BIOS... Has anyone faced this issue before?
> > >
> > >
> ------- End of Original Message -------
------- End of Original Message -------


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Issue understanding this code - balasubramanian vaidhyanathan - Sep 25 11:44:13 2008

Hi Richard
=A0
=A0=A0 Are the three Ids three different tasks. I added three tasks in the =
cdb file and connected this function _write to the properties and executed =
the code still i get only one id.. Can you tell me how to get three id prin=
ted out?.....

--- On Wed, 9/24/08, Richard Williams <r...@lewiscounty.com> wrote:

From: Richard Williams <r...@lewiscounty.com>
Subject: Re: [c6x] Issue understanding this code
To: i...@yahoo.com, "William C Bonner" <w...@wimsworld.com>
Cc: c...@yahoogroups.com
Date: Wednesday, September 24, 2008, 11:32 PM

balasub,,,
I ran the code,  I now see why the 'freeQueue' was being initialized
with
pointer to messages/
I.E.
The QUE_Get() and QUE_Put() only transfer a pointer to a message, rather th=
an
the actual message content.

So I am wrong in the elimination of the freeQueue.
Sorry about that.
BTW:
The code is also missing the following, probably just after the #include
statements:
void reader(void); // declaration for the reader task
void writer(Int taskId); // declaration for the writer task

The code is missing the following statements:
extern SEM_Obj sem;
extern QUE_Obj msgQueue;
extern QUE_Obj freeQueue;
extern LOG_Obj trace;

And each of the writer_Msg variables that I wrote, need to be changed to a
pointer, etc.

If you want, I can send along a more realistic version.

R. Williams

---------- Original Message -----------
From: balasubramanian vaidhyanathan <i...@yahoo.com>
To: William C Bonner <w...@wimsworld.com>
Cc: c...@yahoogroups.com
Sent: Wed, 24 Sep 2008 15:13:18 -0700 (PDT)
Subject: [c6x] Issue understanding this code

> Hi
> =A0
> =A0 Below is the code I yanked out of TI BIOS User guide. Now what i=20
> cant understand is this, the writer task has an id. In the document it=20
> says there are three writers. So does that mean i have to create three=20
> tasks and connect them to _writer and give same priority and run this=20
> code so that i can have 3 writers?. I tried running with 2 writers and=20
> the code does not behave as told. I ran with only one task and in the=20
> reader() task i removed the 2 in the loop and the code exited=20
> properly. Please explain.I have highlighted my confusing points in
bold....
> =A0
> regards
> Bala=20
> =A0
> #include <std.h>
> #include <log.h>
> #include <mem.h>
> #include <que.h>
> #include <sys.h>
> #include <tsk.h>
> #include "queuecfg.h"
> #define NUMMSGS=A0=A0=A0=A0 3=A0=A0=A0=A0=A0 /* number of messages */
> #define NUMWRITERS 3
> typedef struct MsgObj {
> =A0=A0=A0 QUE_Elem=A0=A0=A0 elem;=A0=A0=A0=A0=A0 /* first field for QUE *=
/
> =A0int id;
> =A0=A0=A0 Char=A0=A0=A0=A0=A0=A0=A0 val;=A0=A0=A0=A0=A0=A0 /* message val=
ue */
> } MsgObj, *Msg;
> =A0
> /*
> =A0*=A0 =3D=3D=3D=3D=3D=3D=3D=3D main =3D=3D=3D=3D=3D=3D=3D=3D
> =A0*/
> Void main()
> {
> =A0int i;
> =A0MsgObj *msg;
> =A0Uns mask;
> =A0mask=3DTRC_LOGTSK|TRC_LOGSWI|TRC_STSSWI|TRC_LOGCLK;
> =A0TRC_enable(TRC_GBLHOST|TRC_GBLTARG|mask);
> =A0msg=3D(MsgObj *)MEM_alloc(0,NUMMSGS*sizeof(MsgObj),0);
> =A0if(msg=3D=3DMEM_ILLEGAL)
> =A0{
> =A0=A0SYS_abort("Memory allocation failed \n");
> =A0}
> =A0for(i=3D0;i<NUMMSGS;msg++,i++)
> =A0{
> =A0=A0QUE_put(&freeQueue,msg);
> =A0}
> }
> /* reader code */
> void reader()
> {
> =A0Msg msg;
> =A0Int i;
> =A0for(i=3D0;i<NUMMSGS*2;i++)
> =A0{
> =A0=A0SEM_pend(&sem,SYS_FOREVER);
> =A0=A0msg=3DQUE_get(&msgQueue);
> =A0=A0LOG_printf(&trace,"read '%c' from (%d)
.",msg->val,msg->id);
> =A0=A0QUE_put(&freeQueue,msg);
> =A0}
> =A0LOG_printf(&trace,"reader done\n");
> }
>=20
> /* writer code */
> void writer(Int id)
> {
> =A0Msg msg;
> =A0Int i;
>=20
> =A0for(i=3D0;i<NUMMSGS;i++)
> =A0{
> =A0=A0/* Get msg from the free queue*/
> =A0=A0if(QUE_empty(&freeQueue))
> =A0=A0{
> =A0
> =A0=A0=A0SYS_abort("Empty free queue\n");
> =A0=A0}
> =A0=A0msg=3DQUE_get(&freeQueue);
> =A0=A0/*fill in value*/
> =A0=A0msg->id=3Did;
> =A0=A0msg->val=3D(i& 0xf)+'a';
> =A0=A0LOG_printf(&trace,"(%d) writing
'%c'...",id,msg->val);
> =A0=A0QUE_put(&msgQueue,msg);
> =A0=A0SEM_post(&sem);
> =A0}
> =A0LOG_printf(&trace,"Writer is done\n");
> }
>=20
> --- On Wed, 9/24/08, William C Bonner <w...@wimsworld.com> wrote:
>=20
> From: William C Bonner <w...@wimsworld.com>
> Subject: Re: [c6x] DSP/BIOS Task compile issue
> To: "balasubramanian vaidhyanathan"
<i...@yahoo.com>
> Cc: c...@yahoogroups.com
> Date: Wednesday, September 24, 2008, 11:04 AM
>=20
> When you couldn't get your project to compile, was it giving you=20
> errors, or was it simply ignoring your code?
>=20
> I seem to remember something like this from when I was starting with=20
> the TI compiler. I am pretty sure I set a flag to cause it to=20
> recognize the .cpp extension as a c++ file. The extension used for=20
> recognizing a C++ code file varied between compilers for a long time. =
=20
> Many recognized .cc or .C while using .c for standard C code.
>=20
> balasubramanian vaidhyanathan wrote:
> > I got my trial project to compile... Only because my file name was=20
> > .cpp and i changed to .c it compiled.... i find this strange in=20
> > DSP/BIOS... Has anyone faced this issue before?
> >
> >
------- End of Original Message -------

=20=20=20=20=20=20











(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Issue with SEM_pend - balasubramanian vaidhyanathan - Sep 25 13:57:36 2008

Hi all     My code is supposed to pend on a semaphore and i checked the
sem=
aphore count alsoit is zero. but the code still goes beyond SEM_pend when i=
 step through. Why would it behave like this?. If the semaphorecount is zer=
o then it should pend forever because ihave time out as SYS_FOREVER.... Hav=
e u faced this issue?>=A0regardsBala=20=20=20
=20=20=20=20=20=20







______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Issue understanding this code - Richard Williams - Sep 25 17:34:11 2008

balasub...

the ID in the write task (only one write task) needs to be set to contain the
thread number, not the task number.

R. Williams

---------- Original Message -----------
From: balasubramanian vaidhyanathan <i...@yahoo.com>
To: William C Bonner <w...@wimsworld.com>, Richard Williams
<r...@lewiscounty.com>
Cc: c...@yahoogroups.com
Sent: Thu, 25 Sep 2008 07:35:16 -0700 (PDT)
Subject: Re: [c6x] Issue understanding this code

> Hi Richard
>  
>    Are the three Ids three different tasks. I added three tasks in the 
> cdb file and connected this function _write to the properties and 
> executed the code still i get only one id.. Can you tell me how to get 
> three id printed out?.....
> 
> --- On Wed, 9/24/08, Richard Williams <r...@lewiscounty.com> wrote:
> 
> From: Richard Williams <r...@lewiscounty.com>
> Subject: Re: [c6x] Issue understanding this code
> To: i...@yahoo.com, "William C Bonner"
<w...@wimsworld.com>
> Cc: c...@yahoogroups.com
> Date: Wednesday, September 24, 2008, 11:32 PM
> 
> balasub,,,
> 
> I ran the code,  I now see why the 'freeQueue' was being initialized
> with
> pointer to messages/
> I.E.
> The QUE_Get() and QUE_Put() only transfer a pointer to a message,
>  rather than the actual message content.
> 
> So I am wrong in the elimination of the freeQueue.
> Sorry about that.
> BTW:
> The code is also missing the following, probably just after the 
> #include statements: void reader(void); // declaration for the reader task
> void writer(Int taskId); // declaration for the writer task
> 
> The code is missing the following statements:
> extern SEM_Obj sem;
> extern QUE_Obj msgQueue;
> extern QUE_Obj freeQueue;
> extern LOG_Obj trace;
> 
> And each of the writer_Msg variables that I wrote, need to be changed 
> to a pointer, etc.
> 
> If you want, I can send along a more realistic version.
> 
> R. Williams
> 
> ---------- Original Message -----------
> From: balasubramanian vaidhyanathan <i...@yahoo.com>
> To: William C Bonner <w...@wimsworld.com>
> Cc: c...@yahoogroups.com
> Sent: Wed, 24 Sep 2008 15:13:18 -0700 (PDT)
> Subject: [c6x] Issue understanding this code
> 
> > Hi
> >  
> >   Below is the code I yanked out of TI BIOS User guide. Now what i
> > cant understand is this, the writer task has an id. In the document
it
> > says there are three writers. So does that mean i have to create
three
> > tasks and connect them to _writer and give same priority and run this
> > code so that i can have 3 writers?. I tried running with 2 writers
and
> > the code does not behave as told. I ran with only one task and in the
> > reader() task i removed the 2 in the loop and the code exited
> > properly. Please explain.I have highlighted my confusing points in
> bold....
> >  
> > regards
> > Bala
> >  
> > #include <std.h>
> > #include <log.h>
> > #include <mem.h>
> > #include <que.h>
> > #include <sys.h>
> > #include <tsk.h>
> > #include "queuecfg.h"
> > #define NUMMSGS     3      /* number of messages */
> > #define NUMWRITERS 3
> > typedef struct MsgObj {
> >     QUE_Elem    elem;      /* first field for QUE */
> >  int id;
> >     Char        val;       /* message value */
> > } MsgObj, *Msg;
> >  
> > /*
> >  *  ======== main ========
> >  */
> > Void main()
> > {
> >  int i;
> >  MsgObj *msg;
> >  Uns mask;
> >  mask=TRC_LOGTSK|TRC_LOGSWI|TRC_STSSWI|TRC_LOGCLK;
> >  TRC_enable(TRC_GBLHOST|TRC_GBLTARG|mask);
> >  msg=(MsgObj *)MEM_alloc(0,NUMMSGS*sizeof(MsgObj),0);
> >  if(msg==MEM_ILLEGAL)
> >  {
> >   SYS_abort("Memory allocation failed \n");
> >  }
> >  for(i=0;i<NUMMSGS;msg++,i++)
> >  {
> >   QUE_put(&freeQueue,msg);
> >  }
> > }
> > /* reader code */
> > void reader()
> > {
> >  Msg msg;
> >  Int i;
> >  for(i=0;i<NUMMSGS*2;i++)
> >  {
> >   SEM_pend(&sem,SYS_FOREVER);
> >   msg=QUE_get(&msgQueue);
> >   LOG_printf(&trace,"read '%c' from (%d)
> .",msg->val,msg->id);
> >   QUE_put(&freeQueue,msg);
> >  }
> >  LOG_printf(&trace,"reader done\n");
> > }
> >
> > /* writer code */
> > void writer(Int id)
> > {
> >  Msg msg;
> >  Int i;
> >
> >  for(i=0;i<NUMMSGS;i++)
> >  {
> >   /* Get msg from the free queue*/
> >   if(QUE_empty(&freeQueue))
> >   {
> >  
> >    SYS_abort("Empty free queue\n");
> >   }
> >   msg=QUE_get(&freeQueue);
> >   /*fill in value*/
> >   msg->id=id;
> >   msg->val=(i& 0xf)+'a';
> >   LOG_printf(&trace,"(%d) writing
> '%c'...",id,msg->val);
> >   QUE_put(&msgQueue,msg);
> >   SEM_post(&sem);
> >  }
> >  LOG_printf(&trace,"Writer is done\n");
> > }
> >
> > --- On Wed, 9/24/08, William C Bonner <w...@wimsworld.com>
wrote:
> >
> > From: William C Bonner <w...@wimsworld.com>
> > Subject: Re: [c6x] DSP/BIOS Task compile issue
> > To: "balasubramanian vaidhyanathan"
> <i...@yahoo.com>
> > Cc: c...@yahoogroups.com
> > Date: Wednesday, September 24, 2008, 11:04 AM
> >
> > When you couldn't get your project to compile, was it giving you
> > errors, or was it simply ignoring your code?
> >
> > I seem to remember something like this from when I was starting with
> > the TI compiler. I am pretty sure I set a flag to cause it to
> > recognize the .cpp extension as a c++ file. The extension used for
> > recognizing a C++ code file varied between compilers for a long time.
> > Many recognized .cc or .C while using .c for standard C code.
> >
> > balasubramanian vaidhyanathan wrote:
> > > I got my trial project to compile... Only because my file name
was
> > > .cpp and i changed to .c it compiled.... i find this strange in
> > > DSP/BIOS... Has anyone faced this issue before?
> > >
> > >
> ------- End of Original Message -------
------- End of Original Message -------


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Issue with SEM_pend - Gregory Lee - Sep 26 0:57:01 2008

If the SEM_pend is happening sometime during the main function then the
behavior is expected. Semaphores and locks do not function until after the
main function returns and the DSP/BIOS finishes initializing.

On Thu, Sep 25, 2008 at 10:43 AM, balasubramanian vaidhyanathan <
i...@yahoo.com> wrote:

> Hi all     My code is supposed to pend on a semaphore and i checked the
> semaphore count alsoit is zero. but the code still goes beyond SEM_pend
when
> i step through. Why would it behave like this?. If the semaphorecount is
> zero then it should pend forever because ihave time out as SYS_FOREVER....
> Have u faced this issue?> regardsBala
>
>
> 
>
>
> 
-- 
Gregory Lee

______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Issue with SEM_pend - jai kumar - Sep 26 9:56:01 2008

To add little more to it  ,
If application is having only one task with Sem_pend in that and posting is
done from main function , this will cause abnormal behavior , for semaphore
pending and task . If you check the Execution graph details it will
show *"ERROR:
Invalid thread state transition"*

But if you add one more task to above application , i mean empty task with
not even single line of code in that, then Sem_pend will work fine and no
error message also . Sem posting from main function works normally .

This goes to prove that ,Semaphore usage is for task-to-task sync only , ie
only when multiple tasks exists .

- Jai

On Fri, Sep 26, 2008 at 1:56 PM, Gregory Lee <t...@gmail.com> wrote:

>   If the SEM_pend is happening sometime during the main function then the
> behavior is expected. Semaphores and locks do not function until after the
> main function returns and the DSP/BIOS finishes initializing.
>
> On Thu, Sep 25, 2008 at 10:43 AM, balasubramanian vaidhyanathan <
> i...@yahoo.com> wrote:
>
>> Hi all     My code is supposed to pend on a semaphore and i checked
the
>> semaphore count alsoit is zero. but the code still goes beyond SEM_pend
when
>> i step through. Why would it behave like this?. If the semaphorecount
is
>> zero then it should pend forever because ihave time out as
SYS_FOREVER....
>> Have u faced this issue?> regardsBala
>>
>>
>> 
>>
>>
>> 
> --
> Gregory Lee
>  
>

______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )