stm32f10x - DMA Problem

Gast #3147105
Lesenswert?

Hallo,

ich programmiere einen stm32f10x mit der Software Keil µVision 4.

Ich habe ein Problem mit dem DMA beim USART 1. Die Kommunikation des 
USART 1 über Interrupt funktioniert ohne Probleme. Aber nun möchte ich 
beim Empfangen gerne den DMA einsetzen. hierbei wird kein DMA interrupt 
ausgelöst. der Interrupt von der schnittstelle wird deakiviert.

der DMA wird wie folgt konfiguriert:
DMA_InitTypeDef  DMA_InitStructure;

RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);

DMA_DeInit(DMA1_Channel5);  // Kanal aus Ref Manual auswählen

DMA_InitStructure.DMA_BufferSize = 3; //USART1_BUFFER_GROESSE;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;
DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)USART1_DMA_RxBuffer;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&USART1->DR;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;

DMA_Init(DMA1_Channel5, &DMA_InitStructure);

/* Enable DMA Stream Half Transfer and Transfer Complete interrupt */
DMA_ITConfig(DMA1_Channel5, DMA_IT_TC, ENABLE);

/* Enable the USART1 RX DMA Interrupt */
nvic_initialisierung(DMA1_Channel5_IRQn);  // DMA1 Channel5

/* Enable the USART Rx DMA request */
USART_DMACmd(USART1, USART_DMAReq_Rx, ENABLE);

/* Enable DMA1_Channel3 */
DMA_Cmd(DMA1_Channel5, ENABLE);




Kann mir jemand helfen? Danke

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren