<?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>topic S32K144 Debug Breakpoint Qustions in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K144-Debug-Breakpoint-Qustions/m-p/1316643#M11488</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I got some questions about the breakpoints in debug mode. Below is a simple program to explain.&lt;/P&gt;&lt;P&gt;Putting breakpoints before the first 3 lines in main just works as expected, but aren't declarations like&amp;nbsp; counter, and counter_limit able to stop the program? Is there a reason?&lt;/P&gt;&lt;P&gt;I tried putting a breakpoint before the LED toggle point PTD-&amp;gt;PTOR = 1&amp;lt;&amp;lt;0; but it just gets ignored..?&lt;/P&gt;&lt;P&gt;And if I put it next line when counter is set to 0 again the program stops at this point every single cycle of the for loop (even if the if-request isn't true), and that confuses me most.. &lt;LI-EMOJI id="lia_grinning-face-with-smiling-eyes" title=":grinning_face_with_smiling_eyes:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can enlighten me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Raphael&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include "sdk_project_config.h"&lt;BR /&gt;#include "s32K144.h"&lt;BR /&gt;&lt;BR /&gt;volatile int exit_code = 0;&lt;BR /&gt;&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;PCC-&amp;gt;PCCn[PCC_PORTD_INDEX] = PCC_PCCn_CGC_MASK; //enabling clock for PORT D&lt;BR /&gt;PORTD-&amp;gt;PCR[0] = PORT_PCR_MUX(1); //set pin as GPIO&lt;BR /&gt;PTD-&amp;gt;PDDR = 1&amp;lt;&amp;lt;0; // pin 0 is configured as output&lt;BR /&gt;int counter = 0;&lt;BR /&gt;int counter_limit = 100000;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for(;;)&lt;BR /&gt;{&lt;BR /&gt;counter++;&lt;/P&gt;&lt;P&gt;if(counter &amp;gt; counter_limit)&lt;BR /&gt;{&lt;BR /&gt;PTD-&amp;gt;PTOR = 1&amp;lt;&amp;lt;0;&lt;BR /&gt;counter = 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if(exit_code != 0)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;return exit_code;&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Mon, 02 Aug 2021 11:07:05 GMT</pubDate>
    <dc:creator>Raphael2</dc:creator>
    <dc:date>2021-08-02T11:07:05Z</dc:date>
    <item>
      <title>S32K144 Debug Breakpoint Qustions</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-Debug-Breakpoint-Qustions/m-p/1316643#M11488</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I got some questions about the breakpoints in debug mode. Below is a simple program to explain.&lt;/P&gt;&lt;P&gt;Putting breakpoints before the first 3 lines in main just works as expected, but aren't declarations like&amp;nbsp; counter, and counter_limit able to stop the program? Is there a reason?&lt;/P&gt;&lt;P&gt;I tried putting a breakpoint before the LED toggle point PTD-&amp;gt;PTOR = 1&amp;lt;&amp;lt;0; but it just gets ignored..?&lt;/P&gt;&lt;P&gt;And if I put it next line when counter is set to 0 again the program stops at this point every single cycle of the for loop (even if the if-request isn't true), and that confuses me most.. &lt;LI-EMOJI id="lia_grinning-face-with-smiling-eyes" title=":grinning_face_with_smiling_eyes:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can enlighten me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Raphael&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include "sdk_project_config.h"&lt;BR /&gt;#include "s32K144.h"&lt;BR /&gt;&lt;BR /&gt;volatile int exit_code = 0;&lt;BR /&gt;&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;PCC-&amp;gt;PCCn[PCC_PORTD_INDEX] = PCC_PCCn_CGC_MASK; //enabling clock for PORT D&lt;BR /&gt;PORTD-&amp;gt;PCR[0] = PORT_PCR_MUX(1); //set pin as GPIO&lt;BR /&gt;PTD-&amp;gt;PDDR = 1&amp;lt;&amp;lt;0; // pin 0 is configured as output&lt;BR /&gt;int counter = 0;&lt;BR /&gt;int counter_limit = 100000;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for(;;)&lt;BR /&gt;{&lt;BR /&gt;counter++;&lt;/P&gt;&lt;P&gt;if(counter &amp;gt; counter_limit)&lt;BR /&gt;{&lt;BR /&gt;PTD-&amp;gt;PTOR = 1&amp;lt;&amp;lt;0;&lt;BR /&gt;counter = 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if(exit_code != 0)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;return exit_code;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 11:07:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-Debug-Breakpoint-Qustions/m-p/1316643#M11488</guid>
      <dc:creator>Raphael2</dc:creator>
      <dc:date>2021-08-02T11:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 Debug Breakpoint Qustions</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-Debug-Breakpoint-Qustions/m-p/1316977#M11502</link>
      <description>&lt;P&gt;Hi@&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/187961" target="_self" aria-label="View Profile of Raphael2"&gt;&lt;SPAN class=""&gt;Raphael2&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;This may be caused by the different locations of variables in memory, and the debugger cannot access this storage space.&lt;/P&gt;
&lt;P&gt;The shaded part on the left is where breakpoints can be placed.(I use KEIL to port you code.)&lt;/P&gt;
&lt;P&gt;Here is you code,&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Senlent_0-1627957493747.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/151593iF80CE1297D4448D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Senlent_0-1627957493747.png" alt="Senlent_0-1627957493747.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Turn it into a global variable&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Senlent_1-1627957638630.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/151594i250B6C1700BC01C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Senlent_1-1627957638630.png" alt="Senlent_1-1627957638630.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That's all I know, and I hope this answer is useful to you.&lt;/P&gt;
&lt;P&gt;BR!&lt;/P&gt;
&lt;P&gt;Jim.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 02:29:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-Debug-Breakpoint-Qustions/m-p/1316977#M11502</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2021-08-03T02:29:18Z</dc:date>
    </item>
  </channel>
</rss>

