<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ARM LPC2378: data/prefetch abort after interrupt</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/37707/arm-lpc2378-data-prefetch-abort-after-interrupt</link><description> 
I have a problem with ARM LPC2378 revision B, configured with CPU
clock frequency at 72 MHZ. 
I have the following configuration: 
- an IRQ interrupt function linked to CPU timer 0 (vectored
interrupt). It is invoked with a period of 1 ms 
- an FIQ</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: ARM LPC2378: data/prefetch abort after interrupt</title><link>https://community.arm.com/thread/124492?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2008 06:01:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:48c87fad-0fd4-4e75-a054-7870cc73be4c</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Are you saying that you intentionally want to loose 10% of your
CPU capacity (while running the processor at maximum power
consumption)?&lt;/p&gt;

&lt;p&gt;
Note that the fast interrupt has higher priority than your delay,
so 100us may be the &lt;b&gt;minimum&lt;/b&gt; delay time. But if the FIQ happens
during the delay, you may get a longer delay. Have you looked into
running a second interrupt with 100us offset from the first timer
IRQ?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ARM LPC2378: data/prefetch abort after interrupt</title><link>https://community.arm.com/thread/124493?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2008 06:01:15 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ebc07a50-aa3b-445e-8de7-2503d2de8e3a</guid><dc:creator>Catcus Blip</dc:creator><description>&lt;p&gt;&lt;p&gt;
Do you have many interrupt source firing at the same time? Do you
support nested interupts? I think your stack is 15 levels deep.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ARM LPC2378: data/prefetch abort after interrupt</title><link>https://community.arm.com/thread/113727?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2008 05:58:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c326c2a0-e061-428f-b7ac-114156e32929</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
As already noted, it isn&amp;#39;t nice with a huge loop in an ISR. The
ISR should be quick. Very quick. Extremely quick. You must always
guarantee that you have exited your ISR before the hw needs to
generate the next IRQ of the same type. If you can&amp;#39;t promise that,
then you can no longer guaranttee that you do not loose
interrupts.&lt;/p&gt;

&lt;p&gt;
When you have multiple ISR, you must make sure that the total
runtime of all ISR does not need more than 100% of your CPU capacity,
and that no single interrupt source at any time gets delayed enough
that the processor trigs a new interrupt before the previous
interrupt from that source has been detected and the ISR called.&lt;/p&gt;

&lt;p&gt;
Another thing. fast-interrupt handler makes use of a pointer:
p_sd_data_rx. Where is it initialized? How do you proove that it
doesn&amp;#39;t overflow any destination buffer? Your code never tests it&amp;#39;s
value so every interrupt will step it further and further forward,
possibly overwriting unknown data in memory. If the stack (or another
pointer is overwritten), your program is lost.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ARM LPC2378: data/prefetch abort after interrupt</title><link>https://community.arm.com/thread/113719?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2008 05:54:31 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:eba4f14c-a071-402e-b23e-e55415f21af3</guid><dc:creator>Demis Biscaro</dc:creator><description>&lt;p&gt;&lt;p&gt;
I understand your observation but function duration is not the
cause of the problem.&lt;br /&gt;
The loop is only a dummy loop. I mean that I&amp;#39;ve written that loop
only to waste time inside IRQ function.&lt;br /&gt;
I&amp;#39;ve measured the duration of that function with my oscilloscope and
I&amp;#39;ve found that it lasts 100 microseconds, while it&amp;#39;s period is 1
millisecond.&lt;/p&gt;

&lt;p&gt;
There are no nested calls of that routine...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ARM LPC2378: data/prefetch abort after interrupt</title><link>https://community.arm.com/thread/100344?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2008 05:45:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:faaa4a56-d393-49b5-a50d-cbb4353f1135</guid><dc:creator>Catcus Blip</dc:creator><description>&lt;p&gt;&lt;p&gt;
I meant that the loop is long, of course...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ARM LPC2378: data/prefetch abort after interrupt</title><link>https://community.arm.com/thread/100349?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2008 05:44:40 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:92e59e00-07e5-40b8-90e7-2a7c1d97ccb0</guid><dc:creator>Catcus Blip</dc:creator><description>&lt;p&gt;&lt;p&gt;
Demis,&lt;br /&gt;
First, the loop inside your ISR is very loop - to have an ISR excute
such code is not a good idea. beter only to set a flag inside the ISR
and do the processing in the main loop instead, freeing the processor
to handle other interrupts.&lt;br /&gt;
say, what happens if you allow your loop to do 5 cycles rather than
500?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ARM LPC2378: data/prefetch abort after interrupt</title><link>https://community.arm.com/thread/76057?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2008 05:23:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:95453136-0566-4932-9b2d-af531f60864f</guid><dc:creator>Demis Biscaro</dc:creator><description>&lt;p&gt;&lt;p&gt;
Here is the code!&lt;/p&gt;

&lt;pre&gt;
/***********************************************
** This is the IRQ function invoked every 1 ms
************************************************/
void __IRQ__ irq_base_timer(void){
   T0IR = 1; /* reset interrupt flag */

   test_fun();


   VICVectAddr = 0; /* dummy write */
}

/***********************************************
** This is the function invoked inside
** irq_base_timer
**
** long sd[32];            // global array
** char buffer_rx_fw[512]; // global array
**
************************************************/
void test_fun(void){
   unsigned long cont;
/* dummy cycle */
   for(cont = 0; cont &amp;lt; 500; cont++){
      if(sd[31] == cont){
         sd[30]++;
         if(sd[29] == buffer_rx_fw[cont])
            sd[28]++;
      }
   }
}


/***********************************************
** This is the FIQ function used to deploy the
** MCI RX FIFO
**
** long* p_sd_fifo; // global pointer to FIFO
** char* p_sd_data_rx; // global pointer to RAM buffer
** long sd_long_count; // global long counter
**
************************************************/
void __FIQ__ irq_sd_rx(void){
   unsigned char i;
   union{unsigned long L; unsigned int W[2]; unsigned char B[4];} tmp;

   for(i = 0; i &amp;lt; 8; i++){
      tmp.L = *p_sd_fifo++;
      *p_sd_data_rx++ = tmp.B[0];
      *p_sd_data_rx++ = tmp.B[1];
      *p_sd_data_rx++ = tmp.B[2];
      *p_sd_data_rx++ = tmp.B[3];
   }    /* end for */
   if(sd_long_count &amp;amp; 1)
      p_sd_fifo = (long*)0xE008C080; // FIFO start address
   sd_long_count--;
}   /* end irq_sd_rx */

&lt;/pre&gt;

&lt;p&gt;
If I run this software the crash happens.&lt;br /&gt;
On the opposite If I copy the body of test_fun inside irq_base_timer
(and obviously comment the call to test_fun) the crash doesn&amp;#39;t
happen.&lt;/p&gt;

&lt;p&gt;
I don&amp;#39;t know why...&lt;/p&gt;

&lt;p&gt;
Thank you,&lt;/p&gt;

&lt;p&gt;
Demis&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ARM LPC2378: data/prefetch abort after interrupt</title><link>https://community.arm.com/thread/49507?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2008 03:55:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:11e1e068-bb0b-47a5-aeba-15533aeb1cac</guid><dc:creator>Catcus Blip</dc:creator><description>&lt;p&gt;&lt;p&gt;
Demis,&lt;br /&gt;
It is hard to say anything without seeing some code.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>