All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] freescale(imx53)  with xenomai patch
@ 2013-05-30 15:27 嵌入式工程师
  2013-05-30 18:21 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 18+ messages in thread
From: 嵌入式工程师 @ 2013-05-30 15:27 UTC (permalink / raw)
  To: xenomai

I set freescale board (imx53) gpio2-14 as  interrupttriggerpin and the kernal with xenomai patch. When i  use Interrupt handling in kernel space like Below code:

#define  MYIRQ  (1*32+14)

int irq=gpio_to_irq(MYIRQ);

staticintisr_code(xnintr_t *intr)

{

rt_intr_disable(&myinterrupt);

...

...
rt_intr_enable(&myinterrupt);

return RT_INTR_HANDLED;

}

.....

sampling_task1...........

sampling_task2...............

static int __init gpio_irq_init(void)
{

rt_intr_create(&myinterrupt, "myinterrupt", irq, isr_code, NULL, 0);

rt_task_create.....sampling_task1

..................sampling_task2

rt_intr_enable(&myinterrupt);


    return 0;
}

I find if the tasks i have created more and more the  ISR (Interruptresponse function)will lose a lot ofresponse .

So I do notknow ifI set theinterrupt priority levelis too low,or what?

If I hadto settheinterrupt priorityreal-time kernel, thenhow can Iset up?

or gpio Interrupt number is right ?

Strong real-timesystem requirements,but I do not know why if it has lots of task it will lose  real-time .

Thanks!



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-05-30 15:27 [Xenomai] freescale(imx53) with xenomai patch 嵌入式工程师
@ 2013-05-30 18:21 ` Gilles Chanteperdrix
  2013-05-31  1:34   ` 嵌入式工程师
  0 siblings, 1 reply; 18+ messages in thread
From: Gilles Chanteperdrix @ 2013-05-30 18:21 UTC (permalink / raw)
  To: 嵌入式工程师; +Cc: xenomai

On 05/30/2013 05:27 PM, 嵌入式工程师 wrote:

> I set freescale board (imx53) gpio2-14 as  interrupttriggerpin and the kernal with xenomai patch. When i  use Interrupt handling in kernel space like Below code:


What version of the I-pipe patch? What version of Xenomai?

Also, could you try sending mails following a bit the netiquette? At
least with words correctly detached?

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-05-30 18:21 ` Gilles Chanteperdrix
@ 2013-05-31  1:34   ` 嵌入式工程师
  2013-05-31  1:36     ` 嵌入式工程师
  0 siblings, 1 reply; 18+ messages in thread
From: 嵌入式工程师 @ 2013-05-31  1:34 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

The I-pipe path version is adeos-ipipe-2.6.35.9-arm-1.18-01.patch ,
the kernal version is 2.6.35.9 ,i am so sorry for he details do not speak clearly
在 2013-05-31 02:21:12,"Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org> 写道:
>On 05/30/2013 05:27 PM, 嵌入式工程师 wrote:
>
>> I set freescale board (imx53) gpio2-14 as  interrupttriggerpin and the kernal with xenomai patch. When i  use Interrupt handling in kernel space like Below code:
>
>
>What version of the I-pipe patch? What version of Xenomai?
>
>Also, could you try sending mails following a bit the netiquette? At
>least with words correctly detached?
>
>-- 
>                                                                Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-05-31  1:34   ` 嵌入式工程师
@ 2013-05-31  1:36     ` 嵌入式工程师
  2013-05-31  5:32       ` Gilles Chanteperdrix
  0 siblings, 1 reply; 18+ messages in thread
From: 嵌入式工程师 @ 2013-05-31  1:36 UTC (permalink / raw)
  To: 嵌入式工程师; +Cc: xenomai

