cancel
Showing results for 
Search instead for 
Did you mean: 

HRTIM burst DMA doesn't work

DrDro
Associate III

Hallo,

I want to update MASTER CMP1 over DMA and the others TIM_x on MASTER-update.

New values of CMPx registry are calculated in SysTick_Handler() and should be updated at once.

The problem is: MASTER update on DMA does not work.

Could anyone please look at my tiny project? It is maintained over CubeMX.

https://github.com/Maciej1975/HRTIM_3Phase/tree/master

 

Kind Regards

1 ACCEPTED SOLUTION

Accepted Solutions
DrDro
Associate III

It seems, I have found solution.

The line:

pTimerCfg.UpdateGating = HRTIM_UPDATEGATING_DMABURST_UPDATE;

cannot be set inside CubeMX, but it works as I expect. TIMER_A .. C are updated only when MASTER.CMP gets update over DMA.

 

Kind Greetings

View solution in original post

4 REPLIES 4
Pierre_Paris
ST Employee

Hello @DrDro,

Here two investigations points :

  • Firstly, you can try to call the function HAL_HRTIM_BurstDMAConfig() to validate the burst DMA operation.

Please add :

if(HAL_HRTIM_BurstDMATransfer(&hhrtim1, HRTIM_TIMERINDEX_TIMER_A, (uint32_t) Reg_Update, sizeof(Reg_Update)/sizeof(uint32_t)) != HAL_OK) //Add a breakpoint here
{
   Error_Handler();
}

 And check in debug if it works. Let me know.

  • Change RepetitionUpdate value to HRTIM_UPDATEONREPETITION_ENABLED . Indeed, it specifies whether or not registers update is triggered by the repetition event.

Kind Regards,

Pierre

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.

Hallo Pierre,
mentioned function HAL_HRTIM_BurstDMAConfig() is already called inside CubeMX generated initialization code, i.e. inside "static void MX_HRTIM_Init(void)". And there is no issue. Yes, I use USE_FULL_ASSERT and I get no error. The function call returns HAL_OK

I want to if MASTER.CMP1 gets updated. What do I observe with watchpoint at 0x4001741c and SFRs-View. But nothing happens. I get watchpoint only once, as the initial value is written.

  if (HAL_HRTIM_BurstDMAConfig(&hhrtim, HRTIM_TIMERINDEX_MASTER, HRTIM_BURSTDMA_CMP1) != HAL_OK)
  {
    Error_Handler();
  }

 The second crucial function HAL_HRTIM_BurstDMATransfer() is called every 500ms to trigger mentioned DMA transfer.

  • Change RepetitionUpdate value to HRTIM_UPDATEONREPETITION_ENABLED . Indeed, it specifies whether or not registers update is triggered by the repetition event.

 Great! That was the issue. Now I get MASTER.CMP1 changed 👍 but frankfuly the watchpoint at 0x4001741c does not react on this change.

Still not solved problem is that another TIMERs: A,B,C should be updated only on MASTER.CMP update but they are written independently.

DrDro
Associate III

It seems, I have found solution.

The line:

pTimerCfg.UpdateGating = HRTIM_UPDATEGATING_DMABURST_UPDATE;

cannot be set inside CubeMX, but it works as I expect. TIMER_A .. C are updated only when MASTER.CMP gets update over DMA.

 

Kind Greetings

Pierre_Paris
ST Employee

Hello @DrDro ,

I am glad to hear that everything is running ! 😀

The UpdateGating parameter specifies how the update occurs with respect to a burst DMA transaction or update enable inputs. You choose to do it on timer roll-over following a DMA burst transfer completion.

Kind Regards,

Pierre

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.