When i try 'taskSpawn()' on the shell, it doesn't work
and shows the error message following.
How can i use taskSpawn function in the vxworks 5.4 ? (with tornado 2)
-----------------------------------------------------------------
Exception number 4906: Task: 0x189720 ()
instruction translation miss
program counter: 0x04
machine status : 0x9032
trcStack aborted: error in top frame (sp)
ffffffff end +ffed846f: ()
value = 159704 = 0x185e88
Regards,
Nick
To try "taskSpawn", you can try
taskSpawn "sungjin", 4, 0, 40000, printf, "hello world\n", 0
on the tornado shell or better yet on target shell. You will see
string "hello world" as the output. After this
the task terminates.
Note:
"sungjin" is the task name, you can change it to any string
4 is the priority of the task
0 is the option
40000 is the stack size for this task (all local variables of
functions called by the task will use this space)
printf is a function used as the entry point to this task. You can
write some C routine and download it
in target and run it. For example, suppose you have a C
routine called
hello(), you can put hello here instead of
printf.
To learn more about the VxWorks, (suppose you have NT based Tornado
environment), you can go to menu "help" and choose menu index, there
you
will take either "Tornado user guide" or "VxWorks programmer's guide"
these
are excellent books.
Hope it helps,
Thanks.
Jin
"SungJin Lee" <blu...@dreamwiz.com> wrote in message news:<9ghoj1$aqm$1...@imsinews.kornet.net>...
> Hmm, this is a dead quick answer, with not much thought at all, but I
> think you should use ts() to spawn tasks from the shell. Anyway, give
> it a try and see what happens.
No. it's sp(). ts() == taskSuspend()
>
> Regards,
>
> Nick
>
> > hi vxworkers,
> >
> >
> > When i try 'taskSpawn()' on the shell, it doesn't work
> > and shows the error message following.
> >
> > How can i use taskSpawn function in the vxworks 5.4 ? (with tornado 2)
> >
> > -----------------------------------------------------------------
> > Exception number 4906: Task: 0x189720 ()
> >
> > instruction translation miss
> > program counter: 0x04
> > machine status : 0x9032
> > trcStack aborted: error in top frame (sp)
> > ffffffff end +ffed846f: ()
> > value = 159704 = 0x185e88
Is taskSpawn being passed paremeters? If not it's not entirely surprising it
doesn't work. taskSpawn takes about up to 14 (?) parameters, one of which is
the entry point. This is not the first paremeter passed to the function
either.
taskSpwan(myEntryPoint) will definately not work. sp(myEntryPoint) will
(parameters such as the task options, stack size and priority take default
values).
taskSpawn "test", 20, 0, 1000, printf("hello\n"), 0, 0, 0, 0, 0, 0, 0, 0, 0,
0
it works ...but little strange. it works and shows the "hello" message.
but it also print error message
" too many arguments ... "
so I decreased the arguments following printf( ) function.
however it was same.
o when it has 8, 9, 10 arguments,
it shows " too many arguments ... " error message
but printf the message " hello" on the monitor
taskSpawn ( ............................. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
taskSpawn ( ............................. 0, 0, 0, 0, 0, 0, 0, 0, 0)
taskSpawn ( ............................. 0, 0, 0, 0, 0, 0, 0, 0)
o when it has 1 ~ 7 arguments,
it shows " Exception number 4906 ... "
taskSpawn ( ............................. 0, 0, 0, 0, 0, 0, 0)
:
:
taskSpawn ( ............................. 0)
I've not tried sp() yet. i'll try it more.
thanks for good advises and let me know if you can find something more.
===================================================================
"molochai" <molo...@vapour-trail.demon.co.uk> wrote in message
news:b974178c4a%molo...@vapour-trail.demon.co.uk...
: In message <d7f51a07.01061...@posting.google.com>
-> taskSpawn "TASK_NAME", 50, 0, 20000, task_code_main
where 50 is the runtime priority, 20000 is the stack size and
the zero is a parameter I never use and can't remember the definition of!
Emory Stagmer
NAME
taskSpawn( ) - spawn a task
SYNOPSIS
int taskSpawn
(
char * name, /* name of new task (stored at pStackBase) */
int priority, /* priority of new task */
int options, /* task option word */
int stackSize, /* size (bytes) of stack needed plus name */
FUNCPTR entryPt, /* entry point of new task */
int arg1, /* 1st of 10 req'd task args to pass to func
*/
int arg2,
int arg3,
int arg4,
int arg5,
int arg6,
int arg7,
int arg8,
int arg9,
int arg10
)
Bits in the options argument may be set to run with
the following modes:
VX_FP_TASK (0x0008)
execute with floating-point coprocessor support.
VX_PRIVATE_ENV (0x0080)
include private environment support (see envLib).
VX_NO_STACK_FILL (0x0100)
do not fill the stack for use by checkStack( ).
VX_UNBREAKABLE (0x0002)
do not allow breakpoint debugging.
See the definitions in taskLib.h.