KDS debug for K22F120M in interrupt enviroment.

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

KDS debug for K22F120M in interrupt enviroment.

Jump to solution
2,105 Views
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 ?

Labels (1)
1 Solution
935 Views
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

View solution in original post

0 Kudos
11 Replies
935 Views
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 Kudos
935 Views
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 Kudos
936 Views
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 Kudos
935 Views
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 Kudos
935 Views
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 Kudos
935 Views
BlackNight
NXP Employee
NXP Employee

Hi Sina,

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

Erich

0 Kudos
935 Views
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 Kudos
935 Views
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 Kudos
935 Views
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 Kudos
935 Views
haidong_zheng
NXP Employee
NXP Employee

Hi Erich:

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

Thanks!

0 Kudos
935 Views
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 Kudos