The I-pipe path version is adeos-ipipe-2.6.35.9-arm-1.18-01.patch ,
the kernal version is 2.6.35.9 ,i am so sorry for he details do not speak clearly
At 2013-05-31 09:34:39,"嵌入式工程师" <ericvic@163.com> wrote:
>The I-pipe path version is adeos-ipipe-2.6.35.9-arm-1.18-01.patch ,
>the kernal version is 2.6.35.9 ,i am so sorry for he details do not speak clearly
>在 2013-05-31 02:21:12,"Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org> 写道:
>>On 05/30/2013 05:27 PM, 嵌入式工程师 wrote:
>>
>>> I set freescale board (imx53) gpio2-14 as  interrupttriggerpin and the kernal with xenomai patch. When i  use Interrupt handling in kernel space like Below code:
>>
>>
>>What version of the I-pipe patch? What version of Xenomai?
>>
>>Also, could you try sending mails following a bit the netiquette? At
>>least with words correctly detached?
>>
>>-- 
>>                                                                Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-05-31  1:36     ` 嵌入式工程师
@ 2013-05-31  5:32       ` Gilles Chanteperdrix
  2013-05-31  5:54         ` 嵌入式工程师
  0 siblings, 1 reply; 18+ messages in thread
From: Gilles Chanteperdrix @ 2013-05-31  5:32 UTC (permalink / raw)
  To: 嵌入式工程师; +Cc: xenomai

On 05/31/2013 03:36 AM, 嵌入式工程师 wrote:

> The I-pipe path version is adeos-ipipe-2.6.35.9-arm-1.18-01.patch ,
> the kernal version is 2.6.35.9 ,i am so sorry for he details do not speak clearly


Hi,

there is no need to send your answer three times either. GPIO irqs are
broken with this version of the I-pipe kernel. Please try updating to
the I-pipe core patch for Linux 3.4 or 3.5.

Regards.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-05-31  5:32       ` Gilles Chanteperdrix
@ 2013-05-31  5:54         ` 嵌入式工程师
  2013-06-01  8:41           ` 嵌入式工程师
  0 siblings, 1 reply; 18+ messages in thread
From: 嵌入式工程师 @ 2013-05-31  5:54 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

