cancel
Showing results for 
Search instead for 
Did you mean: 

Bug Comment of HAL-DMA Lib

michaelruebig9
Associate II
Posted on October 08, 2015 at 13:18

Hi,

in this part of the

DMA-SetConfig()

function the comments are wrong.

 /*

Memory to Peripheral

*/

  if((hdma->Init.Direction) == DMA_MEMORY_TO_PERIPH)

  {

    /* Configure DMA Stream destination address */

    hdma->Instance->PAR = DstAddress;

    /* Configure DMA Stream source address */

    hdma->Instance->M0AR = SrcAddress;

  }

  /*

Peripheral to Memory

*/

  else

  {

    /* Configure DMA Stream source address */

    hdma->Instance->PAR = SrcAddress;

    

    /* Configure DMA Stream destination address */

    hdma->Instance->M0AR = DstAddress;

  }

}

Michael

2 REPLIES 2
Nesrine M_O
Lead II
Posted on October 08, 2015 at 16:38

Hi Michael ,

Could you precise in which HAL library you have found the issue. So, we can verify it.

-Syrine-

michaelruebig9
Associate II
Posted on October 09, 2015 at 08:20

Hi,

I found it in stm32f4xx_hal_dma.c

static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)

{

  /* Clear DBM bit */

  hdma->Instance->CR &= (uint32_t)(~DMA_SxCR_DBM);

  /* Configure DMA Stream data length */

  hdma->Instance->NDTR = DataLength;

 

/* Peripheral to Memory */

  if((hdma->Init.Direction) == DMA_MEMORY_TO_PERIPH)

  {

    /* Configure DMA Stream destination address */

    hdma->Instance->PAR = DstAddress;

    /* Configure DMA Stream source address */

    hdma->Instance->M0AR = SrcAddress;

  }

 

/* Memory to Peripheral */

  else

  {

    /* Configure DMA Stream source address */

    hdma->Instance->PAR = SrcAddress;

    

    /* Configure DMA Stream destination address */

    hdma->Instance->M0AR = DstAddress;

  }

}

Michael