[ECOS] Create a thread (uitron)

Gary Thomas gary@mlbassoc.com
Mon Apr 30 14:47:00 GMT 2007


LONY David wrote:
> Hi all,
> 
> I'm trying to create a thread in eCos (uitron interface) but it does not 
> work. I'm new to eCos and uITRON, so I take a exemple and I'm try to 
> customize it...
> Here it my program :
> 
> #include <cyg/compat/uitron/uit_func.h>
> #include <stdio.h>
> 
> void task2(unsigned int a)
> {
> 
>  printf("In function test()\n");
> 
> }
> 
> 
> int main()
> {
> 
>  ID tid = 2;
>  T_CTSK thread_attr;
>  int retval;
> 
>  printf("In main\n");
> 
>  thread_attr.stksz = CYGNUM_UITRON_STACK_SIZE;
>  thread_attr.task = (FP)&task2;
> 
>  retval = cre_tsk(tid, &thread_attr);
> 
>  if(retval != E_OK)
>    {
>      printf("Error %d !!!\n",retval);
>    }
>  else
>    {
>      printf(" Good! \n");
>    }
> 
>  return 0;
> 
> }
> 
> 
> When I'm trying to debug it, I always obtain an error. Someone can help me?
> PS : Number of task is set to 4 and the number of task which start is 
> set to 1.
> I also modify the option Static Initializers to CYG_UIT_TASK_NOEXS for 
> task 2,3 and 4

Do you have some compelling reason to use uItron?  There are few,
if any, eCos maintainers that know much about this anymore.

I'd suggest that you look at a more modern (and certainly
more supported) API such as POSIX.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list