ok ,thanks,i have a try
在 2013-05-31 13:32:14,"Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org> 写道:
>On 05/31/2013 03:36 AM, 嵌入式工程师 wrote:
>
>> The I-pipe path version is adeos-ipipe-2.6.35.9-arm-1.18-01.patch ,
>> the kernal version is 2.6.35.9 ,i am so sorry for he details do not speak clearly
>
>
>Hi,
>
>there is no need to send your answer three times either. GPIO irqs are
>broken with this version of the I-pipe kernel. Please try updating to
>the I-pipe core patch for Linux 3.4 or 3.5.
>
>Regards.
>
>-- 
>                                                                Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-05-31  5:54         ` 嵌入式工程师
@ 2013-06-01  8:41           ` 嵌入式工程师
  2013-06-01 10:16             ` Gilles Chanteperdrix
  0 siblings, 1 reply; 18+ messages in thread
From: 嵌入式工程师 @ 2013-06-01  8:41 UTC (permalink / raw)
  To: 嵌入式工程师; +Cc: xenomai

I have try the kernal-3.4.6 with ipipe-core-3.4.6-arm-4.patch 
when I set three same Priority tasks I found untill the tasks stop ,the interrut founction will not run.
It same like before version kernal-2.6.35.9 with  ipipe-core-2.6.35.9-arm-4.patch


static int test_thread(void *data)
{
	//phase=ctrl_mnm1221_m();
	while(1)
	{
	if(flag)
	{
		printk("runting %lld\n",tt3);
		flag=0;
		}
	SLEEP_MILLI_SEC(50);

	}
	return 0;
}

int irq_handle_function(int irq, void *device_id)
{
	//if(phase==PH_RUNNING)
	//ctrl_mnm1221_m();
	rt_intr_disable(&amp;intr_desc);
	tt1=rt_timer_read();
	tt3=tt1-tt2;
	if(tt3&gt;300000)
	flag=1;
	tt2=tt1;
	rt_intr_enable(&amp;intr_desc);
	return RT_INTR_HANDLED;;
}


void taskOne(void*arg)
{
	int i;
	for (i=0; i &lt; 0xffff; i++)
	{	
		printk("Iam taskOneand global = %d................\n", tt3);
	}
}
void taskTwo(void*arg)
{
	int i;
	for (i=0; i &lt; 0xffff; i++)
	{	
		printk("Iam taskTwo global = %d................\n", tt3);
	}
}
void taskThree(void*arg)
{
	int i;
	for (i=0; i &lt; 0xffff; i++)
	{	
		printk("Iam taskThree global = %d................\n", tt3);
	}
}


static int __init rtex_init(void){
	irq= gpio_to_irq(MY_GPIO2_14);
	
	/*err=request_irq(irq, irq_handle_function, 0, "rtex", (void *)&amp;irq);
	if(err)
	{
		printk("regist irq failure...\n");
		return -EIO;
	}*/
	err = rt_intr_create(&amp;intr_desc,"MyIrq",irq,irq_handle_function,NULL,I_SHARED|I_EDGE);
	/* ... */
	
	rt_intr_enable(&amp;intr_desc);



	rt_task_create(&amp;t1, "task1", 0, 1, 0);
	rt_task_create(&amp;t2, "task2", 0, 1, 0);/* start the two tasks */
	rt_task_create(&amp;t3, "task2", 0, 1, 0);/* start the two tasks */
	rt_task_start(&amp;t1, &amp;taskOne, 0);
	rt_task_start(&amp;t2, &amp;taskTwo, 0);
	rt_task_start(&amp;t2, &amp;taskThree, 0);
}




 Every 500m gpio send an interrupt.
 The result like blow:
tt1=rt_timer_read();

global = 	tt3=tt1-tt2;

Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................     
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755.                            
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Irunting 502230                                                                 
root@freescale /opt$ runting 499995                                             
runting 500025                                                                  
runting 500115                                                                  
runting 500055                                                                  
runting 500025                                                                  
runting 500025                                                                  
runting 500010        
runting 500085                                                                  
runting 500010                                                                  
runting 500025                                                                  
runting 500055                                                                  
runting 500010                                                                  
runting 500055                                                                  
runting 499905                                                                  
runting 500460                                                                  
runting 500085                                                                  
runting 500070                                                                  
runting 500070                                                                  
runting 500010                                                                  
runting 500010                                                                  
runting 500085                                                                  
runting 500025                                                                  
runting 499980                                                                  
runting 500070                                                                  
runting 500040                                                                  
runting 500025                                                                  
runting 498735                                                                  
runting 500040                                                                  
runting 500025                                                                  
runting 500025                                                                  
runting 500220                                                                  
runting 499995                                                                  
runting 500010                                                                  
runting 500055                                                                  
runting 500010                                                                  
runting 500055                                                                  
runting 500025                                                                  
runting 500085                                                                  
runting 500025                                                                  
runting 500055                                                                  
runting 500025                                                                  
runting 500010                                                                  
runting 500100                                                                  
runting 500085                                                                  
runting 500010    

Then I do not know what should i do next?
在 2013-05-31 13:54:49,"嵌入式工程师" <ericvic@163.com> 写道:
>ok ,thanks,i have a try
>在 2013-05-31 13:32:14,"Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org> 写道:
>>On 05/31/2013 03:36 AM, 嵌入式工程师 wrote:
>>
>>> The I-pipe path version is adeos-ipipe-2.6.35.9-arm-1.18-01.patch ,
>>> the kernal version is 2.6.35.9 ,i am so sorry for he details do not speak clearly
>>
>>
>>Hi,
>>
>>there is no need to send your answer three times either. GPIO irqs are
>>broken with this version of the I-pipe kernel. Please try updating to
>>the I-pipe core patch for Linux 3.4 or 3.5.
>>
>>Regards.
>>
>>-- 
>>                                                                Gilles.
>
>
>_______________________________________________
>Xenomai mailing list
>Xenomai@xenomai.org
>http://www.xenomai.org/mailman/listinfo/xenomai



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-06-01  8:41           ` 嵌入式工程师
@ 2013-06-01 10:16             ` Gilles Chanteperdrix
  2013-06-03  1:36               ` 嵌入式工程师
  0 siblings, 1 reply; 18+ messages in thread
