I'm using two timers tim3 and tim4 for counting motor encoder readings (tim3) and handling hall sensor inputs (tim4. Inputs ch1, ch2 and ch3 XORed into TI1 of TIM4 running in hall interface mode). What I would like to do now is to synchronize the two timers so that when hall toggles, encoder timer is reset. However it seems that there is no way to combine encoder mode (in the SMS register) with reset mode such that the counter tim3 is reset when tim4 TRGO toggles. It seems that I can only choose one mode or the other but not combination of both.
Maybe I'm misunderstanding how the two timers can be combined for rotor position estimation? What is the best way to combine and sync hall sensor readings with encoder readings on stm32 without using an ISR to reset the counter manually? (Preferably I want to do this automatically in hardware. I have the manual solution working, but I'm not 100% happy with it).
The chip is stm32f103.