cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Interrupts are not working

BChav.1
Associate III

Hi ,

I am working on STM32L0 series controller that has 3 different external interrupts configured on PB11(sensor A),PB2(Sensor B) and PC1(Sensor C).

Peripheral connected to PB11 generates interrupt at 1ms interval and PB2 generates interrupt when data is received on Ethernet.PC1 generates interrupt at 500ms interval. when all peripherals are initialized, i see interrupt generated on PB11 only. No interrupts on PB2 and PC1.

When the sensor A is not initialized, i can see the interrupts being generated on PB2 and PC1 regularly. I am not able to operate all three peripherals simultaneously(interrupt driven).

Following is the callback function i am using when interrupt is detected by controller. Please let me know how can i make all the peripheral work together on interrupt.

TIA

//////

void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)

{

 /* Prevent unused argument(s) compilation warning */

 UNUSED(GPIO_Pin);

 if (GPIO_Pin == GPIO_PIN_11)

 {

 IMUInterruptHandler();

 }

 if (GPIO_Pin == GPIO_PIN_2)

 {

 ETH_EventDetected = 1;

 }

 if (GPIO_Pin == GPIO_PIN_1)

 {

 ALS_EventDetected = 1;

 }

 /* NOTE: This function Should not be modified, when the callback is needed,

      the HAL_GPIO_EXTI_Callback could be implemented in the user file

  */

}

//////

2 REPLIES 2

For the non-working interrupts, check that they are

  • properly routed in SYSCFG_EXTICRx
  • proper edge is selected in EXTI_RTSR/EXTI_FTSR
  • enabled in EXTI_IMR
  • their respective interrupt is enabled in NVIC
  • there are properly named ISR for them, calling the HAL's common handler

JW

TDK
Guru

Also ensure that IMUInterruptHandler() finishes before the next interrupt arrives. It sounds like the CPU is swamped.

If you feel a post has answered your question, please click "Accept as Solution".