You can enable channel 4 of tim1 or tim8, set it’s duty cycle, and use it as a trigger for adc. Here is an experiment I did: