<?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 Software Development Kit中的主题 Re: lwip/ freertos multi-threading using KSDK2.0 and FRDM-K64F</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/lwip-freertos-multi-threading-using-KSDK2-0-and-FRDM-K64F/m-p/495864#M4640</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is indeed caused by lack of available memory, however the solution I found is different from what you described.&lt;/P&gt;&lt;P&gt;I increased the value of configTOTAL_HEAP_SIZE defined in FreeRTOSConfig.h&amp;nbsp; from ((size_t)(24 * 1024))&amp;nbsp; to&amp;nbsp; ((size_t)(40 * 1024)).&amp;nbsp; After compiling I found the section m_data had insufficient space, so I changed the linker config to increase the length of m_data to 0x00020000. I also decreased the length of m_data_2 by 0x10000.&amp;nbsp;&amp;nbsp; The application now performs as expected.&lt;/P&gt;&lt;P&gt;Checking the return value of sys_thread_new(..) is also advisable.&lt;/P&gt;&lt;P&gt;I found in the linker file that __heap_size__ is set to 0x1000 ( 4096 bytes ) and this is ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Mar 2016 04:26:52 GMT</pubDate>
    <dc:creator>chadwilliams</dc:creator>
    <dc:date>2016-03-24T04:26:52Z</dc:date>
    <item>
      <title>lwip/ freertos multi-threading using KSDK2.0 and FRDM-K64F </title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/lwip-freertos-multi-threading-using-KSDK2-0-and-FRDM-K64F/m-p/495862#M4638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tested the udp_echo demo application within KSDK2.0 on a FRDM-K64F board and find it functions as expected.&lt;/P&gt;&lt;P&gt;this demo is normally located in the FRDM-K64F SDK at&amp;nbsp; \boards\frdmk64f\demo_apps\lwip\lwip_udpecho\freertos&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am now attempting multithreading with lwip by copying the udp_echo thread to make a second udp echo thread and binding it to a different port (50002). I have been unable to get both threads responding to udp packets.&lt;/P&gt;&lt;P&gt;From what I can see by setting breakpoints, the second thread to be created does not start and I have not determined the cause. I have tried setting the second thread to a higher priority, but that didn't resolve the issue.&lt;/P&gt;&lt;P&gt;If I create udpechothread#2 before udpechothread#1 , udpechothread#1 doesn't start, and vice versa.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what I have read it should be feasible to run a second thread with lwip as the netconn layer allows it. I have not yet seen documentation or example code that would help to resolve the issue.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something I need to alter in lwip_udpecho_freertos_frdmk64f/lwip/src/include/lwip/opt.h to allow multithreading?&lt;/P&gt;&lt;P&gt;Should I consider using a different TCP/IP stack?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2016 04:38:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/lwip-freertos-multi-threading-using-KSDK2-0-and-FRDM-K64F/m-p/495862#M4638</guid>
      <dc:creator>chadwilliams</dc:creator>
      <dc:date>2016-03-22T04:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: lwip/ freertos multi-threading using KSDK2.0 and FRDM-K64F</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/lwip-freertos-multi-threading-using-KSDK2-0-and-FRDM-K64F/m-p/495863#M4639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing of this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is probably caused by small heap size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Default stack size for udpecho_thread is 3000 words. That is mean 12000 bytes. More at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.freescale.com/external-link.jspa?url=http%3A%2F%2Fwww.freertos.org%2FFAQMem.html%23StackSize" rel="nofollow" target="_blank"&gt;http://www.freertos.org/FAQMem.html#StackSize&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Heap size is defined by project symbol _heap_size_= 24576. This value is in bytes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the task is duplicated, required space for task stacks is 24000 bytes. Creation of second task fails, because there is not enough memory for stack allocation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be solved by heap size increase (_heap_size_=40000).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2016 17:01:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/lwip-freertos-multi-threading-using-KSDK2-0-and-FRDM-K64F/m-p/495863#M4639</guid>
      <dc:creator>davidjurajda</dc:creator>
      <dc:date>2016-03-22T17:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: lwip/ freertos multi-threading using KSDK2.0 and FRDM-K64F</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/lwip-freertos-multi-threading-using-KSDK2-0-and-FRDM-K64F/m-p/495864#M4640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is indeed caused by lack of available memory, however the solution I found is different from what you described.&lt;/P&gt;&lt;P&gt;I increased the value of configTOTAL_HEAP_SIZE defined in FreeRTOSConfig.h&amp;nbsp; from ((size_t)(24 * 1024))&amp;nbsp; to&amp;nbsp; ((size_t)(40 * 1024)).&amp;nbsp; After compiling I found the section m_data had insufficient space, so I changed the linker config to increase the length of m_data to 0x00020000. I also decreased the length of m_data_2 by 0x10000.&amp;nbsp;&amp;nbsp; The application now performs as expected.&lt;/P&gt;&lt;P&gt;Checking the return value of sys_thread_new(..) is also advisable.&lt;/P&gt;&lt;P&gt;I found in the linker file that __heap_size__ is set to 0x1000 ( 4096 bytes ) and this is ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2016 04:26:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/lwip-freertos-multi-threading-using-KSDK2-0-and-FRDM-K64F/m-p/495864#M4640</guid>
      <dc:creator>chadwilliams</dc:creator>
      <dc:date>2016-03-24T04:26:52Z</dc:date>
    </item>
  </channel>
</rss>

