From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4BA9E71C.4000908@domain.hid> Date: Wed, 24 Mar 2010 11:19:08 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <1269389915.1931.3.camel@domain.hid> In-Reply-To: <1269389915.1931.3.camel@domain.hid> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] gpio-keys with xenomai List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.breuer@domain.hid Cc: xenomai@xenomai.org Peter Breuer wrote: > Hello, > I finally had the time to test some different settings... > > I wrote the following program: > #include > #include > #include > > #define IRQ_NUMBER 100 /* Intercept interrupt */ > #define IRQ_MODE I_NOAUTOENA //I_PROPAGATE //0 > #define TASK_PRIO 99 /* Highest RT priority */ > #define TASK_MODE T_FPU /* */ > #define TASK_STKSZ 0 /* Stack size (use default one) */ > #define PIPE_MINOR 0 > > RT_INTR intr_desc; > > RT_TASK server_desc; > > > void irq_server (void *cookie) > > { > int err = > rt_intr_create(&intr_desc,"MyIrq",IRQ_NUMBER,IRQ_MODE); > printf("int create: %d\n", err); > err = rt_intr_enable(&intr_desc); > printf("enable int: %d\n", err); > printf("begin..\n"); > err = rt_intr_wait(&intr_desc,TM_INFINITE); > printf("int wait:%d\n", err); > > } > > int main (int argc, char *argv[]) > > { > int err; > int a; > printf("Programmstart\n"); > mlockall(MCL_CURRENT|MCL_FUTURE); > > err = rt_task_create(&server_desc, > "MyIrqServer", > TASK_STKSZ, > TASK_PRIO, > TASK_MODE); > printf("task create: %d\n", err); > rt_task_start(&server_desc,&irq_server,NULL); > } > > void cleanup (void) > > { > rt_intr_delete(&intr_desc); > rt_task_delete(&server_desc); > } > > When I start it with the compiled xenomai, it runs until the > rt_intr_wait() and then quits, without any message. It doesnt even > execute printf("int wait:%d\n", err) > create_task, create_intr and enable_intr all return 0. > When I start the programm with a kernel, where xenomai isnt compiled in, > then it quits and complains about it. > When I start the programm with xenomai debug settings compiled in the > kernel, the system freezes at task creating. Heres the output: > Programmstart > taskXenomai: fatal: bug at kernel/xenomai/nucleus/shadow.c > :1128 (!irqs_disabled_hw()) > CPU PID PRI TIMEOUT STAT NAME > 0 0 -1 0 00400088 ROOT >> 0 923 99 0 00300180 MyIrqServer > Master time base: clock=114327768 > [] (show_stack+0x0/0x48) from [] (xnshadow_harden > +0x1d0/0x21c) > [] (xnshadow_harden+0x0/0x21c) from [] > (xnshadow_wait_barrier+0x124/0x138) > [] (xnshadow_wait_barrier+0x0/0x138) from [] > (xnshadow_sys_barrier+0x14/0x18) > r6:c309a000 r5:c309bfb0 r4:00000001 > [] (xnshadow_sys_barrier+0x0/0x18) from [] > (losyscall_event+0xb4/0x1ac) > [] (losyscall_event+0x0/0x1ac) from [] > (__ipipe_dispatch_event+0xd0/0x1c8) > [] (__ipipe_dispatch_event+0x0/0x1c8) from [] > (__ipipe_syscall_root+0x80/0x100) > [] (__ipipe_syscall_root+0x0/0x100) from [] > (vector_swi+0x68/0xa8) > > Any ideas? > is the irq-number, that I need for the rt_intr_create() the same number > that is shown in /proc/interrupts? > thx, greetings, > Peter You are using a too old patch. Please use an I-pipe patch for linux 2.6.28 or above. -- Gilles.