lpcxpresso LPC1343: setting up breakpoints in Timer ISR

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

lpcxpresso LPC1343: setting up breakpoints in Timer ISR

1,935件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by safiullahh on Sat Jan 17 03:15:03 MST 2015
Hi All,p

I am facing the following error.

1) setting up a breakpoint in a ISR results in the following error:

"terminating on communication loss: Pipe has been closed by GDB"

I solved the debug issue through this forum post:
http://www.lpcware.com/content/forum/lpcxpresso-and-setting-breakpoints-isr-causes-gdb-crash

I remove the -Xlinker option --gc-sections.

Upon doing this the debug session starts normally.

2) after the start of debug session I notice the ISR I declare (a 32-bit Timer 0 ISR) does not get invoked at all, and the code keeps jumping into the IntDefaultHandler ISR. This probably means the processor cant find the Timer ISR.

3) this problem seems to exist only when using my own project (LPCOpen C++ Project) where as the code in the samples seems to run and debug correctly.

Is this behavior right? Am I doing something wrong? If so, how do I fix it? Please help.
ラベル(1)
0 件の賞賛
返信
7 返答(返信)

1,870件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by safiullahh on Sat Jan 17 08:13:03 MST 2015
Yep that solves the problem. Thanks again.
0 件の賞賛
返信

1,870件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by safiullahh on Sat Jan 17 07:15:16 MST 2015
Thanks a million, will try it out tomorrow.
0 件の賞賛
返信

1,870件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sat Jan 17 07:01:02 MST 2015
Just add 'extern C' for all interrupts, then this interrupt handler name is used...

[color=#f00]#ifdef __cplusplus
extern "C" {
#endif[/color]
void InterruptHanderName(void)
{
 //doing interrupt stuff here
}
[color=#f00]#ifdef __cplusplus
}
#endif
[/color]

It's not necessary to modify startup files...
0 件の賞賛
返信

1,870件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by safiullahh on Sat Jan 17 06:48:57 MST 2015
Can't view the link from my phone, but if it's C++ name mangling, should declaring the ISR as "extern C" solve the issue?

May need to modify declarations in cr_startup_lpc13xx.cpp.
0 件の賞賛
返信

1,870件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by safiullahh on Sat Jan 17 06:45:07 MST 2015
The name of the ISR is correct i.e. TIMER32_0_IRQHandler
0 件の賞賛
返信

1,870件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sat Jan 17 04:02:09 MST 2015

Quote: safiullahh
2) after the start of debug session I notice the ISR I declare (a 32-bit Timer 0 ISR) does not get invoked at all, and the code keeps jumping into the IntDefaultHandler ISR. This probably means the processor cant find the Timer ISR.



Correct  :)


Quote: safiullahh

3) this problem seems to exist only when using my own project (LPCOpen C++ Project) where as the code in the samples seems to run and debug correctly.



That's 'Name Mangling' of C++  :O

See: http://www.lpcware.com/content/forum/why-isnt-my-systickhandler-being-called-my-c-project
0 件の賞賛
返信

1,870件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sat Jan 17 03:24:16 MST 2015
1. Check the spelling of your Timer ISR - if you have misspelt it, the default will be used IntDefault). Check the name in the vector table matches the name you have provided.
2. This also explains why you got the crash on debug startup. Your code will have been unused and so removed and setting a breakpoint on removed code causes the crash
0 件の賞賛
返信