Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

UART stops working when interrupts are enabled

$
0
0
Hi all,

I have used the NIOS II environment for several years, but am at a loss at the following problem: The UART stops working (no more output) when I enable UART RX interrupts. I have tested it with both the JTAG UART and a regular UART routed to some pins on the FPGA. This has been working on previous designs, but I recently changed my PC and installed Quartus II 12.1 Build 177. Not sure if this is a version issue, but it sure is a weird behavior. Also note that I did step through in the debugger and the "alt_irq_register" function returned 0, meaning that it was successful.

Here's the code that I'm using to enable the JTAG UART interrupt and register the ISR function:

Code:

void JTAG_UART_init(){        printf("Enable interrupt\n");
        IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(JTAG_UART_BASE, ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK);  // enable interrupt
        printf("Register interrupt\n");
        int a = alt_irq_register(JTAG_UART_IRQ,0,JTAG_UART_ISR);  // setup handler
        printf("Initialize ringbuffer\n");
        Ringbuffer_init();
}

When I step through the code I get UART output right until where the IRQ is registered (setup handler), so I get the "Register interrupt" output, but not the "Initialize ringbuffer" message. Did anyone else run into this issue or have an idea what the issue could be? Any comments/feedback is highly appreciated.

Thanks,
Adrian

Viewing all articles
Browse latest Browse all 19390

Trending Articles