The first think is - you have to have straight line @ 0V when you put ground directly on ADC pin. The spikes comes from your ADC wiring, without drawing and picture of it, it is just guessing work.
Try to run another program such as DC voltmeter, check for spikes DAC pin on grand, you should have straight pure line on 0V. For grounding use wire jumper not a capacitor.
I am using arduino IDE and stm32f103, I need 2 outputs from timer # 4, I have one on PB7 to get second I have a problem. But why don't you do it in the way it's designed, i.e. using only one DMA channel updating both CCR1 and CCR2 upon a single trigg...