cancel
Showing results for 
Search instead for 
Did you mean: 

PA1 EXTERNAL INTERRUPT ISSUE

Khansokhua
Visitor

Hello,

STM32CubedIDE, STM407G DISC1 BOARD

     I am trying to trigger an external interrupt by using a button connected to PA1 pin. 

My configurations are below;

  1-) I enabled 7.bit in NVIC_ISER register.   IRQN_EXTI0 is enabled

  2-) I enabled  GPIOAEN  in RCC register.    GPIOA  clock is enabled.

  3-)  I wrote  '1' into the  TR1 in EXTI> RTRS register for RISING EDGE. 

  4-)  I enabled SYSCFG clock.

  5-)  Although the reset value is already '0'(which is corresponding to A Port) 

         for  SYSCFG_EXTICR1> EXTI1, I wrote '0' again for Port A and pin 1(EXTI1)

   6-) I set EXTI>IMR> MR1 bit in the register for not masking the line 1( due to being 1.pin )

   7-) Other pin configurations are, Pull-Down, High-Speed and Push-Pull for OTYPE

I succeed in making it work for PA0 and PB0 external interrupts individually.I debugged each step and it seems everything is fine. I suspect due to I use first pin, I am missing something here.I haven't figured it out yet. However, PA0 and PA1 share most register common.Only difference could be the MR bits but I have checked  them several times.

For better understanding, I tried to capture the high logic with a single LED using PA1 button, after I configurated it identically as in the above.Result is positive, I can capture it is able to be high but cannot trigger interrupt. What am I missing? I am looking forward to handle the issue. Thank you for your assistance. 

Respects Khansokhua

13 REPLIES 13

@Khansokhua wrote:

I can only see five handler in start-up file for STM407.

  .word	EXTI0_IRQHandler             			/* EXTI Line0 interrupt                                               */
  .word	EXTI1_IRQHandler             			/* EXTI Line1 interrupt                                               */
  .word	EXTI2_IRQHandler             			/* EXTI Line2 interrupt                                               */
  .word	EXTI3_IRQHandler             			/* EXTI Line3 interrupt                                               */
  .word	EXTI4_IRQHandler             			/* EXTI Line4 interrupt                                               */

 


Look at the table Table 62 in the reference manual:

SofLit_0-1734104603754.png

SofLit_1-1734104655725.png

Look also at the start up file .s.

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Everything fits perfect now , thanks for your help @Tesla DeLorean @SofLit 


@Khansokhua wrote:

Everything fits perfect now , thanks for your help @Tesla DeLorean @SofLit 


So in that case please mark the comment that answered your question as solution.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

I already accepted one of the response as a solution. Do I need to do anything else?