This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UART Interrupt problem

Stellaris UART Interrupt problem.

I have following setup,
TXIM, RXIM and RTIM are enabled.

TX is on uDMA.

uDMA generates interrupt on TXIM level when it finishes transfer to TX FIFO. Occasionally, I am getting UART interrupt but when I read UART interrupt status using,
ROM_UARTIntStatus(UART0_BASE, true);

I read 0. Then what is causing this UART interrupt. I am using master-slave communication, where my device is slave and master does not send another command without slave’s reply to previous command. This happens exactly at the same position every time.

Point of break:

My TX ring Buffer is 256 bytes. Application writes response packet of about 12-16 bytes in TX ring buffer and initiate uDMA transfer with length = contiguous used space by
RingBufContigUsed(&sendBuf);

When the length is around 7-10 bytes (Packet is bigger so we need another transfer from within UART interrupt handler), UART generates interrupt but ulStatus turns out to be 0. So if I compare ulStatus to TXIM, I am not able to reload uDMA channel and transfer stops there. Surprisingly, if bytes are different say 4 or less, it works fine. May be it has to do something with TXFIFO Empty interrupt.

6 Replies

  • Did you ever resolve this problem. I have a similar issue where a UART interrupt occurs but,  ulStatus = ROM_UARTIntStatus(UART1_BASE, true); returns 0. To me it seems like this function should never return 0. Can anyone offer some insight into what may be occurring?

     

     

    Thanks

      Glenn

  • In reply to Glenn Graf:

    I'm also having a similar thing occur and I'm trying to track down the cause. Did either of you resolve this?

  • In reply to Bodey Baker:

    @slandrum

    It seems like your post went missing. Anyway, I'm only using the one interrupt handler for the one peripheral and I am checking the right peripheral in the interrupt handler. But I'm seeing this for SSI(0) not UART, I just thought it could be the same root cause so I posted here. I might open up a new topic. Cheers.

  • In reply to Bodey Baker:

    I removed my post because I didn't realize at first that this was probably really about a uDMA issue or the interaction between uDMA and the peripherals and their interrupts.  I have not used uDMA on any of my projects, so removed my post so as not to clutter the discussion.

  • In reply to slandrum:

    Ah. Well thanks anyway.

  • In reply to Bodey Baker:

    For anyone else who is seeing this, it seemed that my problem was as follows:


    IntMasterEnable()
    IntEnable()
    //Have data to send
    PeripheralIntEnable()
    //Data finishes sending
    PeripheralIntDisable()
    //Interrupt fires but status is zero

     

    It seems like the event trigger was firing, then I'd disable that event but the peripheral still had interrupts enabled so it would fire. I tried clearing the interrupts, but with the SSI peripheral, it looks like some sources can't be cleared. Instead, since I really didn't need interrupts on that peripheral I just called IntDisable() after PeripheralIntDisable() and my phantom interrupts disappeared.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.