<?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: vector table and the linker with M52235EVB in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/vector-table-and-the-linker-with-M52235EVB/m-p/145267#M3068</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;You were right,&lt;/DIV&gt;&lt;DIV&gt;function rd_uart1_isr is implemented in a C source file and it is not static.&lt;/DIV&gt;&lt;DIV&gt;Simply adding a '_' to the name of the function in the vector table and in the .extern declaration&lt;/DIV&gt;&lt;DIV&gt;made it work, as you told me.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I didn't find any&amp;nbsp;reference on the fact that the compiler adds the '_' internally to the function name.&lt;/DIV&gt;&lt;DIV&gt;Could you indicate me where I can find appropriate documentation?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you,&lt;/DIV&gt;&lt;DIV&gt;Valentina&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2007 22:10:12 GMT</pubDate>
    <dc:creator>vale</dc:creator>
    <dc:date>2007-02-15T22:10:12Z</dc:date>
    <item>
      <title>vector table and the linker with M52235EVB</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/vector-table-and-the-linker-with-M52235EVB/m-p/145265#M3066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hallo,&lt;/DIV&gt;&lt;DIV&gt;I experienced a behaviour of the CodeWarrior linker on my M52235EVB I can't understand.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I wrote down an ISR for my UART1 and I wanted to insert its identifier in the vector table at the proper entry.&lt;/DIV&gt;&lt;DIV&gt;Find below my first attempt in file MCF52235_vectors.s:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/*&lt;BR /&gt;&amp;nbsp;* File:&amp;nbsp;vectors.s&lt;BR /&gt;&amp;nbsp;* Purpose:&amp;nbsp;MCF52235 vector table&lt;BR /&gt;&amp;nbsp;*/&lt;/DIV&gt;&lt;DIV&gt;#ifdef __GNUC__ /* { */&lt;BR /&gt;#define sr %sr&lt;BR /&gt;#define _ethernet_handler ethernet_handler&lt;BR /&gt;#define _irq_handler&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; irq_handler&lt;BR /&gt;#define _timer_handler&amp;nbsp;&amp;nbsp;&amp;nbsp; timer_handler&lt;/DIV&gt;&lt;DIV&gt;#endif /* } __GNUC__ */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;.global VECTOR_TABLE&lt;BR /&gt;&amp;nbsp;.global _VECTOR_TABLE&lt;BR /&gt;&amp;nbsp;.global start&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;.extern ___SP_INIT&lt;BR /&gt;&amp;nbsp;.extern _asm_startmeup&lt;BR /&gt;&amp;nbsp;.extern _asm_exception_handler&lt;BR /&gt;&amp;nbsp;.extern _irq_handler&lt;BR /&gt;&amp;nbsp;.extern _ethernet_handler&lt;BR /&gt;&amp;nbsp;.extern _timer_handler&lt;BR /&gt;&amp;nbsp;.extern _ephy_handler&lt;BR /&gt;&amp;nbsp;.extern _irq1_handler&lt;BR /&gt;&amp;nbsp;.extern _irq4_handler&lt;BR /&gt;&amp;nbsp;.extern _irq7_handler&lt;BR /&gt;&amp;nbsp;.extern _irq11_handler&lt;BR /&gt;&amp;nbsp;&lt;SPAN style="color: #FF0033;"&gt;.extern rd_uart1_isr&lt;BR /&gt;&lt;/SPAN&gt;&amp;nbsp;.text&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;... etc....etc&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;vector4C:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;vector4D:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;/*vector4E:&amp;nbsp;.long&amp;nbsp;_irq_handler*/&lt;BR /&gt;&lt;SPAN style="color: #FF0033;"&gt;vector4E:&amp;nbsp;.long&amp;nbsp;rd_uart1_isr&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* UART1 ISR */&lt;BR /&gt;vector4F:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;vector50:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;...etc...etc&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When I try to compile, I get this message back:&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Link Error&amp;nbsp;&amp;nbsp; : Undefined : "rd_uart1_isr"&lt;BR /&gt;Referenced from "start" in mcf52235_vectors.s&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Link failed.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I next tried this&amp;nbsp;different solution:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;/*&lt;BR /&gt;&amp;nbsp;* File:&amp;nbsp;vectors.s&lt;BR /&gt;&amp;nbsp;* Purpose:&amp;nbsp;MCF52235 vector table&lt;BR /&gt;&amp;nbsp;*/&lt;/DIV&gt;&lt;DIV&gt;#ifdef __GNUC__ /* { */&lt;BR /&gt;#define sr %sr&lt;BR /&gt;#define _ethernet_handler ethernet_handler&lt;BR /&gt;#define _irq_handler&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; irq_handler&lt;BR /&gt;#define _timer_handler&amp;nbsp;&amp;nbsp;&amp;nbsp; timer_handler&lt;BR /&gt;&lt;SPAN style="color: #FF0033;"&gt;#define _rd_uart1_isr&amp;nbsp;&amp;nbsp; rd_uart1_isr&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;#endif /* } __GNUC__ */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;.global VECTOR_TABLE&lt;BR /&gt;&amp;nbsp;.global _VECTOR_TABLE&lt;BR /&gt;&amp;nbsp;.global start&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;.extern ___SP_INIT&lt;BR /&gt;&amp;nbsp;.extern _asm_startmeup&lt;BR /&gt;&amp;nbsp;.extern _asm_exception_handler&lt;BR /&gt;&amp;nbsp;.extern _irq_handler&lt;BR /&gt;&amp;nbsp;.extern _ethernet_handler&lt;BR /&gt;&amp;nbsp;.extern _timer_handler&lt;BR /&gt;&amp;nbsp;.extern _ephy_handler&lt;BR /&gt;&amp;nbsp;.extern _irq1_handler&lt;BR /&gt;&amp;nbsp;.extern _irq4_handler&lt;BR /&gt;&amp;nbsp;.extern _irq7_handler&lt;BR /&gt;&amp;nbsp;.extern _irq11_handler&lt;BR /&gt;&lt;SPAN style="color: #FF0033;"&gt;&amp;nbsp;.extern _rd_uart1_isr&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;.text&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;...etc...etc&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;vector48:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;vector49:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;vector4A:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;vector4B:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;vector4C:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;vector4D:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;/*vector4E:&amp;nbsp;.long&amp;nbsp;_irq_handler*/&lt;BR /&gt;&lt;SPAN style="color: #FF0033;"&gt;vector4E:&amp;nbsp;.long&amp;nbsp;_rd_uart1_isr&lt;/SPAN&gt;&amp;nbsp;/* UART1 ISR */&lt;BR /&gt;vector4F:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;vector50:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;vector51:&amp;nbsp;.long&amp;nbsp;_irq_handler&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;and it worked.&lt;/DIV&gt;&lt;DIV&gt;I don't understand this behaviour....the preprocessor should do his work before linking....&lt;/DIV&gt;&lt;DIV&gt;what happens different this time with respect to the previous time?&lt;/DIV&gt;&lt;DIV&gt;Thank you for any help.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Vale&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 18:30:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/vector-table-and-the-linker-with-M52235EVB/m-p/145265#M3066</guid>
      <dc:creator>vale</dc:creator>
      <dc:date>2007-02-15T18:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: vector table and the linker with M52235EVB</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/vector-table-and-the-linker-with-M52235EVB/m-p/145266#M3067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I assume rd_uart1_isr is implemented in a C source file. Am I right?&lt;/DIV&gt;&lt;DIV&gt;If&amp;nbsp; this is the case, make sure the function is not static.&lt;/DIV&gt;&lt;DIV&gt;Then the compiler add a _ prefix to the function name internally.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So your assembly source file should look like:&lt;/DIV&gt;.extern _rd_uart1_isr&lt;BR /&gt;&amp;nbsp;.text&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;... etc....etc&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;vector4C: .long _irq_handler&lt;BR /&gt;vector4D: .long _irq_handler&lt;BR /&gt;/*vector4E: .long _irq_handler*/&lt;BR /&gt;vector4E: .long _rd_uart1_isr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* UART1 ISR */&lt;BR /&gt;vector4F: .long _irq_handler&lt;BR /&gt;vector50: .long _irq_handler &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 20:05:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/vector-table-and-the-linker-with-M52235EVB/m-p/145266#M3067</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2007-02-15T20:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: vector table and the linker with M52235EVB</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/vector-table-and-the-linker-with-M52235EVB/m-p/145267#M3068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;You were right,&lt;/DIV&gt;&lt;DIV&gt;function rd_uart1_isr is implemented in a C source file and it is not static.&lt;/DIV&gt;&lt;DIV&gt;Simply adding a '_' to the name of the function in the vector table and in the .extern declaration&lt;/DIV&gt;&lt;DIV&gt;made it work, as you told me.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I didn't find any&amp;nbsp;reference on the fact that the compiler adds the '_' internally to the function name.&lt;/DIV&gt;&lt;DIV&gt;Could you indicate me where I can find appropriate documentation?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you,&lt;/DIV&gt;&lt;DIV&gt;Valentina&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 22:10:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/vector-table-and-the-linker-with-M52235EVB/m-p/145267#M3068</guid>
      <dc:creator>vale</dc:creator>
      <dc:date>2007-02-15T22:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: vector table and the linker with M52235EVB</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/vector-table-and-the-linker-with-M52235EVB/m-p/145268#M3069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I do not think this is documented anywhere &lt;IMG alt=":smileyindifferent:" class="emoticon emoticon-smileyindifferent" id="smileyindifferent" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-indifferent.gif" title="Smiley Indifferent" /&gt;.&lt;/DIV&gt;&lt;DIV&gt;Unfortunately.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 22:45:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/vector-table-and-the-linker-with-M52235EVB/m-p/145268#M3069</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2007-02-15T22:45:51Z</dc:date>
    </item>
  </channel>
</rss>

