This question already has an answer here:
I set up TIM3 to fire an interrupt in my project and it just wouldn't work. I tried everything I could and still couldn't find whats the problem. Then I created a clean project and copy/pasted only the code that sets up TIM3 and interrupts and it magically worked. I literally wasted half a day trying to find what causes the problem and it turns out... interrupts don't like C++.
I wrote my code in C++ because I needed classes in my project so naturally I renamed all my prject .c files to .cpp and also compile with the --cpp directive. Everything worked fine, no problems so far until I decided to use interrupts. So I renamed everything to .c and everything worked, renamed everything back to cpp and it stopped working.
I use Keil uVision5 and my projects are generated with STM32CubeMX (only RCC config).
Anyone had this happen to them? Any workarounds?