cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure timer triggered DMA from modified CubeIDE code?

KHarb.1
Senior II

I’m using CubeIDE, which lets me configure a timer to trigger a DMA request triggered by an output compare that transfers that timer's value to memory. I want to modify the generated code such that a separate timer’s value is sent to memory instead.

Within the HAL_TIM_OC_Start_DMA function, HAL_DMA_Start_IT is called, (??) which seems to be where the to\from addresses are established. I’m hoping I can modify this call to reference the memory location of another timer’s CNT value…but I’m not certain if its as simple as modifying a single call. I’m up against other anomalous behavior, so I’m not sure if this approach works. Can it?

1 ACCEPTED SOLUTION

Accepted Solutions
KHarb.1
Senior II

Changing the CPAR and CMAR DMA registers manually accomplishes this.

View solution in original post

2 REPLIES 2
Sarra.S
ST Employee

Hello @KHarb.1

In HAL_DMA_Start_IT, this parameter (&TIMx->CCR1) is the source address, which you would change to the address of the other timer's CNT register.

I personally didn't try this, but I think it should work 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

KHarb.1
Senior II

Changing the CPAR and CMAR DMA registers manually accomplishes this.