>>I cant understand which timer I need to choose?
It is not complicated, but does require logical deduction and reading of the technical documentation.
There's a chain of associativity in the Reference Manual. Pick a TIM on APB2 (DMA2) for parts where that is required for Mem-to-Mem DMA
Find a TIMx_CHx pin you can use for Input Capture, and that same TIMx_CHx appears in the DMA channel/stream Trigger sources.
Use DMA in Mem-to-Mem, with GPIOx->IDR as the SOURCE, read as a word or halfword, and have the memory array / pattern buffer as the DESTINATION