<?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 Design StudioのトピックRe: Linker file and section declaration on KDS 3.0</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Linker-file-and-section-declaration-on-KDS-3-0/m-p/436255#M3926</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve.&lt;/P&gt;&lt;P&gt;Thank to you for your suggestion.&lt;/P&gt;&lt;P&gt;I will try in the next day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for now.&lt;/P&gt;&lt;P&gt;Claudio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Nov 2015 16:23:29 GMT</pubDate>
    <dc:creator>Claudione</dc:creator>
    <dc:date>2015-11-24T16:23:29Z</dc:date>
    <item>
      <title>Linker file and section declaration on KDS 3.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Linker-file-and-section-declaration-on-KDS-3-0/m-p/436253#M3924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good mornig.&lt;/P&gt;&lt;P&gt;I need to modify the linker file in the KDS ide.&lt;/P&gt;&lt;P&gt;Everything it's ok, but when I have to define a variables in a specific source file I have to declare the section for&lt;/P&gt;&lt;P&gt;every variables.&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;__attribute__ ((section (".UartsData")))scidata SCI0_DATA;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt; // SCI0 data&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt;__attribute__ ((section (".UartsData")))scidata SCI1_DATA;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt; // SCI1 data&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I don't use&amp;nbsp; __attribute__ ((section (".UartsData"))) in front of every variables, the same variable it's not in the segment I want.&lt;/P&gt;&lt;P&gt;Usually the segment must be declared once only at the head of the file.&lt;/P&gt;&lt;P&gt;Ther's a way to do this in KDS ?&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;Claudio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2015 16:03:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Linker-file-and-section-declaration-on-KDS-3-0/m-p/436253#M3924</guid>
      <dc:creator>Claudione</dc:creator>
      <dc:date>2015-11-23T16:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Linker file and section declaration on KDS 3.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Linker-file-and-section-declaration-on-KDS-3-0/m-p/436254#M3925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Claudio&lt;/P&gt;&lt;P&gt;I have just done something like this.&lt;/P&gt;&lt;P&gt;First, I suggest you read through this article: &lt;A href="http://mcuoneclipse.com/2014/10/06/putting-code-of-files-into-special-section-with-the-gnu-linker/" title="http://mcuoneclipse.com/2014/10/06/putting-code-of-files-into-special-section-with-the-gnu-linker/"&gt;Putting Code of Files into Special Section with the GNU Linker | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the linker file, you can specify that you want the output from a specified source file put in a specific memory location as follows:&lt;/P&gt;&lt;P&gt;This example is to store a constant array in a particular location (it's 1K in size). The array was defined on its own in a file called "boot_crc32.c"&lt;/P&gt;&lt;P&gt;1. In the linker file, MEMORY section, add a new line for the data:&lt;/P&gt;&lt;P&gt;MEMORY {&lt;/P&gt;&lt;P&gt;&amp;nbsp; m_interrupts (RX) : ORIGIN = 0x00001000, LENGTH = 0x000000C0&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt; m_boot_crc32 (R) : ORIGIN = 0x00000C00, LENGTH = 0x00000400&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; etc.&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. In the SECTIONS part of the linker file, add the following. Put it somewhere near the start before the .text section which holds the program code and data.&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* New section for the CRC32 lookup table */&lt;/P&gt;&lt;P&gt;&amp;nbsp; .boot_crc32_seg :&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; . = ALIGN(4);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;*boot_crc32.o (.rodata .rodata*)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; . = ALIGN(4);&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &amp;gt; &lt;STRONG&gt;m_boot_crc32&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;3. This tells the linker to take the compiled output from any file matching the pattern &lt;STRONG&gt;*boot_crc32.o&lt;/STRONG&gt; and place any &lt;STRONG&gt;read only data&lt;/STRONG&gt; in memory block &lt;STRONG&gt;m_boot_crc32&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If you were placing code in this segment, change .rodata to .text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. The actual definition for this data reads&lt;/P&gt;&lt;P&gt;const uint32 TableCRC32[] = { 0x00000000, 0x04c11db7, etc.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; that I did not have to put any &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;__attribute__ ((section (".boot_crc32_seg "))) statement at the front of the declaration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;It's all done in the linker file (Usually called "ProcessorExpert.ld" or similar)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;5. Finally, check placement in the map file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Hope this helps. I spent half a day working this out and testing it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Good luck&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Steve&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2015 23:59:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Linker-file-and-section-declaration-on-KDS-3-0/m-p/436254#M3925</guid>
      <dc:creator>Jiun_Yong</dc:creator>
      <dc:date>2015-11-23T23:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Linker file and section declaration on KDS 3.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Linker-file-and-section-declaration-on-KDS-3-0/m-p/436255#M3926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve.&lt;/P&gt;&lt;P&gt;Thank to you for your suggestion.&lt;/P&gt;&lt;P&gt;I will try in the next day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for now.&lt;/P&gt;&lt;P&gt;Claudio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Nov 2015 16:23:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Linker-file-and-section-declaration-on-KDS-3-0/m-p/436255#M3926</guid>
      <dc:creator>Claudione</dc:creator>
      <dc:date>2015-11-24T16:23:29Z</dc:date>
    </item>
  </channel>
</rss>

