2023-04-26 04:39 AM
This is very weird problem as I have never experienced this kind of problem before.
The board is hooked up to several NPN type limit sensor and connected PE0, PE1 etc.
Every pins are defined as EXTI with Rising/Falling edge trigger and has been working good until I figured out that PE1 pulled by the limit sensor causes resetting the MCU.
I tried to add breakpoint at the beginning of IQR handler but it resets even before triggering an ISR.
Anyone knows about this issue?
I am using up to date cubeMX 6.8.0.
2023-04-26 04:45 AM
Sounds like the interrupt is triggered, tries to jump to IRQ handler, but that is somehow where it's not supposed to be.
Why is the MCU reset?
Hard Fault handler that causes a reset?
Or jump to memory nirvana which somehow gets to start of PC again?
Does PE1 use the same IRQ handler as the other EXTI?
Check the map / list files where the corresponding IRQ handler is placed.
2023-04-26 04:47 AM
Or maybe a hardware issue:
I suppose you have a pull-up to VCC at the npn collector.
If that pull-up is too low, like accidentally placed 10R instead of 10k, then VCC is shortened and will cause the MCU to reset.
2023-04-26 06:07 AM - edited 2023-11-20 07:06 AM
The limit switch is working with 5V and PE1 is connected as below.
All other pins works just fine.
I don't know why this pin doesn't even trigger an ISR and simply reset the MCU as if it is like NRST pin.
2023-04-26 06:41 AM
Short between PE1 and neighbouring PDR_ON pin?
JW
2023-04-26 07:19 AM
2023-04-26 04:46 PM
I checked the design and found PDR_ON pin near the PE1 left un-connected but there's no short between them.
Is it possible they can become somehow shorted together after power on?
2023-04-26 05:47 PM - edited 2023-11-20 07:06 AM
Please take a look at below output.
CH1(Yello) is hooked up to the PE1 pin
CH2 (Green) is hooked up to a gpio toggle from the program.
As soon as the PE1 pin goes high(the limit sensor is cleared), the toggle output stops.
After a one or two seconds the program restarts again.
2023-04-26 05:59 PM
> found PDR_ON pin near the PE1 left un-connected
Connect PDR_ON to VDD.
JW
2023-04-26 11:18 PM
So it's PE1 going HIGH that seems to be the trouble, not LOW.
> Connect PDR_ON to VDD.
Have you done what Jan said?
Have you checked the other things we mentioned?
If yes and the problem still persists, it's time to post some source code concerning that GPIO init, interrupt init, interrupt handler, etcpp...