Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

alt_irq_register can't work

Altera_Forum
Honored Contributor II
936 Views

I have added a component CAN controller into SOPC builder, and it work well. I can send and receive data correctly. But i can't register the interrupt(IRQ) send out from the controller. I checked anything i know.... 

 

Here is my code, it can be compiled and no errors, but just die in the alt_irq_register function. Anybody have experience to use CAN controller in  

SOPC builder can tell me where is the problem?  

 

 

 

static void handle_CAN2_interrupts(void* context, alt_u32 id) 

int q; 

q =IORD(CAN2_BASE, 0x4);  

printf(" interupt = %d \n",q);  

 

 

int main() 

printf("Hello from Nios II!\n"); 

 

 

alt_irq_register(CAN2_IRQ,NULL, handle_CAN2_interrupts ); 

 

tx_basic_frame(); 

 

 

i use quartus 8.0 and NIOS ii 7.2 to do this
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
120 Views

also i test to use the timer interrupt, and it worked fine. i can't figure why me controller can't even register irq...

Altera_Forum
Honored Contributor II
120 Views

I don't know your CAN controller, but I guess you probably need to clear the irq inside the handler function, otherwise the irq would continuously retrigger just after you have serviced it.

Altera_Forum
Honored Contributor II
120 Views

 

--- Quote Start ---  

I don't know your CAN controller, but I guess you probably need to clear the irq inside the handler function, otherwise the irq would continuously retrigger just after you have serviced it. 

--- Quote End ---  

 

 

 

Thanks for your advise, i find my controller send a unexpected interrupt after reset, and it cause the retrigger problem you said.
Reply