cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L562CET6 won't enter EXTI callback function.

LOlhe.1
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
12 REPLIES 12
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I can messure the 5V directly at PB6. They are connected.

I am not quiet sure how to check the linkage of the routines and listing files.

I screenshoted for the other two ideas the Live Expressions before running, while running and while running with 5V connected.

There was no difference between 5V connected or disconnected.

 
 
TDK
Guru

> 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?

If you feel a post has answered your question, please click "Accept as Solution".

I already tried it with the GPIO_InitStruct.Pull = GPIO_PULLDOWN; and without but it didnt make any difference.

And did you measure 0V on the pin?
If IDR reports it as high, and the voltage is 0V, there is a hardware issue. Note that pins are not 5V tolerant if VDD is not present.
If you feel a post has answered your question, please click "Accept as Solution".