Page 1 of 1

DMA init

Posted: Wed May 24, 2017 3:29 pm
by neums
Hi,
in the DMA init function in file stm32_dma.c is the following code snippet:

Code: Select all

void dmaInit(void) {
  unsigned i;

  dma_streams_mask = 0U;
  for (i = 0U; i < STM32_DMA_STREAMS; i++) {
    _stm32_dma_streams[i].stream->CR = 0U;
    dma_isr_redir[i].dma_func = NULL;
  }
  DMA1->LIFCR = 0xFFFFFFFFU;
  DMA1->HIFCR = 0xFFFFFFFFU;
  DMA2->LIFCR = 0xFFFFFFFFU;
  DMA2->HIFCR = 0xFFFFFFFFU;
}


Due to reference manual RM0090 (STM32F4) the bits 31..28, 23, 17, 15..12, 7, 1 of DMA_LIFCR and DMA_HIFCR registers are reserved and must be kept at the reset value 0.

Re: DMA init

Posted: Wed May 24, 2017 3:31 pm
by Giovanni
I think those bits are wired to zero, anyway, good suggestion.

Giovanni