This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Create a thread (uitron)
- From: Gary Thomas <gary at mlbassoc dot com>
- To: LONY David <david dot lony at pragmadev dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 30 Apr 2007 08:47:09 -0600
- Subject: Re: [ECOS] Create a thread (uitron)
- References: <4635FF31.60609@pragmadev.com>
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