<?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 Re: Debugging code with non-0x0 origin in MCUXpresso General</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/Debugging-code-with-non-0x0-origin/m-p/716462#M249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue is that while the IDE places the PC register at the correct 0x8205&amp;nbsp;value, it does not touch the default setting of the SP register. SP contains all 1's, which causes the whole&amp;nbsp;debugger toolchain to die as soon as a subroutine is hit, which is the second line of code in&amp;nbsp;ResetISR(void). Therefore, the PC never reaches main() before the debugger crashes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 1's in the SP are from address 0x0000 which is 0xFFFFFFFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To me, the IDE should override the default SP value location if the start of CODE starts other than 0x0, because it obviously knew to NOT use the default value at address 0x4 for the PC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I hard code a proper value for top of ram (0x20030000) into address 0x0, everything works fine. Also, if I load in a second object file&amp;nbsp;with p code starting at 0x0 this also works, because that object file sets address 0x0 to the same the top of ram&amp;nbsp;value (0x20030000) needed for the code at 0x8000.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jan 2018 22:08:55 GMT</pubDate>
    <dc:creator>steve_n</dc:creator>
    <dc:date>2018-01-12T22:08:55Z</dc:date>
    <item>
      <title>Debugging code with non-0x0 origin</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Debugging-code-with-non-0x0-origin/m-p/716461#M248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having difficulty debugging a project that places PFLASH at a location other than 0x0.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything builds without error but when I try to debug, the IDE is never able to attach itself properly. It seems like I am missing some setting in the project setting or the debugger settings.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached an example project that locations program flash at 0x8000 on a FRDM-K64F. I used the OpenSDA embedded USB connection on the FRDM-K64F.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change the origin of PFLASH to 0x0 and touch nothing else, the debugger works without an issue. So, what am I missing, to be able to debug the same project with the code starting at 0x8000?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jan 2018 21:44:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Debugging-code-with-non-0x0-origin/m-p/716461#M248</guid>
      <dc:creator>steve_n</dc:creator>
      <dc:date>2018-01-11T21:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging code with non-0x0 origin</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Debugging-code-with-non-0x0-origin/m-p/716462#M249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue is that while the IDE places the PC register at the correct 0x8205&amp;nbsp;value, it does not touch the default setting of the SP register. SP contains all 1's, which causes the whole&amp;nbsp;debugger toolchain to die as soon as a subroutine is hit, which is the second line of code in&amp;nbsp;ResetISR(void). Therefore, the PC never reaches main() before the debugger crashes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 1's in the SP are from address 0x0000 which is 0xFFFFFFFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To me, the IDE should override the default SP value location if the start of CODE starts other than 0x0, because it obviously knew to NOT use the default value at address 0x4 for the PC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I hard code a proper value for top of ram (0x20030000) into address 0x0, everything works fine. Also, if I load in a second object file&amp;nbsp;with p code starting at 0x0 this also works, because that object file sets address 0x0 to the same the top of ram&amp;nbsp;value (0x20030000) needed for the code at 0x8000.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2018 22:08:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Debugging-code-with-non-0x0-origin/m-p/716462#M249</guid>
      <dc:creator>steve_n</dc:creator>
      <dc:date>2018-01-12T22:08:55Z</dc:date>
    </item>
  </channel>
</rss>

