AnsweredAssumed Answered

how do you set the DMABufferAddress and Size when you enable the circular buffer in CubeMX ?

Question asked by T J on Dec 29, 2016
Latest reply on Jan 2, 2017 by Khouloud G

I have an '091

I enabled the Usart1 TX DMA as circular, but how can I set the Source address and size ?

 

<<code>>

    hdma_usart1_tx.Instance = DMA1_Channel4;
    hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
    hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
    hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE;
    hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
    hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
    hdma_usart1_tx.Init.Mode = DMA_CIRCULAR;
    hdma_usart1_tx.Init.Priority = DMA_PRIORITY_LOW;
    if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK)
    {
      Error_Handler();
    }

 

    __HAL_DMA1_REMAP(HAL_DMA1_CH4_USART1_TX);

 

    __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart1_tx);

 

    /* Peripheral interrupt init */
    HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
    HAL_NVIC_EnableIRQ(USART1_IRQn);

<</code>>

Outcomes