From: Gilles Chanteperdrix @ 2013-06-01 10:16 UTC (permalink / raw)
  To: 嵌入式工程师; +Cc: xenomai

On 06/01/2013 10:41 AM, 嵌入式工程师 wrote:

> I have try the kernal-3.4.6 with ipipe-core-3.4.6-arm-4.patch 
> when I set three same Priority tasks I found untill the tasks stop ,the interrut founction will not run.
> It same like before version kernal-2.6.35.9 with  ipipe-core-2.6.35.9-arm-4.patch
> 
> 
> static int test_thread(void *data)
> {
> 	//phase=ctrl_mnm1221_m();
> 	while(1)
> 	{
> 	if(flag)
> 	{
> 		printk("runting %lld\n",tt3);
> 		flag=0;
> 		}
> 	SLEEP_MILLI_SEC(50);
> 
> 	}
> 	return 0;
> }
> 
> int irq_handle_function(int irq, void *device_id)
> {
> 	//if(phase==PH_RUNNING)
> 	//ctrl_mnm1221_m();
> 	rt_intr_disable(&amp;intr_desc);
> 	tt1=rt_timer_read();
> 	tt3=tt1-tt2;
> 	if(tt3&gt;300000)
> 	flag=1;
> 	tt2=tt1;
> 	rt_intr_enable(&amp;intr_desc);
> 	return RT_INTR_HANDLED;;
> }


Why do you disable/enable the irq during the irq handler?


-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-06-01 10:16             ` Gilles Chanteperdrix
@ 2013-06-03  1:36               ` 嵌入式工程师
  2013-06-03  1:47                 ` 嵌入式工程师
  2013-06-03  6:03                 ` Gilles Chanteperdrix
  0 siblings, 2 replies; 18+ messages in thread
From: 嵌入式工程师 @ 2013-06-03  1:36 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

To prevent re-entry
在 2013-06-01 18:16:15,"Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org> 写道:
>On 06/01/2013 10:41 AM, 嵌入式工程师 wrote:
>
>> I have try the kernal-3.4.6 with ipipe-core-3.4.6-arm-4.patch 
>> when I set three same Priority tasks I found untill the tasks stop ,the interrut founction will not run.
>> It same like before version kernal-2.6.35.9 with  ipipe-core-2.6.35.9-arm-4.patch
>> 
>> 
>> static int test_thread(void *data)
>> {
>> 	//phase=ctrl_mnm1221_m();
>> 	while(1)
>> 	{
>> 	if(flag)
>> 	{
>> 		printk("runting %lld\n",tt3);
>> 		flag=0;
>> 		}
>> 	SLEEP_MILLI_SEC(50);
>> 
>> 	}
>> 	return 0;
>> }
>> 
>> int irq_handle_function(int irq, void *device_id)
>> {
>> 	//if(phase==PH_RUNNING)
>> 	//ctrl_mnm1221_m();
>> 	rt_intr_disable(&amp;intr_desc);
>> 	tt1=rt_timer_read();
>> 	tt3=tt1-tt2;
>> 	if(tt3&gt;300000)
>> 	flag=1;
>> 	tt2=tt1;
>> 	rt_intr_enable(&amp;intr_desc);
>> 	return RT_INTR_HANDLED;;
>> }
>
>
>Why do you disable/enable the irq during the irq handler?
>
>
>-- 
>                                                                Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-06-03  1:36               ` 嵌入式工程师
@ 2013-06-03  1:47                 ` 嵌入式工程师
  2013-06-03  6:03                 ` Gilles Chanteperdrix
  1 sibling, 0 replies; 18+ messages in thread
From: 嵌入式工程师 @ 2013-06-03  1:47 UTC (permalink / raw)
  To: 嵌入式工程师; +Cc: xenomai

sorry ,before I did not say clearly。It is Every 500Millisecond gpio send an interrupt
在 2013-06-03 09:36:27,"嵌入式工程师" <ericvic@163.com> 写道:
>To prevent re-entry
>在 2013-06-01 18:16:15,"Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org> 写道:
>>On 06/01/2013 10:41 AM, 嵌入式工程师 wrote:
>>
>>> I have try the kernal-3.4.6 with ipipe-core-3.4.6-arm-4.patch 
>>> when I set three same Priority tasks I found untill the tasks stop ,the interrut founction will not run.
>>> It same like before version kernal-2.6.35.9 with  ipipe-core-2.6.35.9-arm-4.patch
>>> 
>>> 
>>> static int test_thread(void *data)
>>> {
>>> 	//phase=ctrl_mnm1221_m();
>>> 	while(1)
>>> 	{
>>> 	if(flag)
>>> 	{
>>> 		printk("runting %lld\n",tt3);
>>> 		flag=0;
>>> 		}
>>> 	SLEEP_MILLI_SEC(50);
>>> 
>>> 	}
>>> 	return 0;
>>> }
>>> 
>>> int irq_handle_function(int irq, void *device_id)
>>> {
>>> 	//if(phase==PH_RUNNING)
>>> 	//ctrl_mnm1221_m();
>>> 	rt_intr_disable(&amp;intr_desc);
>>> 	tt1=rt_timer_read();
>>> 	tt3=tt1-tt2;
>>> 	if(tt3&gt;300000)
>>> 	flag=1;
>>> 	tt2=tt1;
>>> 	rt_intr_enable(&amp;intr_desc);
>>> 	return RT_INTR_HANDLED;;
>>> }
>>
>>
>>Why do you disable/enable the irq during the irq handler?
>>
>>
>>-- 
>>                                                                Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-06-03  1:36               ` 嵌入式工程师
  2013-06-03  1:47                 ` 嵌入式工程师
@ 2013-06-03  6:03                 ` Gilles Chanteperdrix
  2013-06-03  6:31                   ` 嵌入式工程师
  2013-06-03  8:24                   ` 嵌入式工程师
  1 sibling, 2 replies; 18+ messages in thread
