How to implement ISRs in GCC?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to implement ISRs in GCC?

1,002 Views
__invited__hari
Contributor V

Hello,

Could someone point me how to implement an ISR in GCC compiler with an example please.

I tried the below, but it didn't work.

void __attribute__ ( ( interrupt ( "IRQ" ) ) ) SVCall_IRQn ( void ) 
{
   /* Implement the ISR code here */
}

Thanks,

Hari

Tags (1)
2 Replies

881 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi HARI KRISHNA KAPPARAPU

With the software enablement that we provide, you can use a startup file which contains the vector table defined. This vector table is placed in the corresponding address in 0x0 with the linker file, so when you call an IRQ, you can define just like a function:

void SVC_Handler(void)

{

}

Hope this helps

Best regards

0 Kudos

881 Views
__invited__hari
Contributor V

Hello Jorge,

This is my observation.

I tried the approach that is suggested above as a very first thing, but it is through CPP file. So, it didn't work. Then went to the approach I mentioned in my query as per ARM reference manual. That also didn't work.

So the solution I found later is that, I implemented a C file with this ISR interface (just as you mentioned) and then provided function calls to register a callback function to call from C++ Classes.

Please do let me know if that doesn't make any sense.

Thanks,

Hari