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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

How to write HAL ISRs for custom components

Altera_Forum
Honored Contributor II
1,671 Views

Hi experts, 

 

I created a custom component in the Component Editor and added it in a system containing only the Nios II and the component. I can write data from the Nios to my component; this is working. Now I want my component to interrupt the CPU so that it reads from the component. 

 

How can I access the Nios registers containing the information about interrupts? I read in Ch. 5 of the Nios SW Handbook about developing HAL drivers but couldnt get any information on how to register an interrupt. 

 

Any help or hints would be appreciated... 

 

Thanks in advance!
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
669 Views

Hello, 

 

I also encounter problems with hardware custom components interrupts. Could someone help us ? 

 

Thanks ! 

Regards.
0 Kudos
Altera_Forum
Honored Contributor II
669 Views

Basically, to register your ISR you do 

 

alt_irq_init // enable irqs in control register 3 (nios proc ref book, chapter 3)  

alt_irq_register // tie your ISR  

alt_irq_enable // enable your IRQ  

 

That should work.  

__________ 

 

If you want to access CPU registers, you can use functions like:  

alt_irq_pending (or NIOS2_READ_IPENDING),  

alt_irq_enabled, alt_irq_enable, alt_irq_disable etc  

 

Check the alt_irq.h for the reference.  

 

Good luck
0 Kudos
Reply