<?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>Kinetis MicrocontrollersのトピックRe: How to increase stack size on MK22FX512AVLQ12</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666511#M40965</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alexander,&lt;/P&gt;&lt;P&gt;- Sorry for my mistake of last reply . We can start from 0x1FFF0000, it isn't over boundary.&lt;/P&gt;&lt;P&gt;SRAM_L =0x1FFF0000&amp;nbsp;&amp;nbsp; to&amp;nbsp; 0x1FFFFFFF&lt;/P&gt;&lt;P&gt;- And I made a project about your chip on KDSv3.2 , configure the stack and heap size all to 0x800. there is no error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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/21279i9D8506FB11BA1F72/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;Please take a screenshot about your error when setting 0x800 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Jun 2017 09:04:24 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2017-06-01T09:04:24Z</dc:date>
    <item>
      <title>How to increase stack size on MK22FX512AVLQ12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666508#M40962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Environment: KDS 3.2.0,&amp;nbsp;MK22FX512AVLQ12 MCU, using Processor Expert&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hitting a stack overflow using a&amp;nbsp;MK22FX512AVLQ12 device. I'm having trouble using the full amount of SRAM indicated in the&amp;nbsp;datasheet.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From&amp;nbsp;the datasheet for&amp;nbsp;&lt;SPAN&gt;MK22FX512AVLQ12, this device should have 128kb SRAM but I'm getting linker errors when I attempt to set stack and heap to 0x0800 each:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;c:/freescale/kds_v3/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: [xxxx].elf section `._user_heap_stack' will not fit in region `m_data'&lt;BR /&gt;c:/freescale/kds_v3/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: region `m_data' overflowed by 1844 bytes&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;Any idea why this would be? 0x0800 =&amp;nbsp;2048 = 2kb so there should be plenty of room to spare.&amp;nbsp;&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;My linker file is attached for reference.&amp;nbsp;&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;-----&lt;/SPAN&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;SPAN&gt;----------&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;-----&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;-----&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;SPAN&gt;-----&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Update: I was able to fix the issue by disabling the "generate linker file" option and setting the start of m_data to&amp;nbsp;0x1FFF0000. I'm interested to know why&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;PE won't let me adjust this variable in the options for the Cpu component. It gives an error: "ERROR: There is no access to memory from 0x1FFF0000 to 0x1FFF7FFF". This seems to be wrong since the program executes correctly using this configuration.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337379"&gt;ProcessorExpert.ld.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2017 22:19:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666508#M40962</guid>
      <dc:creator>asfarley</dc:creator>
      <dc:date>2017-05-29T22:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase stack size on MK22FX512AVLQ12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666509#M40963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="36474" data-username="asfarley" href="https://community.nxp.com/people/asfarley" rel="nofollow noopener noreferrer" target="_blank"&gt;Alexander&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;1. Please check the Reference manual for your chip, The on-chip SRAM is split into two equally-sized logical arrays, SRAM_L and SRAM_U.&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;• SRAM_L &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;0x2000_0000–&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SRAM_size&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; to 0x1FFF_FFFF
• SRAM_U &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; 0x2000_0000 to &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;0x2000_0000&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SRAM_size&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for the chip of &amp;nbsp;&lt;SPAN&gt;MK22FX512AVLQ12&lt;/SPAN&gt; :&lt;/P&gt;&lt;P&gt;SRAM_L =0x1FFF0000&amp;nbsp;&amp;nbsp; to&amp;nbsp; 0x1FFFFFFF&lt;/P&gt;&lt;P&gt;SRAM_U =0x20000000&amp;nbsp;&amp;nbsp; to&amp;nbsp; 0x2000FFFF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. "region `m_data' overflowed by 1844 bytes" meaning in the region of 'm_data', the data overflowed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1844 bytes, not just occupied 1844 bytes. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. You can put some data into 'm_data_20000000' region to have try.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope it helps&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 06:35:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666509#M40963</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2017-05-31T06:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase stack size on MK22FX512AVLQ12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666510#M40964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Alice.&amp;nbsp;I see what you mean about the memory boundaries - it's strange that the application seems to run correctly when I set the m_data ORIGIN to 0x1FFF0000 if that's out-of-range for SRAM_U.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, my main question is why the PE CPU component doesn't seem to be handling increases in SRAM size correctly. I understand that the overflow message means that the region overflowed by 1844 bytes, not that it was 1844 bytes in total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Knowing that the device has 128kb of SRAM (or even 64kb if we're just talking about one of the two regions), it should be possible to bump up the stack or heap sizes to something significantly larger than 0x0800. However, I start getting linker errors if I set the heap and stack sizes to 0x0800 each. This is why I was asking: why can't I allocate a 2kb heap and stack using the 128kb of available SRAM, using the PE component?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 15:37:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666510#M40964</guid>
      <dc:creator>asfarley</dc:creator>
      <dc:date>2017-05-31T15:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase stack size on MK22FX512AVLQ12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666511#M40965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alexander,&lt;/P&gt;&lt;P&gt;- Sorry for my mistake of last reply . We can start from 0x1FFF0000, it isn't over boundary.&lt;/P&gt;&lt;P&gt;SRAM_L =0x1FFF0000&amp;nbsp;&amp;nbsp; to&amp;nbsp; 0x1FFFFFFF&lt;/P&gt;&lt;P&gt;- And I made a project about your chip on KDSv3.2 , configure the stack and heap size all to 0x800. there is no error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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/21279i9D8506FB11BA1F72/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;Please take a screenshot about your error when setting 0x800 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 09:04:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666511#M40965</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2017-06-01T09:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase stack size on MK22FX512AVLQ12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666512#M40966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm - it's been a while but somehow I've worked around this issue and I'm not getting the error anymore. I'll post back if this comes up again. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 20:36:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-increase-stack-size-on-MK22FX512AVLQ12/m-p/666512#M40966</guid>
      <dc:creator>asfarley</dc:creator>
      <dc:date>2017-07-10T20:36:36Z</dc:date>
    </item>
  </channel>
</rss>

