<?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: Codewarrior Code and variable relocation in CodeWarrior Development Tools</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759899#M6687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, Thank you for pointing it out.&lt;/P&gt;&lt;P&gt;I will escalate it to CW IDE development team.&lt;/P&gt;&lt;P&gt;Currently, please work out your problem with the wrokaround I provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Feb 2018 07:00:19 GMT</pubDate>
    <dc:creator>ZhangJennie</dc:creator>
    <dc:date>2018-02-24T07:00:19Z</dc:date>
    <item>
      <title>Codewarrior Code and variable relocation</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759893#M6681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using Codewarrior 10.6.4 for a target of the Coldfire V1 MCF51JE256RM. I am trying to force some RAM variables to specific addresses but I can't seem to find the correct syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the @0x00000 way like below&lt;/P&gt;&lt;P&gt;uint_8 g_recv_size@0x805A05;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;I have tried the __attribute((section (".&lt;SPAN&gt;myBufSection&lt;/SPAN&gt;"))); Like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint_8 g_recv_size __attribute__((section (".myBufSection")));&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&amp;nbsp;edited the linker file&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* placing my named section at given address: */&lt;BR /&gt; .myBufBlock 0x805A05 :&lt;BR /&gt; {&lt;BR /&gt; KEEP(*(.myBufSection)) /* keep my variable even if not referenced */&lt;BR /&gt; } &amp;gt;&amp;gt; userram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-----------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried the #pragma&amp;nbsp;&lt;/SPAN&gt;approach. This gives me "end of line expected" errors&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#pragma define_section mySectionInRAM “.myCodeInRAM” far_absolute RX&lt;BR /&gt;#pragma section mySectionInRAM begin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint_8 g_send_size;&lt;/P&gt;&lt;P&gt;#pragma section mySectionInRAM end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-----------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have tried the __delspec((section (".&lt;SPAN&gt;myBufSection&lt;/SPAN&gt;"))); Like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;__delspec&lt;/SPAN&gt;&lt;SPAN&gt;((section (".&lt;/SPAN&gt;&lt;SPAN&gt;myBufSection&lt;/SPAN&gt;&lt;SPAN&gt;")))&amp;nbsp;&lt;/SPAN&gt;uint_8 g_recv_size;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&amp;nbsp;edited the linker file&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* placing my named section at given address: */&lt;BR /&gt;.myBufBlock 0x805A05 :&lt;BR /&gt;{&lt;BR /&gt;KEEP(*(.myBufSection)) /* keep my variable even if not referenced */&lt;BR /&gt;} &amp;gt;&amp;gt; userram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the proper way to do this seemingly simple task? I want to force a variable to a specific RAM address.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 22:10:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759893#M6681</guid>
      <dc:creator>guitardenver</dc:creator>
      <dc:date>2018-02-19T22:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Code and variable relocation</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759894#M6682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So it turns out the @0x...... method does work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Example:&lt;/P&gt;&lt;P&gt;uint_8&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;A href="mailto:g_recv_size@0x805A05;"&gt;g_recv_size@0x805A05;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;This works great by itself. But I also have an assembly file that uses this variable.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;So my assembly code looks like the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;.extern _g_recv_size&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;For some reason, everything works great when I do not have the "@0x805A05" on the variable declaration. But when it is there, the compiler says the variable referenced by my ".extern _g_recv_size" is undefined. I did notice that in the .xMAP file, when the&amp;nbsp;&lt;SPAN&gt;"@0x805A05" is present, the variable in the .xMAP file is renamed "abs_g_recv_size".&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;Changing the assembly code to say:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;.extern _abs_g_recv_size&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;does not work.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;Any thoughts on what is going on here?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 19:53:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759894#M6682</guid>
      <dc:creator>guitardenver</dc:creator>
      <dc:date>2018-02-20T19:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Code and variable relocation</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759895#M6683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matt, &lt;/P&gt;&lt;P&gt;Could you please upload your demo project here?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Jennie Zhang.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2018 06:00:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759895#M6683</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2018-02-22T06:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Code and variable relocation</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759896#M6684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We did not find a solution to the problem. But we did decide to go another route that allowed us to not need to put the variables that we reference in assembly at specific addresses.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not have demo project, this is on production code that I can not upload. But to replicate the issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Define a variable in C and use the "@" symbol to specify a certain address&lt;/P&gt;&lt;P&gt;2) In an assembly code file, use the ".extern" to include it into the assembly code&lt;/P&gt;&lt;P&gt;3) Reference the variable in assembly code somewhere.&lt;/P&gt;&lt;P&gt;4) You should get errors in the build.&lt;/P&gt;&lt;P&gt;5) Remove all reference to the variable in assembly&lt;/P&gt;&lt;P&gt;6) The build should work now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe load up the USB CDC demo project and use the g_recv_size variable in the virtual_com.c as the variable like I am.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2018 14:39:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759896#M6684</guid>
      <dc:creator>guitardenver</dc:creator>
      <dc:date>2018-02-22T14:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Code and variable relocation</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759897#M6685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matt,&lt;/P&gt;&lt;P&gt;I just tested to reference c variable in assembly, there is no build error. see below screenshot&lt;/P&gt;&lt;P&gt;C source code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/18577i5D2A618354E463EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;asm source code:&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/18621iC380B9D3F2421584/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;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 06:48:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759897#M6685</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2018-02-23T06:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Code and variable relocation</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759898#M6686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code found the answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my code, the C variable is declared like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint_8 &lt;A href="mailto:g_recv_size@0x805A05;"&gt;g_recv_size@0x805A05;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the assembly extern is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.extern _g_recv_size&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "_" symbol in front of it was causing the issues. For some reason the assembly code can use the variable just fine with the "_" with no "@0x805A05". But once the&amp;nbsp;&lt;SPAN&gt;"@0x805A05" is there, you must remove the "_" for it to work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So my question is, why does it work with "_" in front of it at all? For C functionions I reference in assembly, I must put the "_" in front of it in assembly for it to work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there a reason for the "_", or is this a bug in the assembler?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 15:08:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759898#M6686</guid>
      <dc:creator>guitardenver</dc:creator>
      <dc:date>2018-02-23T15:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior Code and variable relocation</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759899#M6687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, Thank you for pointing it out.&lt;/P&gt;&lt;P&gt;I will escalate it to CW IDE development team.&lt;/P&gt;&lt;P&gt;Currently, please work out your problem with the wrokaround I provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Feb 2018 07:00:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Codewarrior-Code-and-variable-relocation/m-p/759899#M6687</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2018-02-24T07:00:19Z</dc:date>
    </item>
  </channel>
</rss>

