<?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 running code out of the stack in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1259860#M7404</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I was wondering if any one of the brilliant mind would show me how to load the stack and run the code from there.&lt;/P&gt;&lt;P&gt;I know how to use linker script file to run code out of RAM.&lt;/P&gt;&lt;P&gt;I'm exclusively talking about the stack. I have seen other people do it long time ago, and I know it could be done.&lt;/P&gt;&lt;P&gt;Please don't give me "Stack is used to save machine state" and things of that nature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Koorosh Hajiani&lt;/P&gt;</description>
    <pubDate>Fri, 09 Apr 2021 19:51:38 GMT</pubDate>
    <dc:creator>hajianik</dc:creator>
    <dc:date>2021-04-09T19:51:38Z</dc:date>
    <item>
      <title>running code out of the stack</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1259860#M7404</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I was wondering if any one of the brilliant mind would show me how to load the stack and run the code from there.&lt;/P&gt;&lt;P&gt;I know how to use linker script file to run code out of RAM.&lt;/P&gt;&lt;P&gt;I'm exclusively talking about the stack. I have seen other people do it long time ago, and I know it could be done.&lt;/P&gt;&lt;P&gt;Please don't give me "Stack is used to save machine state" and things of that nature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Koorosh Hajiani&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 19:51:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1259860#M7404</guid>
      <dc:creator>hajianik</dc:creator>
      <dc:date>2021-04-09T19:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: running code out of the stack</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1262616#M7407</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;could you describe more in the detail what are you trying to achieve by that construction?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Stan&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 08:05:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1262616#M7407</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2021-04-15T08:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: running code out of the stack</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1262996#M7410</link>
      <description>&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;I just need to run a function from RAM. This is concerning the&amp;nbsp; the launching command to read/write to Program Once in program flash IFR.&lt;/P&gt;&lt;P&gt;I've done this using a linker script file.I've seen other people use stack to run from RAM however it was a long time ago.&lt;/P&gt;&lt;P&gt;was wondering if any of the brilliant mind out there has an idea!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Koorosh&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 16:50:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1262996#M7410</guid>
      <dc:creator>hajianik</dc:creator>
      <dc:date>2021-04-15T16:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: running code out of the stack</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1263523#M7414</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;well, running some function directly from stack is quite unusual way and not much effective - in my opinion. First of all you need to allocate local memory, then memcopy your "function implementation" into allocated memory from flash and after that you can call function pointer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Easiest way is just call function from RAM (as you already did). There is a macro in S32K1xx SDK for running functions from RAM - here is simple example:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;START_FUNCTION_DECLARATION_RAMSECTION&lt;BR /&gt;void CCIF_Callback(void)&lt;BR /&gt;END_FUNCTION_DECLARATION_RAMSECTION&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jiri&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 11:32:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1263523#M7414</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2021-04-16T11:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: running code out of the stack</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1263791#M7419</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I know all that.&lt;/P&gt;&lt;P&gt;My question was/is&amp;nbsp; specifically on running function out of stack.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 21:37:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/running-code-out-of-the-stack/m-p/1263791#M7419</guid>
      <dc:creator>hajianik</dc:creator>
      <dc:date>2021-04-16T21:37:55Z</dc:date>
    </item>
  </channel>
</rss>

