Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Honored Contributor I
1,454 Views

Interrupts using the ARM core and the GIC

I have been looking at the Altera documentation for the GIC on the Cyclone V device. Found here: ftp://ftp.altera.com/up/pub/altera_material/15.0/tutorials/using_gic.pdf  

 

At the bottom of which (Appendix B) has some sample code. Does anyone know what the following is for:  

 

// Define the remaining exception handlers void __attribute__ ((interrupt)) __cs3_reset (void){ while(1); } void __attribute__ ((interrupt)) __cs3_isr_undef (void){ while(1); } void __attribute__ ((interrupt)) __cs3_isr_swi (void){ while(1); } void __attribute__ ((interrupt)) __cs3_isr_pabort (void){ while(1); } void __attribute__ ((interrupt)) __cs3_isr_dabort (void){ while(1); } void __attribute__ ((interrupt)) __cs3_isr_fiq (void){ while(1); }  

 

When I try to use the sample code it causes my program to get stuck in the __cs3_reset function. Obviously they're full of while(1); statements so the fact it gets stuck isn't that surprising, however I don't know why these are part of the 'complete code example' 

 

Any one got any ideas?  

 

Cheers
0 Kudos
2 Replies
Highlighted
Honored Contributor I
43 Views

All these __cs3_??? are the labels/names of Mentor's Code Sourcery interrupt/exception handlers. 

Code Sourcery is one of the variant of GCC for the ARM. 

 

That code is the interrupt/exception handlers themselves.
0 Kudos
Highlighted
Honored Contributor I
43 Views

Ooooppps, something went wrong. 

 

It's stuck in reset as this where the processor goes upon reset (reset is an exception). 

 

You may able to go into your "C" code by replacing the while(1) in void __attribute__ ((interrupt)) __cs3_reset (void) with this: 

extern void _start(void); 

_start() 

 

I'm not sure at all it will be OK as the stack hasn't been set-up. 

 

The other way is to simply comment out / remove the code for __cs3_reset. 

As it is defined, it most likely overloads the default one from the "C" library.
0 Kudos