2016-08-04 03:07 AM
The PWM data are organized in an array of 360 structures
{ {CCR1, CCR2, CCR3, CCR4}, … {CCR1, CCR2, CCR3, CCR4}, } I wanted to start by HAL_TIM_DMABurst_WriteStart() but I found this function not enough flexible as the same variable (BurstLength) is used to program: the number of data to transfer in the DMA_SxNDTR register /* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)BurstBuffer, (uint32_t)&htim->Instance->DMAR, ((BurstLength) >> 8U) + 1U); and the DMA burst length in the TIM1_DCR timer /* configure the DMA Burst Mode */ htim->Instance->DCR = BurstBaseAddress | BurstLength;I think it should be different; in my case
/* Enable the DMA Stream */ HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)BurstBuffer, (uint32_t)&htim->Instance->DMAR, 360*4; /* configure the DMA Burst Mode */ htim->Instance->DCR = BurstBaseAddress | TIM_DMABURSTLENGTH_4TRANSFERS;In final
HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, uint32_t BurstRequestSrc, uint32_t* BurstBuffer, uint32_t BurstLength) should be HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, uint32_t BurstRequestSrc, uint32_t* Buffer, uint32_t BufferLength, uint32_t BurstLength)My platform is STM32F429 Cube_FW_F4_V1.12.0
Regards
2016-08-31 07:31 AM
Hi,
Maybe you can insprire from TIM examples within STM32CubeF4 package and implement your code, like this example which shows how to update the TIM1 channel1 period and the duty cycle using the TIM1 DMA burst mode:STM32Cube_FW_F4_V1.13.0\Projects\STM324xG_EVAL\Examples\TIM\TIM_DMABurst
Regards