2021-10-11 04:42 AM
I am quiet new to STM32 programming and can't get the external interrupt to work.
I started with the NUCLEO-L011K4 and wrote my programm without any issues. I switched to my own board (pdf included) and weren't able to get extrenal interrupts to work.
I use the STM32CubeIDE 1.5.1 and the ST-Link/V2 to programm.
The goal of the code is to change the PWM outputs frequency and duty cycle with incoming 5V high signals on pin "Change" and pin "Laser_On". The Controller itself gets 3,3V.
I can see in debug mode that the Callback function isn't entered when i provide the high signals.
Am I missing some crucial code? Help is appreciated.
Solved! Go to Solution.
2021-10-11 06:15 AM
2021-10-11 05:34 AM
Code seems okay to me. Should get an interrupt when PB6 goes from low to high.
If the code works on a Nucleo but not on your custom board, check to see if there are wiring issues. Make sure the PB6 pin itself is actually seeing the levels you expect.
2021-10-11 05:42 AM
Check linkage of routines via .MAP and listing files.
Confirm EXTI peripheral registers in debugger, or via telemetry data. Check event flagging
Confirm GPIO registers, reflect reporting in GPIOx->IDR for pin state.
2021-10-11 05:45 AM
2021-10-11 06:14 AM
2021-10-11 06:15 AM
2021-10-11 06:15 AM
2021-10-11 06:41 AM
> I screenshoted for the other two ideas the Live Expressions before running, while running and while running with 5V connected.
Look like PB6 is high "before running" as well, so no transition, so no interrupt. What is pulling it down to 0V when the phototransistor is off?
2021-10-11 06:59 AM
I already tried it with the GPIO_InitStruct.Pull = GPIO_PULLDOWN; and without but it didnt make any difference.
2021-10-11 07:11 AM