<?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中的主题 K02F Linker script contains USB section</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K02F-Linker-script-contains-USB-section/m-p/505933#M5014</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm new to Kinetis (but I'm coming from LPC, so I know Cortex and Eclipse), I'm using the MK02FN64VLF10. Building my first Application with FreeRTOS, I noticed that there was very little RAM free for the RTOS HEAP (I'm using heap2.c), so I checked the linker script (MK02FN64xxx10_flash.ld):&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) The Linker script contains a section (in .bss) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(512);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_RAM_START = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . += USB_RAM_GAP;&lt;/P&gt;&lt;P&gt;with USB_RAM_GAP resulting in 0x800 (__usb_ram_size__ is not defined).&lt;/P&gt;&lt;P&gt;This section is clearly not used for the K02F (there is now USB controller!) so we can free 2K of ram.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) The linker script dived the ram in m_data and m_data_2, I understand that m_data is faster then m_data_2, but in a RTOS environment I prefer to have a HEAP as big as possible, so I think it's preferibile to have only 1 data section, even if this means that I can not decide if specific data is place in the fast RAM or not.&lt;/P&gt;&lt;P&gt;Ar there any problems when I define:&lt;/P&gt;&lt;P&gt;&amp;nbsp; m_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW)&amp;nbsp; : ORIGIN = 0x1FFFE000, LENGTH = 0x00004000&lt;/P&gt;&lt;P&gt;And remove the m_data_2 section?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Mar 2016 08:10:08 GMT</pubDate>
    <dc:creator>MartinHo</dc:creator>
    <dc:date>2016-03-28T08:10:08Z</dc:date>
    <item>
      <title>K02F Linker script contains USB section</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K02F-Linker-script-contains-USB-section/m-p/505933#M5014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm new to Kinetis (but I'm coming from LPC, so I know Cortex and Eclipse), I'm using the MK02FN64VLF10. Building my first Application with FreeRTOS, I noticed that there was very little RAM free for the RTOS HEAP (I'm using heap2.c), so I checked the linker script (MK02FN64xxx10_flash.ld):&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) The Linker script contains a section (in .bss) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(512);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_RAM_START = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . += USB_RAM_GAP;&lt;/P&gt;&lt;P&gt;with USB_RAM_GAP resulting in 0x800 (__usb_ram_size__ is not defined).&lt;/P&gt;&lt;P&gt;This section is clearly not used for the K02F (there is now USB controller!) so we can free 2K of ram.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) The linker script dived the ram in m_data and m_data_2, I understand that m_data is faster then m_data_2, but in a RTOS environment I prefer to have a HEAP as big as possible, so I think it's preferibile to have only 1 data section, even if this means that I can not decide if specific data is place in the fast RAM or not.&lt;/P&gt;&lt;P&gt;Ar there any problems when I define:&lt;/P&gt;&lt;P&gt;&amp;nbsp; m_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW)&amp;nbsp; : ORIGIN = 0x1FFFE000, LENGTH = 0x00004000&lt;/P&gt;&lt;P&gt;And remove the m_data_2 section?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2016 08:10:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K02F-Linker-script-contains-USB-section/m-p/505933#M5014</guid>
      <dc:creator>MartinHo</dc:creator>
      <dc:date>2016-03-28T08:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: K02F Linker script contains USB section</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K02F-Linker-script-contains-USB-section/m-p/505934#M5015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Answering your questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) You are correct, that section should not be present in the linker file. I have already reported this issue to the developers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) You can merge both data sections in one but you have to make sure that the processor will not attempt a misaligned access across the 0x2000_0000 boundary. I think that the following post created by our colleague Erich Styger might be helpful for you, it explains how to use the upper memory area for the RTOS heap:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can take a look to this document for a detailed explanation of how to relocate data in RAM:&lt;/P&gt;&lt;P&gt;&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;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Carlos Mendoza&lt;/P&gt;&lt;P&gt;Technical Support Engineer&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 22:47:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/K02F-Linker-script-contains-USB-section/m-p/505934#M5015</guid>
      <dc:creator>Carlos_Mendoza</dc:creator>
      <dc:date>2016-03-30T22:47:09Z</dc:date>
    </item>
  </channel>
</rss>

