<?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>topic Re: Function placed in RAM - assembler warnings in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Function-placed-in-RAM-assembler-warnings/m-p/887928#M9916</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sabina,&lt;/P&gt;&lt;P&gt;Sorry for my belated reply and thank you for your help.&lt;/P&gt;&lt;P&gt;It looks like that the two warnings are caused by the name of the section, i.e. &lt;STRONG&gt;.relocate_code&lt;/STRONG&gt;. If I change it to something else, e.g. .special_code, the warnings disappear (as in your project, where the section is called .myRAM - I actually recompiled your code after changing .myRAM into .relocate_code and, bang, I got the warnings).&lt;/P&gt;&lt;P&gt;Is .relocate_code a reserved nome ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Mar 2019 16:49:22 GMT</pubDate>
    <dc:creator>amprel</dc:creator>
    <dc:date>2019-03-07T16:49:22Z</dc:date>
    <item>
      <title>Function placed in RAM - assembler warnings</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Function-placed-in-RAM-assembler-warnings/m-p/887926#M9914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;I'm using KDS 3.0.0 and the micro is Kinetis K10.&amp;nbsp;I need to place a function in RAM (and of course run it from there!)&lt;/P&gt;&lt;P&gt;As suggested in the application notes &lt;EM&gt;"Relocating Code and Data Using the KDS GCC Linker File (.ld) for Kinetis"&lt;/EM&gt; and &lt;EM&gt;AN4695 "Avoiding Read-While-Write Errors When Developing In-Software&amp;nbsp;Flash Programming Applications for Kinetis and ColdFire+ MCUs"&lt;/EM&gt;, I declared my function as this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;void RAMFunc(void)&amp;nbsp;__attribute__((section(".relocate_code"), long_call));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;void __attribute__((section(".relocate_code"), long_call)) RAMFunc(void)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;// Do something&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I modified the linker file accordingly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;EM&gt;data : AT(__DATA_ROM)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; . = ALIGN(4);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; __DATA_RAM = .;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; __data_start__ = .; /* create a global symbol at data start */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; *(.data) /* .data sections */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; *(.data*) /* .data* sections */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; &lt;STRONG&gt;*(.relocate_code)&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; KEEP(*(.jcr*))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; . = ALIGN(4);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; __data_end__ = .; /* define a global symbol at data end */&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; } &amp;gt; m_data&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, when I build the project I get these two warnings in the intermediate assembler files:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Warning: setting incorrect section type for .relocate_code&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Warning: setting incorrect section attributes for .relocate_code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should I do to fix them? Whether I specify&amp;nbsp;&lt;EM&gt;long_call&lt;/EM&gt;&amp;nbsp;or not in the __attribute__ directive doesn't make any difference.&amp;nbsp;The project actually works (i.e. the function gets placed in RAM and it works as aspected), but still I'd like to understand the reason of such warnings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any&amp;nbsp;help&amp;nbsp;is appreciated.&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2019 16:44:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Function-placed-in-RAM-assembler-warnings/m-p/887926#M9914</guid>
      <dc:creator>amprel</dc:creator>
      <dc:date>2019-02-25T16:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Function placed in RAM - assembler warnings</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Function-placed-in-RAM-assembler-warnings/m-p/887927#M9915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alessandro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've gone ahead and tried to replicate the behavior you are experiencing. I tried the different examples in the document you are referring to and I'm not achieving the same warnings that you are. I am currently using KDS v 3.2.0 and the TWR-K60D100M.&lt;/P&gt;&lt;P&gt;I attached the project I created so you can use it as reference and see if you get the warnings with it.&lt;/P&gt;&lt;P&gt;Let me know the results.&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2019 22:08:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Function-placed-in-RAM-assembler-warnings/m-p/887927#M9915</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2019-03-01T22:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Function placed in RAM - assembler warnings</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Function-placed-in-RAM-assembler-warnings/m-p/887928#M9916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sabina,&lt;/P&gt;&lt;P&gt;Sorry for my belated reply and thank you for your help.&lt;/P&gt;&lt;P&gt;It looks like that the two warnings are caused by the name of the section, i.e. &lt;STRONG&gt;.relocate_code&lt;/STRONG&gt;. If I change it to something else, e.g. .special_code, the warnings disappear (as in your project, where the section is called .myRAM - I actually recompiled your code after changing .myRAM into .relocate_code and, bang, I got the warnings).&lt;/P&gt;&lt;P&gt;Is .relocate_code a reserved nome ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2019 16:49:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Function-placed-in-RAM-assembler-warnings/m-p/887928#M9916</guid>
      <dc:creator>amprel</dc:creator>
      <dc:date>2019-03-07T16:49:22Z</dc:date>
    </item>
  </channel>
</rss>

