cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3 HRTIM BURST DMA

Kevin Sun
Associate

Posted on January 04, 2017 at 12:36

Hi, 

I am trying to use the burst DMA mode to update the HRTIM compare unit registers on a STM32F334 with the STM32 CUBEMX. 

I am using this function to trigger the DMA update if I want to update the compare registers.

 HAL_HRTIM_BurstDMATransfer(&hhrtim1,HRTIM_TIMERINDEX_TIMER_A,CompareUnit[0],4);

I also need to update the compare values for Timer B and C etc. Do I need to call the above function again with the corresponding Timer ID?

The following the initialization for the Timer and DMA.

pTimerCfg.InterruptRequests = HRTIM_TIM_IT_NONE;

pTimerCfg.DMARequests = HRTIM_TIM_DMA_NONE;

pTimerCfg.DMASrcAddress = (uint32_t)&CompareUnit[0];

pTimerCfg.DMADstAddress = (uint32_t)&(hhrtim1.Instance->sCommonRegs.BDMADR);

pTimerCfg.DMASize = 4;

pTimerCfg.PreloadEnable = HRTIM_PRELOAD_ENABLED;

pTimerCfg.PushPull = HRTIM_TIMPUSHPULLMODE_DISABLED;

pTimerCfg.FaultEnable = HRTIM_TIMFAULTENABLE_NONE;

pTimerCfg.FaultLock = HRTIM_TIMFAULTLOCK_READWRITE;

pTimerCfg.DeadTimeInsertion = HRTIM_TIMDEADTIMEINSERTION_DISABLED;

pTimerCfg.DelayedProtectionMode = HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DISABLED;

pTimerCfg.UpdateTrigger = HRTIM_TIMUPDATETRIGGER_NONE;

pTimerCfg.ResetTrigger = HRTIM_TIMRESETTRIGGER_MASTER_PER;

pTimerCfg.ResetUpdate = HRTIM_TIMUPDATEONRESET_ENABLED;

HAL_HRTIM_WaveformTimerConfig(&hhrtim1, HRTIM_TIMERINDEX_TIMER_A, &pTimerCfg);

HAL_HRTIM_BurstDMAConfig(&hhrtim1, HRTIM_TIMERINDEX_TIMER_A, HRTIM_BURSTDMA_CMP1|HRTIM_BURSTDMA_CMP2

|HRTIM_BURSTDMA_CMP3|HRTIM_BURSTDMA_CMP4) != HAL_OK);

HAL_HRTIM_BurstDMAConfig(&hhrtim1, HRTIM_TIMERINDEX_TIMER_B, HRTIM_BURSTDMA_CMP1|HRTIM_BURSTDMA_CMP2

|HRTIM_BURSTDMA_CMP3|HRTIM_BURSTDMA_CMP4) ;

Any help is appreciated it!. Cheers.

1 REPLY 1
Oliver Beirne
Senior

Posted on January 04, 2017 at 14:09

Hi

Sun.Kevin.001

I have moved your post to the

https://community.st.com/s/topic/0TO0X000000BSqSWAW/

where product related questions are posted.

Thanks

Oli