Discovery Board Hangs On Interrupt Handling
Most probably something wrong with the systemclock setting. Where do you initialize it?
There is a "k" variable hinting to 168 MHz but at a glance I can't see it being used.
Have you looked at e.g. Tiljens website? https://stm32f4-discovery.net/2015/01/properly-set-clock-speed-stm32f4xx-devices/
As a sidenote: this website is not about programming really, it's about the infrastructure for the compiler/linker.
Good Luck.