Skip to main content
GIkar
Associate III
October 23, 2019
Solved

DMA Flags not found (HAL Treiber)

  • October 23, 2019
  • 6 replies
  • 1345 views

Hello,

I want to catch the half transfer and the full transfer flag from DMA controller but get an error and don't understand why.

the compiler say first use in this function:

'DMA_FLAG_HTIF5' undeclared (first use in this function)

'DMA_FLAG_TCIF5' undeclared (first use in this function)

error: DMA_GetFlagStatus(DMA1_Stream5, DMA_FLAG_HTIF5);

   while(it_st == RESET) {  //warten bis Transfer Complete Flag kommt

error:   it_st = DMA_GetFlagStatus(DMA1_Stream5, DMA_FLAG_TCIF5);

  }

DMA Init is this but it also doesn't work (each line an error):

void init_dma(void) {

   DMA_InitTypeDef dma_init;

   RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA1, ENABLE);

   DMA_DeInit(DMA1_Stream5);

   dma_init.DMA_Channel = DMA_Channel_7;

   dma_init.DMA_PeripheralBaseAddr = (uint32_t)(DAC_BASE + 0x10);

   dma_init.DMA_Memory0BaseAddr = (uint32_t)&DAC_Buff;

   dma_init.DMA_DIR = DMA_DIR_MemoryToPeripheral;

   dma_init.DMA_BufferSize = 512;

   dma_init.DMA_PeripheralInc = DMA_PeripheralInc_Disable;

   dma_init.DMA_MemoryInc = DMA_MemoryInc_Enable;

   dma_init.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;

   dma_init.DMA_MemoryDataSize = DMA_PeripheralDataSize_Byte;

   dma_init.DMA_Mode = DMA_Mode_Circular;

   dma_init.DMA_Priority = DMA_Priority_High;

   dma_init.DMA_FIFOMode = DMA_FIFOMode_Disable;

   dma_init.DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull;

   dma_init.DMA_MemoryBurst = DMA_MemoryBurst_Single;

   dma_init.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;

   DMA_Init(DMA1_Stream5, &dma_init);

   DMA_Cmd(DMA1_Stream5, ENABLE);

   DAC_Cmd(DAC_Channel_1, ENABLE);

   DAC_DMACmd(DAC_Channel_1, ENABLE);

//   DAC_ITConfig(DAC_Channel_1, DMA_SxCR_HTIE,ENABLE);

//   DAC_ITConfig(DAC_Channel_1, DMA_SxCR_TCIE,ENABLE);

   }

This topic has been closed for replies.

6 replies

waclawek.jan
Super User
October 23, 2019

This does not look as using HAL Treiber , rather, the older SPL.

JW

GIkar
GIkarAuthor
Associate III
October 24, 2019

I gues​s it is low level driver.

HAL ***** me up all ​all the time...

The ST documentation ​is so bad.

This Code fits the best to​ the it.

Did you know how i can make it work? Config cubemx.

The ST32F4 Series Support the LL driver i guess this is what you mean by SPL

waclawek.jan
waclawek.janBest answer
Super User
October 24, 2019
GIkar
GIkarAuthor
Associate III
October 24, 2019

Thank you allot. I will try the Software at the Weekend ​