From: Gilles Chanteperdrix @ 2013-06-03  6:03 UTC (permalink / raw)
  To: 嵌入式工程师; +Cc: xenomai

On 06/03/2013 03:36 AM, 嵌入式工程师 wrote:

> To prevent re-entry


You do not need to do that:
- hardware interrupts are off, so, there is no possible reentry
- if the interrupt if of the "level" type, the flow handler already does
it, and with some edge type interrupt handler, you risk to miss interrupts.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-06-03  6:03                 ` Gilles Chanteperdrix
@ 2013-06-03  6:31                   ` 嵌入式工程师
  2013-06-03  8:24                   ` 嵌入式工程师
  1 sibling, 0 replies; 18+ messages in thread
From: 嵌入式工程师 @ 2013-06-03  6:31 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

I have removed the disable and enble codes .,but  It still be  interrupted   by the rt_task。
If it does not let the task runing the Interruption time will be very accurate.
why?
在 2013-06-03 14:03:14,"Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org> 写道:
>On 06/03/2013 03:36 AM, 嵌入式工程师 wrote:
>
>> To prevent re-entry
>
>
>You do not need to do that:
>- hardware interrupts are off, so, there is no possible reentry
>- if the interrupt if of the "level" type, the flow handler already does
>it, and with some edge type interrupt handler, you risk to miss interrupts.
>
>-- 
>                                                                Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-06-03  6:03                 ` Gilles Chanteperdrix
  2013-06-03  6:31                   ` 嵌入式工程师
@ 2013-06-03  8:24                   ` 嵌入式工程师
  2013-06-03 11:46                     ` Gilles Chanteperdrix
  1 sibling, 1 reply; 18+ messages in thread
From: 嵌入式工程师 @ 2013-06-03  8:24 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

I have set the trigger type with Low trigger  and without disable and enable codes.
if the interrupt is triggered the hardware will set the gpio with High 。
It has the same problem.
I do not why ?
Thanks!
在 2013-06-03 14:03:14,"Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org> 写道:
>On 06/03/2013 03:36 AM, 嵌入式工程师 wrote:
>
>> To prevent re-entry
>
>
>You do not need to do that:
>- hardware interrupts are off, so, there is no possible reentry
>- if the interrupt if of the "level" type, the flow handler already does
>it, and with some edge type interrupt handler, you risk to miss interrupts.
>
>-- 
>                                                                Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-06-03  8:24                   ` 嵌入式工程师
@ 2013-06-03 11:46                     ` Gilles Chanteperdrix
  2013-06-05 14:34                       ` 嵌入式工程师
  0 siblings, 1 reply; 18+ messages in thread
