<?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: How to make extern variable of a file stored into a section in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/How-to-make-extern-variable-of-a-file-stored-into-a-section/m-p/658430#M1192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much. I will have a try as you provide.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jan 2017 00:51:50 GMT</pubDate>
    <dc:creator>yuehedeng</dc:creator>
    <dc:date>2017-01-05T00:51:50Z</dc:date>
    <item>
      <title>How to make extern variable of a file stored into a section</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-to-make-extern-variable-of-a-file-stored-into-a-section/m-p/658428#M1190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I know there is a way to store extern variables in a section defined in ld file as below:&lt;/P&gt;&lt;P&gt;__attribute__ ((section(".ccp_database1"))) struct &amp;nbsp;stDataCache stDataRamCacheA;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;__attribute__ ((section(".ccp_database1"))) struct &amp;nbsp;stDataCache stDataRamCacheB;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it is quite&amp;nbsp;inconvenient if there are many extern variables in source files. Some compiler can do it by writing it in link file, for example TI CCS. Could&amp;nbsp;S32 IDE &amp;nbsp;also have this feature?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My platform is: S32 IDE V1.1 + MPC574x&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2017 06:27:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-to-make-extern-variable-of-a-file-stored-into-a-section/m-p/658428#M1190</guid>
      <dc:creator>yuehedeng</dc:creator>
      <dc:date>2017-01-04T06:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to make extern variable of a file stored into a section</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-to-make-extern-variable-of-a-file-stored-into-a-section/m-p/658429#M1191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can e.g. replace an attribute with &amp;nbsp;shorter alias:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="property macro token"&gt;#define CCP_DATA1 __attribute__ ((section(".ccp_database1")))&lt;/SPAN&gt;
CCP_DATA1&amp;nbsp; &lt;SPAN class="keyword token"&gt;struct&lt;/SPAN&gt;&amp;nbsp; stDataCache stDataRamCacheA&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can also explicitly assign the object files into a custom section in the linker script command file (.ld).&lt;/P&gt;&lt;P&gt;First I'd suggest to turn off &amp;nbsp;function and data sections compiler flags since they might interfere with it.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/4098iA2244EB9B54F2655/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;SECTION
{
&amp;nbsp;&amp;nbsp; .my_custom_section_consts : 
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; * source1.o (.rodata) 
&amp;nbsp;&amp;nbsp; * source2.o (.rodata) 
&amp;nbsp;&amp;nbsp; * source3.o (.rodata) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;gt; m_text

&amp;nbsp;&amp;nbsp; .my_custom_text : 
&amp;nbsp;&amp;nbsp; { INPUT_SECTION_FLAGS (SHF_PPC_VLE) 
&amp;nbsp;&amp;nbsp; * source1.o (.text) 
&amp;nbsp;&amp;nbsp; * source2.o (.text) 
&amp;nbsp;&amp;nbsp; } &amp;gt; m_text
...‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:56:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-to-make-extern-variable-of-a-file-stored-into-a-section/m-p/658429#M1191</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2020-11-02T13:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to make extern variable of a file stored into a section</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-to-make-extern-variable-of-a-file-stored-into-a-section/m-p/658430#M1192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much. I will have a try as you provide.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2017 00:51:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-to-make-extern-variable-of-a-file-stored-into-a-section/m-p/658430#M1192</guid>
      <dc:creator>yuehedeng</dc:creator>
      <dc:date>2017-01-05T00:51:50Z</dc:date>
    </item>
  </channel>
</rss>

