Skip to main content
KHarb.1
Senior
May 26, 2024
Solved

How to configure timer triggered DMA from modified CubeIDE code?

  • May 26, 2024
  • 2 replies
  • 1065 views

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?

This topic has been closed for replies.
Best answer by KHarb.1

Changing the CPAR and CMAR DMA registers manually accomplishes this.

2 replies

ST Employee
May 27, 2024

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
KHarb.1AuthorBest answer
Senior
June 21, 2024

Changing the CPAR and CMAR DMA registers manually accomplishes this.