Seems like a job for DMA.
16bit TimerA:
- Pwm mode, one channel, no output.
- Timebase slightly larger than 100ms.
- Channel 1 would be "Frequency reading", adjust for 100ms.
Enable capture ch1 DMA, peripheral to memory, both Word size, no increment, circular mode.
- Enable TRGO output, use update flag.
32bit TimerB:
- Setup external clock, prescaler(I think 30MHz is fine), etc...
- Slave in Reset Mode, configure ITR to take TRGO from Timer A
- Disable interrupts for all timers and their dmas.
Workflow:
Start TimerA Ch1 DMA: From TimerB->CNT to a 32-bit variable.
Start TimerA, start TimerB.
At 100ms, TimerA pwm will trigger a DMA request and transfer the counter value from TimerB into your variable.
Shortly after, TimerA will overflow and reset, the TRGO signal will also reset TimerB.
Now you can read your variable at any time to check the latest reading.