Using a OC timer as a DMA request.
I am trying to implement a DMA transfer as outlined in AN4666. I am using STM32CubeIDE and an STM32F4 Discovery. This will eventually let me pull data from the input register of a GPIO port (and read a parallel data stream), but for starters, I'm just trying to get it to move data from a dummy array to a buffer.
At the moment, I have Timer 2, Channel 1 configured as an output compare, and DMA1 Stream 5, Channel 3 enabled as peripheral to memory. All the initialization is done by STM32CubeIDE with the HAL driver.
Using the application note as an example, I enable my timer like this:
uint8_t tmpbuf[10] = {9,9,9,9,9,9,9,9,9,9};
HAL_DMA_Start(&hdma_tim2_ch1, (uint32_t)&tmpbuf, (uint32_t)&DMABuf, 10);
__HAL_TIM_ENABLE_DMA(&htim2, TIM_DMA_CC1);
TIM_CCxChannelCmd(htim2.Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE);
__HAL_TIM_ENABLE(&htim2);When I run the code, I can see the timer start (square wave on the output pin), but when I check DMABuf, it still has its initial values.
I've used HAL_TIM_IC_Start_DMA() to do a memory-to-peripheral timer DMA for producing a custom varying PWM waveform, but I've never gone the other way.
I've been poking around at this for a few days now, and I'm not even certain if what I'm trying is possible. Am I missing something?
Thanks in advance.