<?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>Classic/Legacy CodeWarriorのトピックRe: Place variable at specific location in data flash</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Place-variable-at-specific-location-in-data-flash/m-p/151753#M2139</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steffen,&lt;/P&gt;&lt;P&gt;This is indeed related to 56800E architecture. See the snippet from MCU DSC compiler manual (c:\Freescale\CW MCU v10.7\MCU\Help\PDF\MCU_DSC_Compiler.pdf):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/18160iFBF0A2D01F6B3BD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&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>Thu, 02 Mar 2017 15:27:26 GMT</pubDate>
    <dc:creator>stanish</dc:creator>
    <dc:date>2017-03-02T15:27:26Z</dc:date>
    <item>
      <title>Place variable at specific location in data flash</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Place-variable-at-specific-location-in-data-flash/m-p/151750#M2136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to place a char* at location 2005 in the data flash. Just to be certain about circumstances, the code is meant for the&amp;nbsp; DSC56000/E family (56F803 and 56F8357). As IDE I'm using CodeWarrior for DSC56800/E version 8.2.3 build 7.&lt;/P&gt;&lt;P&gt;To get the variable in place, on code side I tried the following:&lt;/P&gt;&lt;P&gt;In the .h file:&lt;/P&gt;&lt;PRE&gt;#pragma define_section SECDSPDESCRIPTION ".DspDescription" R&lt;/PRE&gt;&lt;P&gt;and in the .c file either:&lt;/P&gt;&lt;PRE&gt; __declspec(SECDSPDESCRIPTION) char* gl_mca_dsp_description = "CB 137 LD 144 NumAct 2";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;or:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#pragma section SECDSPDESCRIPTION begin __declspec(SECDSPDESCRIPTION) char* gl_mca_dsp_description = "CB 137 LD 144 NumAct 2";#pragma section SECDSPDESCRIPTION end&lt;/PRE&gt;&lt;P&gt;In the linker .cmd file I added the following lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;MEMORY {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .x_ReservedDescription&amp;nbsp; (R) : ORIGIN = 0x00002006, LENGTH = 0x00000020....SECTIONS {&amp;nbsp; .DspDescription : {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __START_SECDESCRIPTION = .;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.DspDescription)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __END_SECDESCRIPTION = .;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #. = ALIGN(0x1);&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;gt; .x_ReservedDescription&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But looking at the xMAP file: it doesn't map the variable to the according section.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody got any thoughts on that? Or even experiences?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would be more than thankfull!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards, Steffen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:55:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Place-variable-at-specific-location-in-data-flash/m-p/151750#M2136</guid>
      <dc:creator>ozillator</dc:creator>
      <dc:date>2020-10-29T08:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Place variable at specific location in data flash</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Place-variable-at-specific-location-in-data-flash/m-p/151751#M2137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just found out, that when declaring the section as RW in the code, it places the variable, but (mis)alligns it to 0x00002006.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In general the reason for doing this, is to access the description of the application on the DSC from bootloader and application side. Therefore this char* needs to be in a specific location known by both sides.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 23:11:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Place-variable-at-specific-location-in-data-flash/m-p/151751#M2137</guid>
      <dc:creator>ozillator</dc:creator>
      <dc:date>2012-04-04T23:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Place variable at specific location in data flash &amp; leftshift of data</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Place-variable-at-specific-location-in-data-flash/m-p/151752#M2138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to get this to an end and avoid people to stumble into the same pitfall as I did: the solution was to not define a *char instead a char[]. With the second the linker really allocates memory at the given address.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in code I used&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#pragma define_section ...#pragma section ...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and everything worked as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing I still don't get is the fact, that my precedessor uses the following line to access the char at the given location:&lt;/P&gt;&lt;PRE&gt; p_item = (char *) (ADDR_DSP_DESCRIPTION &amp;lt;&amp;lt; 1); while( *(p_item++) &amp;amp;&amp;amp; (descr_length &amp;lt; 30)) { ....&lt;/PRE&gt;&lt;P&gt;with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#define ADDR_DSP_DESCRIPTION        0x00002005L&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Why does he shift the address one to the left? Is this related to the address space of the 56F8357?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:55:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Place-variable-at-specific-location-in-data-flash/m-p/151752#M2138</guid>
      <dc:creator>ozillator</dc:creator>
      <dc:date>2020-10-29T08:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Place variable at specific location in data flash</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Place-variable-at-specific-location-in-data-flash/m-p/151753#M2139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steffen,&lt;/P&gt;&lt;P&gt;This is indeed related to 56800E architecture. See the snippet from MCU DSC compiler manual (c:\Freescale\CW MCU v10.7\MCU\Help\PDF\MCU_DSC_Compiler.pdf):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/18160iFBF0A2D01F6B3BD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&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>Thu, 02 Mar 2017 15:27:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Place-variable-at-specific-location-in-data-flash/m-p/151753#M2139</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2017-03-02T15:27:26Z</dc:date>
    </item>
  </channel>
</rss>

