cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure GPIO Interrupt with CubeMX

jarno
Associate III
Posted on July 03, 2014 at 08:02

Dear readers, how to configure a GPIO interrupt at port PG10 with CubeMX?

12 REPLIES 12
stm32cube-t
Senior III
Posted on July 30, 2015 at 16:32

Please find attached C code for EXTI2 initialization on F411E-DISCO.

Best regards

________________

Attachments :

proj2.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzUw&d=%2Fa%2F0X0000000bMp%2F7tUUf6mfKa7KnT_er5g9A.a6h_U.YNZDdypUPEKooTQ&asPdf=false
hamerm
Associate
Posted on August 07, 2015 at 12:37

Hi STM32Cube Team,

I am having a similar problem with EXTI interrupts. I have attached a complete proof of concept for the STM32F4Discovery, including CubeMX project.

The PoC connects each pin of GPIOB to an interrupt. Pins B0, B6, B9, B10, B11 do not generate interrupts, although their configuration (as generated automatically by CubeMX) is identical to pins B1, B2, B4, B5, B7, B8, B12, B13, B14, B15, which do generate interrupts.

To run the PoC, either run make and load firmware.elf, or use what ever IDE you normally use with CubeMX. Then tap the pins of GPIOB with a jumper from VDD. Note B3 is not connected, since this is used for SWD.

Please advise if I am doing something incorrectly. It would be very useful to have EXTI on PB11 working, since my peripheral on our custom PCB connects to this pin. Currently I have to solder a jumper wire from PB11 to one of the working pins.

When will MX4.10, which you mention solves these issues, be released?

Thank you,

Mike

________________

Attachments :

EXTI_PoC.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzVK&d=%2Fa%2F0X0000000bMn%2F7ZjcZDvlF7rcDvDXU29U74wsLsTlSTdqd5L1Oi0cpgQ&asPdf=false
Posted on August 13, 2015 at 17:48

Hi Mike,

I loaded your CubeMX .ioc project with my CubeMX v4.9 and simply rebuilt a code project for IAR (BTW, I'm using v7.40), built it and loaded the firmware on my STM32F407 Discovery board and was able to verify that all pins trigger interrupts, including

Pins B0, B6, B9, B10, B11

.  These pins are configured as rising edge trigger, so you may want to verify that such a signal level transition is occurring when you tap your jumper wire to VDD.  I noticed that some of these pins are actually pulled high on the Disocovery board (e.g. B6), so I actually had to tap the jumper to GND instead of VDD to get the rising edge to fire the interrupt.

Regards

Joe T