2019-10-23 10:12 AM
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);
}
Solved! Go to Solution.
2019-10-23 10:27 PM
No. By SPL, I mean Standard Peripheral Library, the predecessor of Cube.
JW
2019-10-23 11:47 AM
This does not look as using HAL Treiber , rather, the older SPL.
JW
2019-10-23 10:08 PM
I guess 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
2019-10-23 10:27 PM
No. By SPL, I mean Standard Peripheral Library, the predecessor of Cube.
JW
2019-10-23 10:43 PM
Thank you allot. I will try the Software at the Weekend
2019-10-28 11:48 AM
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"
2019-10-29 03:17 PM
After hours of reading documents. I know about SPL, HAL and LL. And how to solve my problem