K22 detect if in jtag debug mode

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

K22 detect if in jtag debug mode

Jump to solution
794 Views
rubenjonsson
Contributor II

Is there an easy way to detect if the program in a K22 is running from the debugger over the JTAG interface or if it is started standalone?

I have added some LEDs to the jtag interface pins which I want to use when not running from the debugger. I could check the _DEBUG define at compile time to enable the GPIOs instead of the JTAG interface but I would rather be able to do this at runtime so it works with any build.

Labels (1)
1 Solution
657 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Ruben Jonsson:

The ARM register DHCSR should help you to achieve what you need. See the next discussion about the same topic:

Flag Status: SRS1_JTAG


Best regards!
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
657 Views
rubenjonsson
Contributor II

Works great, thanks.

658 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Ruben Jonsson:

The ARM register DHCSR should help you to achieve what you need. See the next discussion about the same topic:

Flag Status: SRS1_JTAG


Best regards!
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos