How to implement ISRs in GCC?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to implement ISRs in GCC?

1,910件の閲覧回数
__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

タグ(1)
2 返答(返信)

1,789件の閲覧回数
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 件の賞賛
返信

1,789件の閲覧回数
__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