OK, I finally understood the DMA behavior.
Each DMA has a very specific handler, so you can't use different DMAs and trigger them with the same source (I thought it was more flexible).
In this case we have:
- Timer update DMA
- PWM ch1 DMA
- PWM ch2 DMA
- PWM ch3 DMA
- PWM ch4 DMA
- Timer update triggers when the counter resets. This is what repetition counter works with!
- Pwm channels DMA always trigger the DMA at the Output compare event (When the pwm goes low).
- If you put too high pwm values, OC flag is not set. Doesn't explain why it fails if the value is "Timer Period-1".
- It will always call the dma after each PWM cycle
So this is not what we need.
However, by default HAL doesn't let you use the Update DMA to feed other timer registers.
But, since the DMA can reach any other base peripheral register, I could "hack" the HAL by using the Timer update DMA, and send the data to the PWM ch1.
(hacking = uhh I don't want to mess too much at low level

)
Now, it updates every 10 PWM cycles @ 160KHz PWM. The sound its pretty nice, what you would expect from 16Ksps 8bit audio (8KHz bandwidth).
Taking photos of the analog scope with fast moving signals proved to be a mess, the camera and the scope update frequency cause a lot of trouble.
I ended using a special filtering mode that seems to work better. 2mS/division, 10 divisions wide.
Due the persistence, you can see the previous wave sample points, it's cool.



I tried audacity, but it can't correctly export to 8bit 16KHz wav files. It always sets it to 22KHz no matter what you do.
I found a great alternative, it was even better. Wavosaur (
https://www.wavosaur.com/)
It can export raw binaries, so no wav headers, only pure audio data.
Then I just copy the hex values from HXD, copy into a text editor, and replace all the spaces with ",0x".
And it's ready to insert into a C array.
Try this, I think it may work in the STM32F030.