Hi all,
You may run into this annoying issue where the system.h file of your BSP, which contains the macro definitions that describe your system (such as device addresses, interrupt IDs, etc.) will always assign -1 to the interrupt-related macros of your device, such as <device instance name>_IRQ and <device instance name>_IRQ_INTERRUPT_CONTROLLER_ID, even if you right-click on your BSP project in Eclipse > Nios II > Generate BSP.
Here's an example:
#define ALT_MODULE_CLASS_buttons_controller_0 buttons_controller
#define BUTTONS_CONTROLLER_0_BASE 0x8001000
#define BUTTONS_CONTROLLER_0_IRQ -1
#define BUTTONS_CONTROLLER_0_IRQ_INTERRUPT_CONTROLLER_ID -1
#define BUTTONS_CONTROLLER_0_NAME "/dev/buttons_controller_0"
#define BUTTONS_CONTROLLER_0_SPAN 16
#define BUTTONS_CONTROLLER_0_TYPE "buttons_controller"
Thus your interrupts are never handled, as they are registered to an empty ID.
To fix that issue, do not forget to set the associated addressable interface in the component editor for your peripheral in QSys / Platform designer to your Avalon slave interface:
Best,
The TAs team