cancel
Showing results for 
Search instead for 
Did you mean: 

EXTI Triggering itself

AMass.1
Associate II

Hi,

I am working on a custom board using the STM32F479NI.

I have been able to use EXTI on the PC7 without problems.

Now I need to implement it on PE2.

But this time, the EXTI2_IRQHandler is being called over and over without any electrical changes on that pin.

The schematic for that pin is very simple (one pull-up and a protection diode, Button is connected to PE2) :

0693W000000W74EQAS.png

I am using STM32CubeMx to generate all the necessary code :

0693W000000W7ChQAK.png

And I made sure to call the MX_GPIO_Init() function.

Right after calling the MX_GPIO_Init(), the EXTI2_IRQHandler is called over and over.

I also made sure that the interrupt is being cleared, this is done in the CubeMx generated code in the function HAL_GPIO_EXTI_IRQHandler :

0693W000000W74tQAC.png

The callstack looks like this :0693W000000W74sQAC.png

I did not modify any of the CubeMx generated code, so the EXTI2_IRQHandler and HAL_GPIO_EXTI_IRQHandler are the default one.

Please note that when using PE2 as a GPIO_Input, and pooling it, I do not see the issue.

I also noticed that the voltage at this pin is dropping when experiencing the issue (the supply voltage remains 3V3, but the voltage at PE2 is 1.8V so, to me, it looks like the STM32 is making the voltage drop).

Please tell me if you need more information

Thanks in advance for your help,

AM.

1 ACCEPTED SOLUTION

Accepted Solutions

MODER for PE2 is 0b10 i.e. AF, and AFR[0] is 0, i.e. it's set to TRACECLK.

It oscillates, so you see a "mid-value" using a multimeter.

> As for as I know trace is not enabled :

Maybe the mechanism to enable it is somewhere else in your IDE than you've looked.

JW

View solution in original post

9 REPLIES 9
emil28
Senior

Hello,

Try to generate a pull-up on Cube MX.

Hope this help.

AMass.1
Associate II

Hi and thank you for your answer.

I have tried that already and tried it again just to make sure, but it unfortunately is not helping.

If you have any other ideas :)!

chaaalyy
Senior II

Did you measure the voltage also with enabled pull up ? Without pull up it´s just floating, so it´s state is not defined and can "do, what it wants to do". If you enable the pull up resistor, it should remain stable at 3.3V until the button is pressed. If not, maybe it´s broken...

AMass.1
Associate II

Hi,

Yes same thing with the pull-up resistor, I measure 1.7V - 1.8V while I should be measuring 3.3V.

The power supply voltage is still 3.3V.

I think but I can't be sure, that the voltage is dropping when the 1st interrupt occurs on the Exti Line 2.

I don't think it is broken thought, the board is brand new, I picked up a few others to try them, and I get the same behavior.

Thanks for your help,

AM.

TDK
Guru

Really sounds like hardware/layout issue.

Put the chip in reset (hold NRST low), and measure the voltage both with and without the button pressed.

There are only so many configuration options for GPIO pins, and none of them would make the pin float at 1.8V. The pullup/pulldowns are about 60kOhm, so would have much less influence than the external 10k pullup.

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

Trace enabled in debugger?

Read out and post content of GPIO registers.

JW

AMass.1
Associate II

Hi Both and thank you for your support!

So while the CPU is in reset, I do have a nice 3.3V. After releasing the reset button, I do observe a 1.8V drop. But it is hard to tell when it occurs.

I agree with you, I do not see any configuration that would lead to a 1.8V...

As for as I know trace is not enabled :

0693W000000WAEbQAO.png

Here is the status of the GPIOE when entering the HAL_GPIO_EXTI_Callback() function :0693W000000WAF5QAO.png

I really have a hard time understanding whether it is a hardware or a software issue.

Thanks again for your help!

AM/

MODER for PE2 is 0b10 i.e. AF, and AFR[0] is 0, i.e. it's set to TRACECLK.

It oscillates, so you see a "mid-value" using a multimeter.

> As for as I know trace is not enabled :

Maybe the mechanism to enable it is somewhere else in your IDE than you've looked.

JW

AMass.1
Associate II

Thank you so much waclawek.jan, indeed Trace was disabled in CubeMx, but I am using VisualGDB afterward, and there is a little checkbox in the config that enabled trace :0693W000000WAnMQAW.png

Unticking it solved the problem.

Thank you so much for your help!

AM.