<?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>MQX Software SolutionsのトピックRe: Defining location for task stacks?</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454145#M15267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the below thread and let me know if this helps!!&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-104433"&gt;Relocating Code and Data Using the KDS GCC Linker File for Kinetis&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol &lt;BR /&gt; &lt;BR /&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>Thu, 04 Jun 2015 19:47:28 GMT</pubDate>
    <dc:creator>soledad</dc:creator>
    <dc:date>2015-06-04T19:47:28Z</dc:date>
    <item>
      <title>Defining location for task stacks?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454144#M15266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was running some tests today with MQX to see how the .bss section grew with changes to the task stack.&amp;nbsp; While the results are generally predictable (at least I thought so), I was surprised when I adjusted the stack size of one of my tasks, and then I ended up with this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c:/freescale/kds_3.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: KDS3_RobotAxis.elf section `.bss' will not fit in region `m_data'&lt;/P&gt;&lt;P&gt;c:/freescale/kds_3.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: region `m_data' overflowed by 784 bytes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A quick search led me to &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/BlackNight"&gt;BlackNight&lt;/A&gt;​'s post &lt;A href="http://mcuoneclipse.com/2013/07/10/freertos-heap-with-segmented-kinetis-k-sram/" title="http://mcuoneclipse.com/2013/07/10/freertos-heap-with-segmented-kinetis-k-sram/"&gt;FreeRTOS Heap with Segmented Kinetis K SRAM | MCU on Eclipse&lt;/A&gt; .&amp;nbsp; After looking at the various Kinetis reference manuals, all three of the chips I'm using have the split memory architecture.&amp;nbsp; I guess I had been lucky up until now to not even realize this is how the processors are designed.&amp;nbsp; :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, now I'm going to need to get above the 8K lower limit of the MK22FN128FLL10.&amp;nbsp; Erich had modified his FreeRTOS component to allow the specification of the location of the heap.&amp;nbsp; I'm using the PEx MQX component, and as far as I can tell, it does not have such an option.&amp;nbsp; Looking at the linker file, I see that there is an m_data and m_data_2 defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I make the necessary changes to MQX so that my task stacks are allocated in m_data_2?&amp;nbsp; Also, are there any issues with tasks accessing data (maybe a global variable) that is defined in m_data?&amp;nbsp; I apologize for the dumb question, but this is the first time I've dealt with a split memory architecture that doesn't have the details of crossing the boundary abstracted from the user.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 21:14:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454144#M15266</guid>
      <dc:creator>dave408</dc:creator>
      <dc:date>2015-05-21T21:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Defining location for task stacks?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454145#M15267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the below thread and let me know if this helps!!&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-104433"&gt;Relocating Code and Data Using the KDS GCC Linker File for Kinetis&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol &lt;BR /&gt; &lt;BR /&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>Thu, 04 Jun 2015 19:47:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454145#M15267</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2015-06-04T19:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Defining location for task stacks?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454146#M15268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Sol, I'm checking it out now!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2015 19:52:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454146#M15268</guid>
      <dc:creator>dave408</dc:creator>
      <dc:date>2015-06-04T19:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Defining location for task stacks?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454147#M15269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And another really helpful link from FSL technical support: &lt;A href="https://community.nxp.com/thread/325267"&gt;MQX memory usage&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2015 06:00:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454147#M15269</guid>
      <dc:creator>dave408</dc:creator>
      <dc:date>2015-06-06T06:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Defining location for task stacks?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454148#M15270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/soledad"&gt;soledad&lt;/A&gt; As a quick hack, I decided to swap the memory locations for m_data and m_data_2 until I have time to understand the proper method.&amp;nbsp; While swapping works fine, modifying ProcessorExpert.ld is not a great solution because the file is always overwritten.&amp;nbsp; This means that I'd have to make the modifications every time I generate code.&amp;nbsp; I don't see an option to disable code generation for the linker file.&amp;nbsp; Is there a different way I'm supposed to specify the memory locations?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2015 21:02:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454148#M15270</guid>
      <dc:creator>dave408</dc:creator>
      <dc:date>2015-06-16T21:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Defining location for task stacks?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454149#M15271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's the actual implementation that I have used with success in my projects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing you might want to do is create a new header file that is #included in os_tasks.h.&amp;nbsp; I called mine mqxutil.h.&amp;nbsp; It looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14553231206346044" data-renderedposition="92_8_1099_288" jivemacro_uid="_14553231206346044" modifiedtitle="true"&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;* mqxutil.h&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;nbsp; Created on: Feb 11, 2016&lt;/P&gt;&lt;P&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Author: Dave&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#ifndef SHARED_MQXUTIL_H_&lt;/P&gt;&lt;P&gt;#define SHARED_MQXUTIL_H_&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;* This macro is hijacked from the KSDK and modified to put a task's stack into the m_data_2 section&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;#define OSA_TASK_DEFINE2(task, stackSize) \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __attribute__((section(".m_data_2"))) task_stack_t task##_stack[MQX_REQUIRED_STACK_SIZE(stackSize)/sizeof(task_stack_t)+1]; \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; task_handler_t task##_task_handler;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#endif /* SHARED_MQXUTIL_H_ */&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in your Generated_Code folder, in each of the .c files that corresponds to your tasks, just replace "OSA_TASK_DEFINE" with "OSA_TASK_DEFINE2".&amp;nbsp; This will relocate your task's stack into the m_data_2 segment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll need to disable code generation for your task, or the macro change will get reverted the next time you click the Generate Code button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps someone out!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Feb 2016 00:27:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Defining-location-for-task-stacks/m-p/454149#M15271</guid>
      <dc:creator>dave408</dc:creator>
      <dc:date>2016-02-13T00:27:10Z</dc:date>
    </item>
  </channel>
</rss>

