<?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>CodeWarrior Development ToolsのトピックMPC55XX Codewarrior Linker symbols cant be accessed...Stack paint</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPC55XX-Codewarrior-Linker-symbols-cant-be-accessed-Stack-paint/m-p/253560#M232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first post, so I hope it is clear and concise but also in the correct section.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing some development on a MPC5534, using Freescales Codewarrior compiler.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to implement a stack paint algorithm, so that I can determine my stack usage at runtime.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem lies in the fact that I cannot access the linker generated symbols that are present in the ".lcf".&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The compiler/linker error: &lt;/P&gt;&lt;P&gt;C:/Freescale/CW MCU v10.4/MCU/PA_Tools/Command_Line_Tools/mwldeppc|Linker|Error&lt;/P&gt;&lt;P&gt;&amp;gt;Small data relocation (109) in function 'vStackInit'&lt;/P&gt;&lt;P&gt;&amp;gt;in referencing file 'stack_c.obj'&lt;/P&gt;&lt;P&gt;&amp;gt;requires that symbol '_stack_addr'&lt;/P&gt;&lt;P&gt;&amp;gt;in symbol definition file 'linker generated symbol'&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function below is a simplification of my implementation so that you can get the "idea" of what I am doing.&lt;/P&gt;&lt;P&gt;There is no need to correct the algorithm (Yes, I know it is corrupting any existing values on the stack), but any help&lt;/P&gt;&lt;P&gt;as to the&amp;nbsp; syntax required to access the symbol "_stack_addr" would be greatly appreciated.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define STACK_VALUE 0x55AA55AAul&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void vStackInit( void );&lt;/P&gt;&lt;P&gt;extern uint32_t _stack_addr;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void vStackInit( void )&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned int u32IntIndex = 0u;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned int *pu32Index = (unsigned int *)(_stack_addr);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(u32IntIndex = 0ul; u32IntIndex &amp;lt; 0x8000ul; u32IntIndex++ ) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; pu32Index[u32IntIndex] = STACK_VALUE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Nov 2013 00:17:48 GMT</pubDate>
    <dc:creator>mechalec</dc:creator>
    <dc:date>2013-11-02T00:17:48Z</dc:date>
    <item>
      <title>MPC55XX Codewarrior Linker symbols cant be accessed...Stack paint</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPC55XX-Codewarrior-Linker-symbols-cant-be-accessed-Stack-paint/m-p/253560#M232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first post, so I hope it is clear and concise but also in the correct section.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing some development on a MPC5534, using Freescales Codewarrior compiler.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to implement a stack paint algorithm, so that I can determine my stack usage at runtime.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem lies in the fact that I cannot access the linker generated symbols that are present in the ".lcf".&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The compiler/linker error: &lt;/P&gt;&lt;P&gt;C:/Freescale/CW MCU v10.4/MCU/PA_Tools/Command_Line_Tools/mwldeppc|Linker|Error&lt;/P&gt;&lt;P&gt;&amp;gt;Small data relocation (109) in function 'vStackInit'&lt;/P&gt;&lt;P&gt;&amp;gt;in referencing file 'stack_c.obj'&lt;/P&gt;&lt;P&gt;&amp;gt;requires that symbol '_stack_addr'&lt;/P&gt;&lt;P&gt;&amp;gt;in symbol definition file 'linker generated symbol'&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function below is a simplification of my implementation so that you can get the "idea" of what I am doing.&lt;/P&gt;&lt;P&gt;There is no need to correct the algorithm (Yes, I know it is corrupting any existing values on the stack), but any help&lt;/P&gt;&lt;P&gt;as to the&amp;nbsp; syntax required to access the symbol "_stack_addr" would be greatly appreciated.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define STACK_VALUE 0x55AA55AAul&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void vStackInit( void );&lt;/P&gt;&lt;P&gt;extern uint32_t _stack_addr;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void vStackInit( void )&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned int u32IntIndex = 0u;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned int *pu32Index = (unsigned int *)(_stack_addr);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(u32IntIndex = 0ul; u32IntIndex &amp;lt; 0x8000ul; u32IntIndex++ ) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; pu32Index[u32IntIndex] = STACK_VALUE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Nov 2013 00:17:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPC55XX-Codewarrior-Linker-symbols-cant-be-accessed-Stack-paint/m-p/253560#M232</guid>
      <dc:creator>mechalec</dc:creator>
      <dc:date>2013-11-02T00:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: MPC55XX Codewarrior Linker symbols cant be accessed...Stack paint</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPC55XX-Codewarrior-Linker-symbols-cant-be-accessed-Stack-paint/m-p/253561#M233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scott.&lt;/P&gt;&lt;P&gt;Haven't used the MPC5534 or tool set but the Kinetis device with CW10.x can access the linker script variable with following declaration in a "C" file"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;const&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-size: 10pt;"&gt;uchar&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; __FLASHX_START_ADDR[];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Later in "C" file it is used with following way:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #005032; font-size: 10pt;"&gt;(uint_32&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) __FLASHX_START_ADDR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;David &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Nov 2013 02:37:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPC55XX-Codewarrior-Linker-symbols-cant-be-accessed-Stack-paint/m-p/253561#M233</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2013-11-02T02:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: MPC55XX Codewarrior Linker symbols cant be accessed...Stack paint</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPC55XX-Codewarrior-Linker-symbols-cant-be-accessed-Stack-paint/m-p/253562#M234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the feedback, its really helpful. I will try compile and link with that and see if it pulls the correct value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your declaration,&amp;nbsp; are you missing "extern"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Nov 2013 06:20:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPC55XX-Codewarrior-Linker-symbols-cant-be-accessed-Stack-paint/m-p/253562#M234</guid>
      <dc:creator>mechalec</dc:creator>
      <dc:date>2013-11-02T06:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: MPC55XX Codewarrior Linker symbols cant be accessed...Stack paint</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPC55XX-Codewarrior-Linker-symbols-cant-be-accessed-Stack-paint/m-p/253563#M235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for my understanding you could use the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in main.c file:&lt;/P&gt;&lt;P&gt;extern unsigned long _stack_addr[];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; volatile int i = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned long* StackStartAddr;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; StackStartAddr = _stack_addr;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in lcf file:&lt;/P&gt;&lt;P&gt;_stack_addr = ADDR(stack)+SIZEOF(stack);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can build it without problem on my side.&lt;/P&gt;&lt;P&gt;However I don't have board to test it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 13:58:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/MPC55XX-Codewarrior-Linker-symbols-cant-be-accessed-Stack-paint/m-p/253563#M235</guid>
      <dc:creator>trytohelp</dc:creator>
      <dc:date>2013-11-06T13:58:18Z</dc:date>
    </item>
  </channel>
</rss>

