AnsweredAssumed Answered

USART DMA interrupt with USART interrupt at the same time

Question asked by Erkan Ersoy on Feb 15, 2017


I am trying to add timeout to my USART reception.

I am using USART1 interrupt to start a timer (a sofware timer using system timer). disable interrupt and after time out i should get the data (data packet is short enough to finish before timeout). But USARt interrupt triggers after DMA interrupt. (I internsinally set it short to trigger an interrupt). And the data from USART1->DR is the first data received. So interupt is hold down while whole DMA process and after it is triggered. ANd the USART1->DR is holding first data and never get updated 



void USART1_IRQHandler(void) {
unsigned char ch;

ch = USART_ReceiveData(USART1);
deneme[i] = ch;
//Start timer
//disable interrupt

dataTime = msTicks;
isReceiving = 1;


I couldn't find a document defining that behaviour.


Thank you