stdout from tasks - VxWorks

This is a discussion on stdout from tasks - VxWorks ; Hello, Kind of new to VxWorks so please bear with me if this is a dumb question. So I'm unable to get printf - stdout to my shell from tasks that I've spawned on the target. From what I could ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: stdout from tasks

  1. stdout from tasks

    Hello,

    Kind of new to VxWorks so please bear with me if this is a dumb
    question.

    So I'm unable to get printf - stdout to my shell from tasks that I've
    spawned on the target. From what I could gather this is because the
    shell runs at a much higher priority than my task. I think there's a
    way to get a task's stdout to a serial port, however this isn't a
    great solution for me since the target is in another building.

    I'd still like to get printf output from tasks just for development
    and debugging puposes. Is there some other way to do that like
    redirecting a task's stdout or telnet to a machine connected to the
    serial output.....?

    Thanks.


  2. Re: stdout from tasks

    On 2007-08-01, Rocketman wrote:
    >
    > So I'm unable to get printf - stdout to my shell from tasks that I've
    > spawned on the target. From what I could gather this is because the
    > shell runs at a much higher priority than my task. I think there's a
    > way to get a task's stdout to a serial port, however this isn't a
    > great solution for me since the target is in another building.


    Hmm. I have no trouble getting printfs from tasks at a variety of
    priorities, although it's been quite some time since I ran stuff at a
    lower priority than the shell.

    The most trouble I have is remembering to do an fflush() after output.
    If you don't, vxWorks like to squirrel the output away until it gets
    around to flushing the buffer.
    --
    roger ivie
    rivie@ridgenet.net

  3. Re: stdout from tasks

    Hello Rocketman,
    Rocketman schrieb:
    > I'd still like to get printf output from tasks just for development
    > and debugging puposes. Is there some other way to do that like
    > redirecting a task's stdout or telnet to a machine connected to the
    > serial output.....?


    The target server has a property setting, which is "redirect console
    I(O" or such.
    Since I do not knopw your Toolversion, I can't go into details.

    Take care.

    --
    BaSystem Martin Raabe
    E: Martin.RaabeB-a-S-y-s-t-e-mde

  4. Re: stdout from tasks

    On Aug 3, 3:14 pm, Martin Raabe
    wrote:
    > Hello Rocketman,
    > Rocketman schrieb:
    >
    > > I'd still like to get printf output from tasks just for development
    > > and debugging puposes. Is there some other way to do that like
    > > redirecting a task's stdout or telnet to a machine connected to the
    > > serial output.....?

    >
    > The target server has a property setting, which is "redirect console
    > I(O" or such.
    > Since I do not knopw your Toolversion, I can't go into details.
    >
    > Take care.
    >
    > --
    > BaSystem Martin Raabe
    > E: Martin.RaabeB-a-S-y-s-t-e-mde


    Thanks for the replies. Let me post some simple code to show the
    problem.
    The target seems to be directing IO only from the main thread and not
    from a task that I spawn.


    #include "cstdio"

    void myTask(void);

    int myData = 0;
    int tidMyTask = 0;

    int start(void)
    {
    printf("myData before task is: %i\n", myData);

    tidMyTask = taskSpawn ("tTaskName", 100, 0, 20000,
    (FUNCPTR)myTask, 0,0,0,0,0,0,0,0,0,0);

    taskDelay(100);

    printf("myData after task is: %i\n", myData);

    taskDelete(tidMyTask);

    return 1;
    }


    void myTask(void)
    {
    printf("Starting my task"); //this never happens

    myData = 56; //this does happen

    printf("myData inside of task is: %i\n", myData); //this never
    happens
    }

    ----------------------------------------
    Output from the Tornado shell

    ->start
    myData before task is: 0
    myData after task is: 56
    value = 1 = 0x1


    As you can see the printf statements in the task never appear at the
    shell.









+ Reply to Thread