From: Gilles Chanteperdrix @ 2013-06-03 11:46 UTC (permalink / raw)
  To: 嵌入式工程师; +Cc: xenomai

On 06/03/2013 10:24 AM, 嵌入式工程师 wrote:

> I have set the trigger type with Low trigger  and without disable and enable codes.
> if the interrupt is triggered the hardware will set the gpio with High 。
> It has the same problem.
> I do not why ?


Ok, could you tell me:
- what type you set for your interrupt (with irq_set_irq_type)?
- what is the shape of the signal?

Sorry for stating the obvious, but if the gpio is toggled every
500milliseconds and you set the irq type to level (low or high), the
interrupts is considered to be asserted by the interrupt controller
during 500 milliseconds, and so your interrupt handler is called
continuously during 500 milliseconds. In that case, what you would be
interested in would be to call:
 irq_set_irq_type(irq, IRQ_TYPE_EDGE_BOTH)
for instance.

Regards.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-06-03 11:46                     ` Gilles Chanteperdrix
@ 2013-06-05 14:34                       ` 嵌入式工程师
  2013-06-05 18:31                         ` Gilles Chanteperdrix
  0 siblings, 1 reply; 18+ messages in thread
From: 嵌入式工程师 @ 2013-06-05 14:34 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Now ,I suddenly noticed,P and V operation must not be interrupted operation. Before I did not know my colleague spent rt_sem_p () and rt_sem_v ().
Today, I suddenly saw it.
I also would like to ask, rt_alarm_inquire is available in rt_sem_v () operation, timing counts?
Because they are in the case with a timer but also a very accurate timekeeping pv operation.
在 2013-06-03 19:46:17,"Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org> 写道:
>On 06/03/2013 10:24 AM, 嵌入式工程师 wrote:
>
>> I have set the trigger type with Low trigger  and without disable and enable codes.
>> if the interrupt is triggered the hardware will set the gpio with High 。
>> It has the same problem.
>> I do not why ?
>
>
>Ok, could you tell me:
>- what type you set for your interrupt (with irq_set_irq_type)?
>- what is the shape of the signal?
>
>Sorry for stating the obvious, but if the gpio is toggled every
>500milliseconds and you set the irq type to level (low or high), the
>interrupts is considered to be asserted by the interrupt controller
>during 500 milliseconds, and so your interrupt handler is called
>continuously during 500 milliseconds. In that case, what you would be
>interested in would be to call:
> irq_set_irq_type(irq, IRQ_TYPE_EDGE_BOTH)
>for instance.
>
>Regards.
>
>-- 
>                                                                Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] freescale(imx53)  with xenomai patch
  2013-06-05 14:34                       ` 嵌入式工程师
