<?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>About interrupt</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/40989/about-interrupt</link><description> 
Hi 
I am trying to use EXTI interrupt which should toggle an led but
program stops in an endless loop when I use the following code. 
I am using STM32L1 discovery board. I had the same problem when using
TIM2 interrupt too. 
a part of my code is: 
</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: About interrupt</title><link>https://community.arm.com/thread/82611?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2015 08:00:54 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3fd5ee8c-23cc-4962-99f1-093c9d599f14</guid><dc:creator>hamed ad</dc:creator><description>&lt;p&gt;&lt;p&gt;
The problem solved after I removed the file below which I had
written it for timer interrupt&lt;/p&gt;

&lt;pre&gt;
void Init_NVIC(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
 //NVIC_SETPRIMASK();
  // NVIC init
#ifndef  EMB_FLASH
  /* Set the Vector Table base location at 0x20000000 */
  NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);
#else  /* VECT_TAB_FLASH  */
  /* Set the Vector Table base location at 0x08000000 */
  NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
#endif
  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
        NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn;
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 7;
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  NVIC_Init(&amp;amp;NVIC_InitStructure);

        NVIC_EnableIRQ(TIM2_IRQn);
        TIM2-&amp;gt;DIER = TIM_DIER_UIE;
}
&lt;/pre&gt;

&lt;p&gt;
I modified it like below:&lt;/p&gt;

&lt;pre&gt;
     NVIC_InitTypeDef   NVIC_InitStructure;

          NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn;
          NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01;
          NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x01;
          NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
          NVIC_Init(&amp;amp;NVIC_InitStructure);

        // Clear update interrupt bit
  TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
  // Enable update interrupt
  TIM_ITConfig(TIM2,TIM_IT_Update,ENABLE);
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About interrupt</title><link>https://community.arm.com/thread/69233?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2015 12:26:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9360ece2-c137-42ae-9eb5-8812d8481cea</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Where, exactly, is that &amp;quot;endless loop&amp;quot;.&lt;/p&gt;

&lt;p&gt;
Is it the Hard Fault handler ... ?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>