Page 1 of 1

attachinterrupt issue on STM32F412VG

Posted: Mon Apr 12, 2021 1:13 pm
by somanshraj
The variant used is custom using the following : STM32F412VG

While trying to use attachinterrupt on Pin PA2, output shows 4 times the number of interrupts expected ( in case of RISING, FALLING or CHANGE )

https://pasteboard.co/JX72fyr.jpg

As seen in the above attached link ( also attached as custom board), we expect nine interrupts but on analyzing we get 37 as shown on right side.

Now, on changing the board to blackpill, doing the same as above correctly outputs the number of interrupts as seen in the below attached link ( also attached as blackpill ). Variant used here is predefined.

https://pasteboard.co/JX72Z5J.jpg

update : using interrupt on PA9 instead of PA2 outputs the correct value

Any hints or tips which might fix the issue. Also the variant board is attached. This is the same variant used in the following post : viewtopic.php?f=7&t=993

@fpiSTM

Re: attachinterrupt issue on STM32F412VG

Posted: Wed Apr 14, 2021 5:55 am
by fpiSTM
Hard to tell with those information.
If it works with a blackpill I guess it is link to your hardware.

Re: attachinterrupt issue on STM32F412VG

Posted: Wed Apr 14, 2021 5:52 pm
by ag123
among the things to check, is if the cpu and buses are running at the intended speeds as given on the specs sheets?
and if they are the other thing would be the prescaler settings say on timers etc.
the crystal frequency, and pll multipliers/dividers are often a spot to check if after all the cpu and buses are not running at the correct speeds.