STM32F4 TIM2 timer, getting to 1 second
You have two problems.  The first is that the MCU runs at 168MHz if it has been set up that way, and your compiler may not do that by default.  Setting up the clock is a bit arcane.  ST provides an excel-based tool to help you create a setup file, and then the file needs to be put in the correct place and some other files need to be edited.


I recommend this site as a place to get all the relevant info.  There is an ST page with instructions, but it isn't as clear as some of the other tutorials.

If you do this, the APB1 bus, the one that TIM2 is on, will run at 42MHz max, giving you an 84MHz TIM2 clock (it's doubled by PLL).  If you need faster than that, you must use one of the timers on APB2, which goes twice as fast.  Note that that bus doesn't have any 32-bit timers.



The second issue is, as you said, you exceeded a maximum value.  Yes, you need to play with the two values.  If you divide your clock by (42000-1) with the prescalar to give you a 2 kHz time base, and then set the period to (2000-1), there's your 1 second interval.

Of course, you must TURN ON THE CLOCK to the TIM2 peripheral, and then enable TIM2, or nothing will work.