> Now, with the above timing value unchanged, I will just configure the IC functionality. If I want to measure the frequency of a signal at PB7,
> what will be the limitations?
Without any additional "tricks", like what @S.Ma mentioned above, or counting separately the overflows in an interrupt or counting the overflows using another timer in master-slave arrangement (and both ways is rather tedious expecially when it comes to resolving events at the vicinity of the overflow), the capture is basically restricted by:
> htim4.Init.Prescaler = 5;
> htim4.Init.Period = 1000;
which means, for capture, maximum resolution (granularity) i.e. the minimum time difference resolvable is (5 + 1)*1/ftim, and the maximum period you can capture is (1000 + 1)*(5 + 1)*1/ftim (i.e. the minimum frequency of the captured input signal is 1/that), where ftim is the frequency of the timer input clock.
JW