<?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: Stack Pointer Not Initialized in startup_mmxrt1064.c Module in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Stack-Pointer-Not-Initialized-in-startup-mmxrt1064-c-Module/m-p/1477733#M191765</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;Thanks for your reply.&lt;BR /&gt;1) Will the ROM code set the SP to the value as defined by the first entry of the application's own vector table ??&lt;BR /&gt;-- Yes, or it can't implement jump operation successfully.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2022 00:51:47 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2022-06-22T00:51:47Z</dc:date>
    <item>
      <title>Stack Pointer Not Initialized in startup_mmxrt1064.c Module</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Stack-Pointer-Not-Initialized-in-startup-mmxrt1064-c-Module/m-p/1476931#M191698</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My question is, how should the stack pointer be initialized to my application's starting value as defined by the vector table?&amp;nbsp; Isn't ResetISR supposed to handle this ?&lt;/P&gt;&lt;P&gt;I noticed that the stack pointer is not initialized by the startup_mimxrt1064.c module in ResetISR(). However, the Reset_Handler in startup_MIMXRT1064.S sets the stack pointer using the __isr_vector table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If startup_mimxrt1064.c is used as the startup function, how is the stack pointer supposed to be initialized to the application's working value as defined by the vector table?&amp;nbsp; It seems that the application must initialize the stack pointer or the&amp;nbsp;startup_mimxrt1064.c has to be modified to initialize the stack pointer.&amp;nbsp; &amp;nbsp;SystemInitHook() cannot be used easily to set the stack pointer because it itself has its either the CPU context and/or return address of ResetISR on the stack when it is called from ResetISR.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is how my application's stack is defined in the linker load file, and ResetISR is entered with the stack pointer set to some other value, presumably the bootloader's&lt;/P&gt;&lt;P&gt;SRAM_DTC (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000 /* 128K bytes (alias RAM) */&lt;/P&gt;&lt;P&gt;/* Reserve and place Stack within memory map */&lt;BR /&gt;_StackSize = 0xa000;&lt;BR /&gt;.stack : ALIGN(4)&lt;BR /&gt;{&lt;BR /&gt;_vStackBase = .;&lt;BR /&gt;. += _StackSize;&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;_vStackTop = .;&lt;BR /&gt;} &amp;gt; SRAM_DTC&lt;BR /&gt;/* DATA section for SRAM_DTC */&lt;/P&gt;&lt;P&gt;PROVIDE(__StackTop = _vStackBase)&lt;/P&gt;&lt;P&gt;.stack 0x0000000020000000 0xa000&lt;BR /&gt;0x0000000020000000 _vStackBase = .&lt;BR /&gt;0x000000002000a000 . = (. + _StackSize)&lt;BR /&gt;*fill* 0x0000000020000000 0xa000&lt;BR /&gt;0x000000002000a000 . = ALIGN (0x4)&lt;BR /&gt;0x000000002000a000 _vStackTop = .&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 16:55:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Stack-Pointer-Not-Initialized-in-startup-mmxrt1064-c-Module/m-p/1476931#M191698</guid>
      <dc:creator>mjpovi</dc:creator>
      <dc:date>2022-06-20T16:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Stack Pointer Not Initialized in startup_mmxrt1064.c Module</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Stack-Pointer-Not-Initialized-in-startup-mmxrt1064-c-Module/m-p/1477146#M191716</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;1） How should the stack pointer be initialized to my application's starting value as defined by the vector table? Isn't ResetISR supposed to handle this?&lt;BR /&gt;-- Once power-up, the RT MCU will execute the ROM code prior to jumping to the application actually, so the PS and PC registers should be set in the ROM code.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 04:02:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Stack-Pointer-Not-Initialized-in-startup-mmxrt1064-c-Module/m-p/1477146#M191716</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2022-06-21T04:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Stack Pointer Not Initialized in startup_mmxrt1064.c Module</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Stack-Pointer-Not-Initialized-in-startup-mmxrt1064-c-Module/m-p/1477706#M191762</link>
      <description>&lt;P&gt;Hi, and thank-you for the quick response to my question.&amp;nbsp; Will the ROM code set the SP to the value as defined by the first entry of the application's own vector table ??&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 22:37:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Stack-Pointer-Not-Initialized-in-startup-mmxrt1064-c-Module/m-p/1477706#M191762</guid>
      <dc:creator>mjpovi</dc:creator>
      <dc:date>2022-06-21T22:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Stack Pointer Not Initialized in startup_mmxrt1064.c Module</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Stack-Pointer-Not-Initialized-in-startup-mmxrt1064-c-Module/m-p/1477733#M191765</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Thanks for your reply.&lt;BR /&gt;1) Will the ROM code set the SP to the value as defined by the first entry of the application's own vector table ??&lt;BR /&gt;-- Yes, or it can't implement jump operation successfully.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 00:51:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Stack-Pointer-Not-Initialized-in-startup-mmxrt1064-c-Module/m-p/1477733#M191765</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2022-06-22T00:51:47Z</dc:date>
    </item>
  </channel>
</rss>

