<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>S32K中的主题 Check if debugger is connected | S32K14x</title>
    <link>https://community.nxp.com/t5/S32K/Check-if-debugger-is-connected-S32K14x/m-p/933627#M4972</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using semihosting on S32K144 for debugging (using printf statements) in my project. I observed that when the debugger is detached, code gets stuck at 'printf'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know how to check if the debugger is connected in-code, so that i can bypass/redirect the printf to some empty function when debugger is not connected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prasanna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Oct 2019 07:01:23 GMT</pubDate>
    <dc:creator>prasanna_rawke</dc:creator>
    <dc:date>2019-10-17T07:01:23Z</dc:date>
    <item>
      <title>Check if debugger is connected | S32K14x</title>
      <link>https://community.nxp.com/t5/S32K/Check-if-debugger-is-connected-S32K14x/m-p/933627#M4972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using semihosting on S32K144 for debugging (using printf statements) in my project. I observed that when the debugger is detached, code gets stuck at 'printf'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know how to check if the debugger is connected in-code, so that i can bypass/redirect the printf to some empty function when debugger is not connected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prasanna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2019 07:01:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Check-if-debugger-is-connected-S32K14x/m-p/933627#M4972</guid>
      <dc:creator>prasanna_rawke</dc:creator>
      <dc:date>2019-10-17T07:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Check if debugger is connected | S32K14x</title>
      <link>https://community.nxp.com/t5/S32K/Check-if-debugger-is-connected-S32K14x/m-p/933628#M4973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/prasanna.rawke@carnot.co.in"&gt;prasanna.rawke@carnot.co.in&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;The debugger&amp;nbsp;writes to the ARM Debug system registers&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developer.arm.com/docs/ddi0403/e/armv7-m-architecture-reference-manual" title="https://developer.arm.com/docs/ddi0403/e/armv7-m-architecture-reference-manual"&gt;Arm®v7-M Architecture Reference Manual | Arm®v7-M Architecture Reference Manual – Arm Developer&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C1.6 Debug system registers&lt;/P&gt;&lt;P&gt;But as far as I know, when the debugger&amp;nbsp;gets disconnected, none of them reflects that.&lt;/P&gt;&lt;P&gt;However, when the debugger is active, you can see it on the bus.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/93214iC677D4DB98C694AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;JTAG_TDI pin (PTC5) has a pullup enabled by default.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, when the debugger is disconnected,&amp;nbsp;PTC_PDIR[5] should read high constantly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2019 13:14:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Check-if-debugger-is-connected-S32K14x/m-p/933628#M4973</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2019-10-22T13:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Check if debugger is connected | S32K14x</title>
      <link>https://community.nxp.com/t5/S32K/Check-if-debugger-is-connected-S32K14x/m-p/933629#M4974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel, Thanks for the solution. It worked for evaluation kit, where it uses OpenSDA for debugging. I noticed that the status of this pin does not change while debugging via SWD protocol. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With SWD debugger, I am reading the DHCSR register to check if the debugger is connected. LSB indicates if the debug mode is ON or OFF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Nov 2019 13:40:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Check-if-debugger-is-connected-S32K14x/m-p/933629#M4974</guid>
      <dc:creator>prasanna_rawke</dc:creator>
      <dc:date>2019-11-09T13:40:04Z</dc:date>
    </item>
  </channel>
</rss>

