2024-12-13 05:37 AM - edited 2024-12-13 05:38 AM
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
Solved! Go to Solution.
2024-12-13 07:44 AM - edited 2024-12-13 07:46 AM
@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:
Look also at the start up file .s.
2024-12-13 08:13 AM
Everything fits perfect now , thanks for your help @Tesla DeLorean @SofLit
2024-12-13 09:10 AM
@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.
2024-12-13 10:24 AM - edited 2024-12-13 10:25 AM
I already accepted one of the response as a solution. Do I need to do anything else?