<?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>S12 / MagniV Microcontrollers中的主题 Re: S12Z Core Stack Size View usage</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653992#M13852</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The stack may be located anywhere in the 16-megabyte address space that has RAM, and can be any size up to the amount of available RAM. The stack is used to automatically save the return address for subroutine calls, the return address and CPU registers during interrupts, and for local variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is an option in project properties to see stack consumption:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/10371iBFD53B17B33C2E80/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;The &lt;SPAN class=""&gt;stack&lt;/SPAN&gt;&lt;SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;consumpt&lt;/SPAN&gt;ion&lt;/SPAN&gt;&lt;/SPAN&gt; computation is a feature of the linker that helps compute the theoretical maximal amount of &lt;/SPAN&gt;&lt;SPAN class=""&gt;stack&lt;/SPAN&gt; space an application requires at runtime. This estimation can be done for the whole application or for user-specified call sub-trees. The result of the estimation is printed out in the map file along with the corresponding call tree paths. This feature is controlled by the &lt;/SPAN&gt;&lt;CODE class=""&gt;&lt;SPAN&gt;-&lt;SPAN class=""&gt;Stack&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Consumpt&lt;/SPAN&gt;ion&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp; command line option. However, the specific information needed for this feature is issued by the compiler and encoded in the object file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4 class=""&gt;&lt;SPAN&gt;Usage of &lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt; Directive - Test Case &lt;/SPAN&gt;&lt;/H4&gt;&lt;P class=""&gt;shows a test case of usage of &lt;CODE class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt; directive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="" style="text-indent: -72pt; font-weight: bold; margin-right: 0pt; margin-left: 72pt;"&gt;&lt;SPAN&gt; Listing 3.59 Usage of &lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt; Directive &lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;Void main() {&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;Asm_func(); /* Call to an assembly function defined in test.asm*/&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;}&lt;/DIV&gt;&lt;HR /&gt;&lt;P class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Stack&lt;/SPAN&gt; usage of main to &lt;/SPAN&gt;&lt;CODE class=""&gt;Asm_func&lt;/CODE&gt;&lt;SPAN&gt; is given by compiler in object file but assembler does not provide &lt;SPAN class=""&gt;stack&lt;/SPAN&gt; usage of &lt;/SPAN&gt;&lt;CODE class=""&gt;Asm_func&lt;/CODE&gt; routine. &lt;CODE class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN&gt; directive can be added to specify the &lt;SPAN class=""&gt;stack&lt;/SPAN&gt; usage of &lt;/SPAN&gt;&lt;CODE class=""&gt;Asm_func&lt;/CODE&gt;.&lt;/P&gt;&lt;P class=""&gt;PRM Directive specification, as shown in the following listing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="" style="text-indent: -72pt; font-weight: bold; margin-right: 0pt; margin-left: 72pt;"&gt;Listing 3.60 PRM Directive&lt;/P&gt;&lt;HR /&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;STACK&lt;/SPAN&gt;&lt;SPAN&gt;_&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;ROOT _Startup&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;END&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt; Asm_func 100;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;END&lt;HR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Nov 2016 10:56:54 GMT</pubDate>
    <dc:creator>iggi</dc:creator>
    <dc:date>2016-11-14T10:56:54Z</dc:date>
    <item>
      <title>S12Z Core Stack Size View usage</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653991#M13851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We are using Code Warrior 10.x.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And we are developing using S12Z Core.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We want to know the usage of Stack of S12Z Core.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to know how I can verify with the Code Warrior IDE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I found the stack size and memory address in the .prm / map file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;S12ZVC Stack Size View usage&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for Regrads&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2016 17:40:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653991#M13851</guid>
      <dc:creator>michaellee</dc:creator>
      <dc:date>2016-11-12T17:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z Core Stack Size View usage</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653992#M13852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The stack may be located anywhere in the 16-megabyte address space that has RAM, and can be any size up to the amount of available RAM. The stack is used to automatically save the return address for subroutine calls, the return address and CPU registers during interrupts, and for local variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is an option in project properties to see stack consumption:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/10371iBFD53B17B33C2E80/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;The &lt;SPAN class=""&gt;stack&lt;/SPAN&gt;&lt;SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;consumpt&lt;/SPAN&gt;ion&lt;/SPAN&gt;&lt;/SPAN&gt; computation is a feature of the linker that helps compute the theoretical maximal amount of &lt;/SPAN&gt;&lt;SPAN class=""&gt;stack&lt;/SPAN&gt; space an application requires at runtime. This estimation can be done for the whole application or for user-specified call sub-trees. The result of the estimation is printed out in the map file along with the corresponding call tree paths. This feature is controlled by the &lt;/SPAN&gt;&lt;CODE class=""&gt;&lt;SPAN&gt;-&lt;SPAN class=""&gt;Stack&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Consumpt&lt;/SPAN&gt;ion&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp; command line option. However, the specific information needed for this feature is issued by the compiler and encoded in the object file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4 class=""&gt;&lt;SPAN&gt;Usage of &lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt; Directive - Test Case &lt;/SPAN&gt;&lt;/H4&gt;&lt;P class=""&gt;shows a test case of usage of &lt;CODE class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt; directive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="" style="text-indent: -72pt; font-weight: bold; margin-right: 0pt; margin-left: 72pt;"&gt;&lt;SPAN&gt; Listing 3.59 Usage of &lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt; Directive &lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;Void main() {&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;Asm_func(); /* Call to an assembly function defined in test.asm*/&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;}&lt;/DIV&gt;&lt;HR /&gt;&lt;P class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Stack&lt;/SPAN&gt; usage of main to &lt;/SPAN&gt;&lt;CODE class=""&gt;Asm_func&lt;/CODE&gt;&lt;SPAN&gt; is given by compiler in object file but assembler does not provide &lt;SPAN class=""&gt;stack&lt;/SPAN&gt; usage of &lt;/SPAN&gt;&lt;CODE class=""&gt;Asm_func&lt;/CODE&gt; routine. &lt;CODE class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN&gt; directive can be added to specify the &lt;SPAN class=""&gt;stack&lt;/SPAN&gt; usage of &lt;/SPAN&gt;&lt;CODE class=""&gt;Asm_func&lt;/CODE&gt;.&lt;/P&gt;&lt;P class=""&gt;PRM Directive specification, as shown in the following listing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="" style="text-indent: -72pt; font-weight: bold; margin-right: 0pt; margin-left: 72pt;"&gt;Listing 3.60 PRM Directive&lt;/P&gt;&lt;HR /&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;STACK&lt;/SPAN&gt;&lt;SPAN&gt;_&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;ROOT _Startup&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;END&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;CONSUMPT&lt;/SPAN&gt;ION&lt;/SPAN&gt;&lt;/SPAN&gt; Asm_func 100;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" style="text-indent: 0pt; font-family: Courier; font-size: 9pt; margin-left: 0pt;"&gt;END&lt;HR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 10:56:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653992#M13852</guid>
      <dc:creator>iggi</dc:creator>
      <dc:date>2016-11-14T10:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z Core Stack Size View usage</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653993#M13853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;Hi, Thank you for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want to know where to find the Asm part. &lt;BR /&gt;&amp;nbsp; ==&amp;gt; Asm_func (); / * Call to an assembly function defined in test.asm * /&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; Is it a way to see the real of used stack size?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thank you Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 04:33:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653993#M13853</guid>
      <dc:creator>michaellee</dc:creator>
      <dc:date>2016-11-21T04:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z Core Stack Size View usage</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653994#M13854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;Hi, Thank you for your reply.&lt;/P&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want to know where to find the Asm part. &lt;BR /&gt;&amp;nbsp; ==&amp;gt; Asm_func (); / * Call to an assembly function defined in test.asm * /&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; Is it a way to see the real of used stack size?&lt;/P&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thank you Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 04:34:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653994#M13854</guid>
      <dc:creator>michaellee</dc:creator>
      <dc:date>2016-11-21T04:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z Core Stack Size View usage</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653995#M13855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That Asm_func(); is just for reference. It says it is in test.asm. So you can create test.asm and define the function inside with soem basic asm instructions.&lt;/P&gt;&lt;P&gt;Anyway, there is no tool in CW to check the real used stack size.&lt;/P&gt;&lt;P&gt;A method you can use to check it is like this:&lt;/P&gt;&lt;P&gt;1. After reset, firstly write some value like 0xAA or 0X55 to all stack size.&lt;/P&gt;&lt;P&gt;2. Then the main program should run.&lt;/P&gt;&lt;P&gt;3. After some time pause/stop the program.&lt;/P&gt;&lt;P&gt;4. See in debugger memory window at address where stack starts how far the initial values written into stack has been overwritten by main program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2016 13:47:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Core-Stack-Size-View-usage/m-p/653995#M13855</guid>
      <dc:creator>iggi</dc:creator>
      <dc:date>2016-11-21T13:47:12Z</dc:date>
    </item>
  </channel>
</rss>

