Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12604 Discussions

Custom component with interrupt

Altera_Forum
Honored Contributor II
1,658 Views

I'm working on a custom Qsys component. It does everything it's supposed to do, but it takes a long time (reading flash memory) so I need to make it non-blocking. 

 

I added an interrupt sender to the component, and made it so that when the process is done it raises the IRQ line for 16 clock cycles. I assigned this interrupt sender a number (20) in Qsys and generated the system. I modified my driver so that it registers the interrupt on startup. 

 

The problem is that when I run the code, every time the process is done the debugger forces a break with NIOS2_BREAK() in alt_instruction_exception_entry. There is a rather long comment in that function, and near the bottom is says the following: 

 

* The problem could also be hardware related: * - If your hardware is broken and is generating spurious interrupts * (a peripheral which negates its interrupt output before its * interrupt handler has been executed will cause spurious interrupts) 

 

Do I need to add some kind of interrupt ACK into my code/component? What is that standard way this is done?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
824 Views

 

--- Quote Start ---  

 

Do I need to add some kind of interrupt ACK into my code/component? What is that standard way this is done? 

--- Quote End ---  

 

 

The "standard" way is probably with control register bits corresponding to interrupt enable, interrupt status, and interrupt pending. Then your irq output is just an "AND" of the three. The "ACK" would be a write to the interrupt pending bit to clear it. 

 

Since your first attempt was just a fixed duration assertion of the signal, you can probably get by with something much simpler like just asserting the irq until any read/write to the component is performed (e.g. clear the IRQ bit on the 'chipselect' input edge, if you have one).
0 Kudos
Altera_Forum
Honored Contributor II
824 Views

Hello , 

 

Can anybody tell me the link to study custom component examples. if any body have reference/design example then kindly share .
0 Kudos
Altera_Forum
Honored Contributor II
824 Views

Hello, 

I am looking for interfacing a custom component with Arm processor. I have very little knowledge of Altera software tools. The documents for interfacing custom component are too advanced and use template designs (rocketboards). Could you please share document or link for learning custom component interface and use in bare metal or Linux environment. 

Thank you.
0 Kudos
Reply