AnsweredAssumed Answered

Why SysTick_Handler won't execute within an EXTI_IRQHandler?

Question asked by dice on Feb 4, 2015
Latest reply on Feb 4, 2015 by Clive One
Hi there.

I can't get my head around this and was hoping someone could help ... despite having set a higher priority to the SysTick irq, it doesn't seem to decrement an integer variable when called from an ira triggered by a push button.

here some code ...
001./**
002.  ******************************************************************************
003.  * @file    src/stm32f4xx_it.c
004.  * @author
005.  * @version V1.0.0
006.  * @date    25-January-2015
007.  * @brief   Main Interrupt Service Routines.
008.  *          This file provides template for all exceptions handler and
009.  *          peripherals interrupt service routine.
010.  ******************************************************************************
011.  */
012. 
013./* Includes ------------------------------------------------------------------*/
014.#include "main.h"
015. 
016. 
017./** @addtogroup
018.  * @{
019.  */
020. 
021./* Private typedef -----------------------------------------------------------*/
022./* Private define ------------------------------------------------------------*/
023./* Private macro -------------------------------------------------------------*/
024./* Private variables ---------------------------------------------------------*/
025.__IO uint32_t  TimingDelay;
026. 
027./* Private function prototypes -----------------------------------------------*/
028.static void Delay_ms(uint32_t ms);
029. 
030./* Private functions ---------------------------------------------------------*/
031. 
032./******************************************************************************/
033./*            Cortex-M4 Processor Exceptions Handlers                         */
034./******************************************************************************/
035. 
036./**
037.  * @brief  NMI_Handler
038.  *         This function handles NMI exception.
039.  * @param  None
040.  * @retval None
041.  */
042.void NMI_Handler(void)
043.{
044.}
045. 
046./**
047.  * @brief  HardFault_Handler
048.  *         This function handles Hard Fault exception.
049.  * @param  None
050.  * @retval None
051.  */
052.void HardFault_Handler(void)
053.{
054.  /* Go to infinite loop when Hard Fault exception occurs */
055.  while (1)
056.  {
057.  }
058.}
059. 
060./**
061.  * @brief  MemManage_Handler
062.  *         This function handles Memory Manage exception.
063.  * @param  None
064.  * @retval None
065.  */
066.void MemManage_Handler(void)
067.{
068.  /* Go to infinite loop when Memory Manage exception occurs */
069.  while (1)
070.  {
071.  }
072.}
073. 
074./**
075.  * @brief  BusFault_Handler
076.  *         This function handles Bus Fault exception.
077.  * @param  None
078.  * @retval None
079.  */
080.void BusFault_Handler(void)
081.{
082.  /* Go to infinite loop when Bus Fault exception occurs */
083.  while (1)
084.  {
085.  }
086.}
087. 
088./**
089.  * @brief  UsageFault_Handler
090.  *         This function handles Usage Fault exception.
091.  * @param  None
092.  * @retval None
093.  */
094.void UsageFault_Handler(void)
095.{
096.  /* Go to infinite loop when Usage Fault exception occurs */
097.  while (1)
098.  {
099.  }
100.}
101. 
102./**
103.  * @brief  SVC_Handler
104.  *         This function handles SVCall exception.
105.  * @param  None
106.  * @retval None
107.  */
108.void SVC_Handler(void)
109.{
110.}
111. 
112./**
113.  * @brief  DebugMon_Handler
114.  *         This function handles Debug Monitor exception.
115.  * @param  None
116.  * @retval None
117.  */
118.void DebugMon_Handler(void)
119.{
120.}
121. 
122./**
123.  * @brief  PendSV_Handler
124.  *         This function handles PendSVC exception.
125.  * @param  None
126.  * @retval None
127.  */
128.void PendSV_Handler(void)
129.{
130.}
131. 
132./**
133.  * @brief  SysTick_Handler
134.  *         This function handles SysTick Handler.
135.  * @param  None
136.  * @retval None
137.  */
138.void SysTick_Handler(void)
139.{
140.  TimingDelay_Decrement();
141.}
142. 
143./******************************************************************************/
144./*            STM32F4xx Peripherals Interrupt Handlers                        */
145./******************************************************************************/
146. 
147./**
148.  * @brief  USARTx_IRQHandler
149.  *         This function handles USARTx global interrupt request.
150.  * @param  None
151.  * @retval None
152.  */
153.void USARTx_IRQHandler(void)
154.{
155.}
156. 
157./******************************************************************************/
158./*                 STM32F4xx Peripherals Interrupt Handlers                   */
159./*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
160./*  available peripheral interrupt handler's name please refer to the startup */
161./*  file (startup_stm32f4xx.c).                                               */
162./******************************************************************************/
163. 
164./**
165.  * @brief  EXTI0_IRQHandler
166.  *         This function handles External line 0 interrupt request.
167.  * @param  None
168.  * @retval None
169.  */
170.void EXTI0_IRQHandler(void) /* WU button */
171.{
172.  if(EXTI_GetITStatus(EXTI_Line0) != RESET)
173.  {
174.    STM_LEDToggle(LED4);
175.    Delay_ms(20);
176.    STM_LEDToggle(LED4);
177.    Delay_ms(20);
178. 
179. 
180.    /* Clear the EXTI line 0 pending bit */
181.    EXTI_ClearITPendingBit(EXTI_Line0);
182.  }
183.}
184. 
185./**
186.  * @brief  EXTI15_10_IRQHandler
187.  *         This function handles External line 10..15 interrupt requests.
188.  * @param  None
189.  * @retval None
190.  */
191.void EXTI15_10_IRQHandler(void) /* U button */
192.{
193.  if(EXTI_GetITStatus(EXTI_Line10) != RESET)
194.  {
195.    /* Toggle LED3 */
196.    STM_LEDToggle(LED3);
197.    Delay_ms(20);
198. 
199. 
200.    /* Clear the EXTI line 10 pending bit */
201.    EXTI_ClearITPendingBit(EXTI_Line10);
202.  }
203.}
204. 
205./**
206.  * @brief  This function handles PPP interrupt request.
207.  * @param  None
208.  * @retval None
209.  */
210./*void PPP_IRQHandler(void)
211.{
212.}*/
213. 
214./**
215.  * @brief  Inserts a delay time.
216.  * @param  ms: specifies the delay length in milliseconds
217.  * @retval None
218.  */
219.static void Delay_ms(uint32_t ms)
220.{
221.  TimingDelay = ms;
222. 
223.  while(TimingDelay != 0);
224.}
225. 
226./**
227.  * @brief  Decrements the TimingDelay variable.
228.  * @param  None
229.  * @retval None
230.  */
231.void TimingDelay_Decrement(void)
232.{
233.  if (TimingDelay != 0x00)
234.  {
235.    TimingDelay--;
236.  }
237.}
238. 
239./**
240.  * @}
241.  */
242.   
243./***************************************************************END OF FILE****/

thank you!

Outcomes