It is interesting to find what accuracy of frequency measurement can be achieved using only Black Pill STM32F411 internal counters.
For low frequencies stm32duino HardwareTimer library provides nice examples of frequency measurement based on Capture Interrupt.
I modified these examples to obtain as high accuracy as possible.
The resulting Arduino .ino program can be found in the attached zip file.
At low frequencies my program provides at least 7 correct frequency digits.
At the highest frequency of about 350 kHz 5 correct digits are observed using 2 sec measurement time,
and 6 correct frequency digits are obtained using 20 sec measurement time.
Input frequency signal is connected to pin PA1. No other signal connections are required.
The frequency measurement results are shown by Arduino Serial Monitor.
Measurement time can be set via Arduino Serial Monitor by sending numbers 0, 1 or 2,
which set the measurement time to 0.22 sec, 2.2 sec and 22 sec accordingly.
Capture interrupt used to measure frequency takes about 2.9 uS.
If such interrupts come faster than approximately 350 kHz, then they cannot be counted correctly.
Because of that if the input frequency exceeds 350 kHz, then the measured frequency is wrong.
For the same reason if the input frequency is close to the upper limit of 350 kHz,
setting of the measurement time via Arduino Serial Monitor becomes unresponsive,
as all processor power is spent inside Capture Interrupt.
Black Pill clock is not very accurate. In my case it is about 93 ppm lower than it should be.
To achieve high absolute accuracy frequency correction coefficient should be used.
It can be found using some high accuracy calibration clock, such as GPS 1PPS signal.
For my Black Pill freqCorrection = 1.000093675.
Of course, there is Black Pill clock drift, but it is not very high.
My Arduino program does not pretend to be perfect, but it was tested at many frequencies between 0.1 Hz and 350 kHz,
and had no problem.
Feel free to improve it.