
Dobry den ve spolek, mam takovou otazku. Snayim se prijit na chybu v ukolu 6 a prisla jsem na to, ze se ruzne printf vypisuji do ruznych konzoli a ja si v tom chtela udelat jasno, jak to tedy funguje. Tedy konkretne, mam Downloadable kernel modul projekt, kde jsem v run configuration nastavila allocate console. V ni se vypisuji jen printf, ktere jsou primo v entry pointu. Printf v service thredu se zas vypisuji do GtkTerm. Funkce toho driveru, co mame implementovat, tak jeji printif se mi nevypisuji ani do alokovane konzole ve windriveru ani do GtkTerm. Kde takovehle vypisy hledat? Jak to funguje? Dekuju za odpoved, Jitka Hodna

Hello, please write in English if possible. Generally, DKM is pritf to /dev/ttyUSB0 and RTP to terminal in WindRiver, if I remember it correctly. Also, please note that if you printf() in ISR, the whole board freezes. And thats OK. Have a nice day, Jiri Vlasak On 11/25/18 12:57 PM, Jitka Hodná wrote:
Dobry den ve spolek,
mam takovou otazku. Snayim se prijit na chybu v ukolu 6 a prisla jsem na to, ze se ruzne printf vypisuji do ruznych konzoli a ja si v tom chtela udelat jasno, jak to tedy funguje. Tedy konkretne, mam Downloadable kernel modul projekt, kde jsem v run configuration nastavila allocate console. V ni se vypisuji jen printf, ktere jsou primo v entry pointu. Printf v service thredu se zas vypisuji do GtkTerm. Funkce toho driveru, co mame implementovat, tak jeji printif se mi nevypisuji ani do alokovane konzole ve windriveru ani do GtkTerm. Kde takovehle vypisy hledat? Jak to funguje?
Dekuju za odpoved,
Jitka Hodna
_______________________________________________ PSR mailing list PSR@rtime.felk.cvut.cz You can unsubscribe from the list at https://rtime.felk.cvut.cz/mailman/listinfo/psr

Hi all, replying in English... On Sun, Nov 25 2018, Jitka Hodná wrote:
Dobry den ve spolek,
mam takovou otazku. Snayim se prijit na chybu v ukolu 6 a prisla jsem na to, ze se ruzne printf vypisuji do ruznych konzoli a ja si v tom chtela udelat jasno, jak to tedy funguje. Tedy konkretne, mam Downloadable kernel modul projekt, kde jsem v run configuration nastavila allocate console. V ni se vypisuji jen printf, ktere jsou primo v entry pointu. Printf v service thredu se zas vypisuji do GtkTerm. Funkce toho driveru, co mame implementovat, tak jeji printif se mi nevypisuji ani do alokovane konzole ve windriveru ani do GtkTerm. Kde takovehle vypisy hledat? Jak to funguje?
There are multiple things to consider: 1) Buffering of stdout: stdout is line-buffered. This means the string is pushed out of the application buffer to the real output only after printing a new-line character ("\n"). Students often forget that. 2) Standard I/O redirection: Under VxWorsk, each kernel task (not RTP task) can have standard I/O redirected to somewhere else. By default all tasks use the system console (serial line on the board). This default can be changed by 1) IDE console redirection (Allocate console check box in the Run dialog) or 2) by calling ioTaskStdSet() or ioGlobalStdSet(). This is documented at: Wind River Documentation > VxWorks, 6.9 > VxWorks Kernel Programmer's Guide, 6.9 > Core Technologies > I/O System > Basic I/O So the main task spawned from the IDE with Allocate console switched on have the stdio redirected to the IDE, while the tasks spawned from that main task have stdio connected to the serial console. I believe that this can be changed by calling ioGlobalStdSet(), but I have never tried it. Best regards, -Michal Sojka
participants (3)
-
Jiri Vlasak
-
Jitka Hodná
-
Michal Sojka