@ 2013-06-05 18:31                         ` Gilles Chanteperdrix
  0 siblings, 0 replies; 18+ messages in thread
From: Gilles Chanteperdrix @ 2013-06-05 18:31 UTC (permalink / raw)
  To: 嵌入式工程师; +Cc: xenomai

On 06/05/2013 04:34 PM, 嵌入式工程师 wrote:

> Now ,I suddenly noticed,P and V operation must not be interrupted operation.


They can not be, they grab the nucleus spinlock.

> Before I did not know my colleague spent rt_sem_p () and rt_sem_v ().
> Today, I suddenly saw it.
> I also would like to ask, rt_alarm_inquire is available in rt_sem_v () operation, timing counts?
> Because they are in the case with a timer but also a very accurate timekeeping pv operation.


I am sorry, but I do not understand what you ask. The unit of the
timings used and returned by the native skin services is documented in
the API documentation.

Besides, using the native API to handle interrupts is deprecated.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Xenomai] freescale(imx53) with xenomai patch
@ 2013-06-01  8:43 嵌入式工程师
  0 siblings, 0 replies; 18+ messages in thread
From: 嵌入式工程师 @ 2013-06-01  8:43 UTC (permalink / raw)
  To: Xenomai

I have try the kernal-3.4.6 with ipipe-core-3.4.6-arm-4.patch 
when I set three same Priority tasks I found untill the tasks stop ,the interrut founction will not run.
It same like before version kernal-2.6.35.9 with  ipipe-core-2.6.35.9-arm-4.patch


static int test_thread(void *data)
{
	//phase=ctrl_mnm1221_m();
	while(1)
	{
	if(flag)
	{
		printk("runting %lld\n",tt3);
		flag=0;
		}
	SLEEP_MILLI_SEC(50);

	}
	return 0;
}

int irq_handle_function(int irq, void *device_id)
{
	//if(phase==PH_RUNNING)
	//ctrl_mnm1221_m();
	rt_intr_disable(&amp;intr_desc);
	tt1=rt_timer_read();
	tt3=tt1-tt2;
	if(tt3&gt;300000)
	flag=1;
	tt2=tt1;
	rt_intr_enable(&amp;intr_desc);
	return RT_INTR_HANDLED;;
}


void taskOne(void*arg)
{
	int i;
	for (i=0; i &lt; 0xffff; i++)
	{	
		printk("Iam taskOneand global = %d................\n", tt3);
	}
}
void taskTwo(void*arg)
{
	int i;
	for (i=0; i &lt; 0xffff; i++)
	{	
		printk("Iam taskTwo global = %d................\n", tt3);
	}
}
void taskThree(void*arg)
{
	int i;
	for (i=0; i &lt; 0xffff; i++)
	{	
		printk("Iam taskThree global = %d................\n", tt3);
	}
}


static int __init rtex_init(void){
	irq= gpio_to_irq(MY_GPIO2_14);
	
	/*err=request_irq(irq, irq_handle_function, 0, "rtex", (void *)&amp;irq);
	if(err)
	{
		printk("regist irq failure...\n");
		return -EIO;
	}*/
	err = rt_intr_create(&amp;intr_desc,"MyIrq",irq,irq_handle_function,NULL,I_SHARED|I_EDGE);
	/* ... */
	
	rt_intr_enable(&amp;intr_desc);



	rt_task_create(&amp;t1, "task1", 0, 1, 0);
	rt_task_create(&amp;t2, "task2", 0, 1, 0);/* start the two tasks */
	rt_task_create(&amp;t3, "task2", 0, 1, 0);/* start the two tasks */
	rt_task_start(&amp;t1, &amp;taskOne, 0);
	rt_task_start(&amp;t2, &amp;taskTwo, 0);
	rt_task_start(&amp;t2, &amp;taskThree, 0);
}




 Every 500m gpio send an interrupt.
 The result like blow:
tt1=rt_timer_read();

global = 	tt3=tt1-tt2;

Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................     
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755.                            
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Iam taskTwo global = 1610612755................                                 
Irunting 502230                                                                 
root@freescale /opt$ runting 499995                                             
runting 500025                                                                  
runting 500115                                                                  
runting 500055                                                                  
runting 500025                                                                  
runting 500025                                                                  
runting 500010        
runting 500085                                                                  
runting 500010                                                                  
runting 500025                                                                  
runting 500055                                                                  
runting 500010                                                                  
runting 500055                                                                  
runting 499905                                                                  
runting 500460                                                                  
runting 500085                                                                  
runting 500070                                                                  
runting 500070                                                                  
runting 500010                                                                  
runting 500010                                                                  
runting 500085                                                                  
runting 500025                                                                  
runting 499980                                                                  
runting 500070                                                                  
runting 500040                                                                  
runting 500025                                                                  
runting 498735                                                                  
runting 500040                                                                  
runting 500025                                                                  
runting 500025                                                                  
runting 500220                                                                  
runting 499995                                                                  
runting 500010                                                                  
runting 500055                                                                  
runting 500010                                                                  
runting 500055                                                                  
runting 500025                                                                  
runting 500085                                                                  
runting 500025                                                                  
runting 500055                                                                  
runting 500025                                                                  
runting 500010                                                                  
runting 500100                                                                  
runting 500085                                                                  
runting 500010    

Then I do not know what should i do next?
在 2013-05-31 13:54:49,"嵌入式工程师" <ericvic@163.com> 写道:
>ok ,thanks,i have a try
>在 2013-05-31 13:32:14,"Gilles Chanteperdrix" <gilles.chanteperdrix@xenomai.org> 写道:
>>On 05/31/2013 03:36 AM, 嵌入式工程师 wrote:
>>
>>> The I-pipe path version is adeos-ipipe-2.6.35.9-arm-1.18-01.patch ,
>>> the kernal version is 2.6.35.9 ,i am so sorry for he details do not speak clearly
>>
>>
>>Hi,
>>
>>there is no need to send your answer three times either. GPIO irqs are
>>broken with this version of the I-pipe kernel. Please try updating to
>>the I-pipe core patch for Linux 3.4 or 3.5.
>>
>>Regards.
>>
>>-- 
>>                                                                Gilles.
>
>
>_______________________________________________
>Xenomai mailing list
>Xenomai@xenomai.org
>http://www.xenomai.org/mailman/listinfo/xenomai

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Xenomai] freescale(imx53) with xenomai patch
@ 2013-05-31  1:50 嵌入式工程师
  0 siblings, 0 replies; 18+ messages in thread
From: 嵌入式工程师 @ 2013-05-31  1:50 UTC (permalink / raw)
  To: xenomai

I set freescale board (imx53) gpio2-14 as  interrupt trigger pin and the kernal with xenomai patch. When i  use Interrupt handling in kernel space like Below code:

#define  MYIRQ  (1*32+14)

int irq=gpio_to_irq(MYIRQ);

static int isr_code(xnintr_t *intr)

{

rt_intr_disable(&myinterrupt);

...

...
rt_intr_enable(&myinterrupt);

return RT_INTR_HANDLED;

}

.....

sampling_task1...........

sampling_task2...............

static int __init gpio_irq_init(void)
{

rt_intr_create(&myinterrupt, "myinterrupt", irq, isr_code, NULL, 0);

rt_task_create.....sampling_task1

..................sampling_task2

rt_intr_enable(&myinterrupt);


    return 0;
}
The I-pipe path version is adeos-ipipe-2.6.35.9-arm-1.18-01.patch ,
the kernal version is 2.6.35.9

I find if the tasks i have created more and more the  ISR (Interrupt response function)will lose a lot of response .

So I do not know if I set the interrupt priority level is too low, or what?

If I had to set the interrupt priority real-time kernel, then how can I set up?

or gpio Interrupt number is right ?

Strong real-time system requirements,but I do not know why if it has lots of task it will lose  real-time .

Thanks!

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-06-05 18:31 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-30 15:27 [Xenomai] freescale(imx53) with xenomai patch 嵌入式工程师
2013-05-30 18:21 ` Gilles Chanteperdrix
2013-05-31  1:34   ` 嵌入式工程师
2013-05-31  1:36     ` 嵌入式工程师
2013-05-31  5:32       ` Gilles Chanteperdrix
2013-05-31  5:54         ` 嵌入式工程师
2013-06-01  8:41           ` 嵌入式工程师
2013-06-01 10:16             ` Gilles Chanteperdrix
2013-06-03  1:36               ` 嵌入式工程师
2013-06-03  1:47                 ` 嵌入式工程师
2013-06-03  6:03                 ` Gilles Chanteperdrix
2013-06-03  6:31                   ` 嵌入式工程师
2013-06-03  8:24                   ` 嵌入式工程师
2013-06-03 11:46                     ` Gilles Chanteperdrix
2013-06-05 14:34                       ` 嵌入式工程师
2013-06-05 18:31                         ` Gilles Chanteperdrix
2013-05-31  1:50 嵌入式工程师
2013-06-01  8:43 嵌入式工程师

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.