Skip to main content
RKade.1
Associate III
June 25, 2020
Question

Stm32f072 external interrupts more than one

  • June 25, 2020
  • 9 replies
  • 1445 views

In my project am using A mcu , and wanted to use pA0 and Pc13 as two interrupt.

But interrupt for pA0 is not coming and Pc13 is coming.

Please help to know the cause.

Rohit

+91-8141616356​

This topic has been closed for replies.

9 replies

RKade.1
RKade.1Author
Associate III
June 25, 2020

Also I have checked in .s file , both interrupts are enabled, and also at power on, i have enabled interrupt as risinf edge triggered.​

Both interrupts come independently, but if I run two interrupts combined ly, only single interrupt comes.​

waclawek.jan
Super User
June 25, 2020

Read out and check/post relevant GPIO, SYSCFG, EXTI and NVIC registers content. Check in disasm, if the proper ISR vector is inserted in the respective position in the vector table.

JW

RKade.1
RKade.1Author
Associate III
June 25, 2020

Please share the snap of what u are saying if possible.

Tesla DeLorean
Guru
June 25, 2020

Register dumps from the involved peripherals​

Debugger should have a peripheral view, you could also read in your own code and print.

Show minimal code that illustrates the issues rather than have everyone guess what you are doing wrong.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
RKade.1
RKade.1Author
Associate III
June 25, 2020

Ok,

Initialisation part as below:-

------------------------------------------------------------------------------------------------------------------

interruptEnable (GPIOA_BASE,GPIO_Pin_0,INT_RISE); //  BMS Alert-Lower

 interruptEnable (GPIOC_BASE,GPIO_Pin_13,INT_RISE); //  BMS Alert-Upper

------------------------------------------------------------------------------------------------------------------

==================================================================

Below is ISR i wrote for Both Pin Interrupt:-

------------------------------------------------------------------------------------------------------------------

void EXTI0_1_IRQHandler(void)

{

 if(EXTI_GetITStatus(EXTI_Line0) != RESET)

 {

  if (isrtimeout[0] > 20)

  {

   alertFlag[0] = 1;

   isrtimeout[0] = 0;

   alerttimeout[0] = 0;   

  }

  EXTI_ClearITPendingBit(EXTI_Line0);

 }

}

void EXTI4_15_IRQHandler (void)

{

 if(EXTI_GetITStatus(EXTI_Line13) != RESET)

 {

   if (isrtimeout[1] > 20)

  {

   alertFlag[1] = 1;

   isrtimeout[1] = 0;

   alerttimeout[1] = 0;   

  }

  EXTI_ClearITPendingBit(EXTI_Line13);

 }  

}

------------------------------------------------------------------------------------------------------------------

===============================================================

Below is .s File snap only :-

------------------------------------------------------------------------------------------------------------------

; External Interrupts

    DCD   WWDG_IRQHandler        ; Window Watchdog

    DCD   PVD_VDDIO2_IRQHandler     ; PVD and VDDIO2 through EXTI Line detect

    DCD   RTC_IRQHandler         ; RTC through EXTI Line

    DCD   FLASH_IRQHandler        ; FLASH

    DCD   RCC_CRS_IRQHandler       ; RCC and CRS

    DCD   EXTI0_1_IRQHandler       ; EXTI Line 0 and 1

    DCD   EXTI2_3_IRQHandler       ; EXTI Line 2 and 3

    DCD   EXTI4_15_IRQHandler      ; EXTI Line 4 to 15

    DCD   TSC_IRQHandler         ; TS

------------------------------------------------------------------------------------------------------------------

Regarding debugger with Hardware i can do in normning as my hardware is @ officeand am at home currentlly.

Thanks

Rohit