cancel
Showing results for 
Search instead for 
Did you mean: 

DMA Flags not found (HAL Treiber)

GIkar
Associate III

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);

   }

1 ACCEPTED SOLUTION
6 REPLIES 6

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

JW

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

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

Thank you so mutch. This libs are the last puzzel parts. Now the code works.

Last question.

Can HAL and SPL co-exist? Because i get an error in the "stm32f4xx_dma.h" and in the "stm32f4xx_rcc.h"

0690X00000ArMzqQAF.png

GIkar
Associate III

After hours of reading documents. I know about SPL, HAL and LL. And how to solve my problem