2020-10-06 06:41 AM
Softwares Details:
µVision IDE : version 5.31.0.0
STM32CubeMx : version 5.4.0
Hardware Details:
Mcu: STM32G030K6T6
Programmer : STLink-V3Mini
Work Description:
I configured 3 pins of mcu as external interrupts triggering on both rising and falling edges from STM32cubeMx. Now when i press buttons interrupts and every thing is working fine in code but sometimes it mess up.
Problem:
The issue iam currently facing is sometimes when i press buttons due to some reason NMI or HardFault interrupts occur and code stuck into NMI_Handler or HardFault_Handler functions in the c file stm32g0xx_it.c.
I spent hours on debugging but couldn't figure out the problem. Any help would be appreciated!
Attached is .rar file of complete project.
2020-10-06 07:06 AM
No need to double post:
https://community.st.com/s/question/0D53W00000KF4KRSA1/nmi-and-hardfault-interrupt-issue
2020-10-06 05:59 PM
I'd try to help if I might know the answer. But time's short. Try posting a snippet of the part that's failing. Shorter the better.
BTW Google switch debounce. It's one of the most discussed topics for students. Also check you've a good grasp of interrupts, and edge interrupts, and check you've considered that edges may occur faster than your core can interrupt, and check how you're state-machining the debounce and signalling the app of your integrated button-press events.