KDS debug for K22F120M in interrupt enviroment.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

KDS debug for K22F120M in interrupt enviroment.

跳至解决方案
4,159 次查看
haidong_zheng
NXP Employee
NXP Employee

Hi,

For K22F120M board and MQX4.1 OS,  I found if I set a breakpont in interrupt routine, once this interrupt be trigger, KDS will stop at this breakpoint, but at this time,  any step (step in, step return, step over) will not work,  even 'run' also will not work. the KDS console keep printting like this "Read 2 bytes @ address 0x0000060c (Data = 0xB408)"

.The same project in IAR enviroment , the same breakpoint at interrupt routine will work as normal.

Any one has the same problem ? Any idea about this ?

标签 (1)
1 解答
2,989 次查看
BlackNight
NXP Employee
NXP Employee

Yes, it seems to be a problem with GDB and doing the stack backtrace.

For J-Link, can you add the

set backtrace limit

command with a number like 20 to it? See below. This limits the number of backtraces.

pastedImage_0.png

Let me know if this helps.

Erich

在原帖中查看解决方案

0 项奖励
回复
11 回复数
2,989 次查看
BlackNight
NXP Employee
NXP Employee

I don't have that board, and I don't see such a problem e.g. with FreeRTOS and the FRDM-K64F board. But it could be because MQX is treating interrupts in a special way?

0 项奖励
回复
2,989 次查看
haidong_zheng
NXP Employee
NXP Employee

The KDS debugger has this kind of error just after  instruction "blx reg",  but at this pointer, I close KDS and open JLink, JLink can connect my K22 board, and "step" command in Jlink is OK, seem this is just a IDE debugger issue.

0 项奖励
回复
2,990 次查看
BlackNight
NXP Employee
NXP Employee

Yes, it seems to be a problem with GDB and doing the stack backtrace.

For J-Link, can you add the

set backtrace limit

command with a number like 20 to it? See below. This limits the number of backtraces.

pastedImage_0.png

Let me know if this helps.

Erich

0 项奖励
回复
2,989 次查看
sinakahnemouyi
Contributor I

Hi Erich,

I have the same issue on the MKL26Z128VFT4, KDS 1.1.1 (Linux), updated processor expert and the latest FreeRTOS. The "set backtrace limit 20" did not help in my case. I can set break points and the program stops at breakpoints; however it does not step into or step over, instead it keeps running. Do you have any other suggestions to solve this issue.

I'm using Segger GDB server to debug.

Best,

Sina

0 项奖励
回复
2,989 次查看
BlackNight
NXP Employee
NXP Employee

Hi Sina,

could you post a screenshot? Does the breakpoint having that 'checkmark' so it is set at a valid code address/line?

Erich

0 项奖励
回复
2,989 次查看
BlackNight
NXP Employee
NXP Employee

Hi Sina,

or could you post your project? maybe I'm missing a setup or something.

Erich

0 项奖励
回复
2,989 次查看
BlackNight
NXP Employee
NXP Employee

Hi Sina,

that number 20 to limit the number of backtraces is arbitrary. Can you try a lower number, say 5 or 3, or even 1?

Erich

0 项奖励
回复
2,989 次查看
sinakahnemouyi
Contributor I

Thank you for your help Erich. You helped me to identify that the problem was about the hardware breakpoint limits. Although, I had unlimited flash breakpoints enabled on my segger j-link debugger for some reason it didn't work properly in linux. I moved my project to Windows and everything works fine now.

Best,

Sina

0 项奖励
回复
2,989 次查看
sinakahnemouyi
Contributor I

Hi Erich,

Thank you for your prompt responses. Lowering the number of backtraces worked for stepping in main() before starting FreeRTOS tasks. My breakpoints all have 'checkmarks' when in debugging mode. Would it be possible that I send you the project privately instead of posting it here?

Best,

Sina

0 项奖励
回复
2,989 次查看
haidong_zheng
NXP Employee
NXP Employee

Hi Erich:

GDB "set backtrace limit 20" option  works for debug at MQX ISR environment.

Thanks!

0 项奖励
回复
2,989 次查看
haidong_zheng
NXP Employee
NXP Employee

Maybe the MQX handle the ISR in special way, but after I checked the MQX interrupt handler code rawly, I don't see the special.

Thanks.

0 项奖励
回复