2024-01-26 06:00 AM
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
Solved! Go to Solution.
2024-01-29 05:24 AM
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
2024-01-26 07:42 AM
Hello @DrDro,
Here two investigations points :
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.
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.
2024-01-29 03:42 AM
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 :thumbs_up: 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.
2024-01-29 05:24 AM
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
2024-01-29 05:48 AM
Hello @DrDro ,
I am glad to hear that everything is running ! :grinning_face:
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.