From: Jan Kiszka <jan.kiszka@domain.hid>
To: Steve Kreyer <steve.kreyer@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Timer problems?
Date: Fri, 25 Aug 2006 19:47:42 +0200 [thread overview]
Message-ID: <44EF37BE.70207@domain.hid> (raw)
In-Reply-To: <44EF17E8.5040606@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2250 bytes --]
Steve Kreyer wrote:
> Hi,
>
> Ive got a problem using periodic tasks, or timers in generally.
> First of all the relevant piece of source:
>
> -----------------------------------------------------------------------------------------------------
>
> #define SLEEP_TIME 100000000
>
> ...
>
> static void xmit(void* user_data){
> int err = 0;
> unsigned long timeout;
> err = rt_task_set_periodic(NULL, TM_NOW, SLEEP_TIME);
> if(err < 0){
> fprintf(stderr, "Error: Cannot set rt task 'xmit' periodic!
> errcode=%d\n", err);
> return;
> }
> err = rt_task_wait_period(&timeout);
> if(err < 0)
> fprintf(stderr, "Warning: Cannot wait for task period! errcode=%d
> timeout=%ld\n", err, timeout);
> }
> ...
> int main(){
> int err = 0;
> mlockall(MCL_CURRENT | MCL_FUTURE);
> signal(SIGINT, cleanup);
> err = rt_timer_set_mode(TM_ONESHOT);
> if(err < 0){
> fprintf(stderr, "Error: Cannot set rt timer mode to TM_ONESHOT!
> errcode=%d\n", err);
> return 1;
> }
> err = rt_task_spawn(&xmit_task, xmit_task_name, 0, XMIT_TASK_PRIO,
> T_FPU, xmit, NULL);
> ...
> }
> -------------------------------------------------------------------------------------------------------------
>
>
> The task did not wait for the period to which it is set.
> I get always an ETIMEDOUT error, and a timer overrun of 16 times when I
> try to call rt_task_wait_period...
> Also another problem is, everytime I try to call rt_task_sleep or the
> standard linux library functions pause,sleep or usleep,
> my system does not react on inputs anymore and I have to restart the
> machine...
> Can anyone tell me whats going on there?
> If you need additional informations, please let me know :)
>
Your example (with slight modifications) works fine, and the other
effect you listed here clearly indicates some fundamental problem of
your box. Does the kernel log contain any suspicious messages,
specifically after that input lock-up? If not, please provide a precise
setup description: Xenomai version, kernel version + ipipe revision,
hardware description (e.g. the architecture), and the .config of your
system (zipped please).
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2006-08-25 17:47 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-07 14:42 [Xenomai-help] Problems with rt_task_wait_period Steve Kreyer
2006-08-07 15:27 ` Jan Kiszka
2006-08-07 15:32 ` Philippe Gerum
2006-08-25 15:31 ` [Xenomai-help] Timer problems? Steve Kreyer
2006-08-25 17:47 ` Jan Kiszka [this message]
2006-08-26 20:34 ` Steve Kreyer
2006-08-27 10:38 ` Jan Kiszka
2006-08-27 12:08 ` Philippe Gerum
2006-08-27 12:24 ` Bernhard Walle
2006-08-28 14:46 ` Philippe Gerum
2006-08-27 12:34 ` Gilles Chanteperdrix
2006-08-27 13:02 ` Philippe Gerum
2006-08-27 13:56 ` Jan Kiszka
2006-08-27 13:47 ` Steve Kreyer
2006-08-27 14:22 ` Philippe Gerum
2006-08-27 14:25 ` Philippe Gerum
2006-08-27 14:45 ` Steve Kreyer
[not found] ` <44F196A0.2030006@domain.hid>
2006-08-27 13:00 ` Steve Kreyer
2006-08-25 17:57 ` [Xenomai-help] " Bernhard Walle
2006-08-26 21:23 ` Steve Kreyer
2006-08-26 21:38 ` Bernhard Walle
2006-08-26 22:12 ` Philippe Gerum
2006-08-27 9:21 ` Steve Kreyer
2006-08-27 9:34 ` Philippe Gerum
2006-08-27 10:31 ` Gilles Chanteperdrix
2006-08-27 9:27 ` Steve Kreyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44EF37BE.70207@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=steve.kreyer@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.