Altera_Forum
Honored Contributor
14 years agoendless loop in stock interrupt handler
Hi people,
a bit of information about my system first: - terasIC DE2-115 evaluation board with Cyclone IVE FPGA - Nios II/s CPU - also part of CPU block: SDRAM Controller, PIO, SysID, 2x Interval Timer, UART - QuartusII 12.0 sp1 community edition - no RTOS, just the altera BSP please let me know if you need more information which could be useful here is my problem: my program only executes the first few lines of my main function and loses itself in the interrupt handler afterwards. detailed description: The program starts running and a few timer interrupts occur and are handled successfully (Timer IRQ is 2, which corresponds to the value of 4 in the pending interrupt register), i.e. "alt_irq_handler" in alt_irq_handler.c is called and returns. After a few more handled interrupts, the alt_interrupt_handler routine is called again, but the pending interrupt register has the value 0 (which does not correspond to any IRQ?) and keeps looping in that interrupt routine forever -> program never returns to main again and is stuck A quick and dirty fix for this problem is to check for "pending register == 0" in the interrupt routine. This fix let's me execute my program, but actually I want to know where these interrupts come from and how to stop them... additionally my fix requires modification of BSP files, which is not what I want to do. looking forward to your comments! Martin