<?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: Linker error in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141155#M1365</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;OK... Is the assembler generating an object file?&lt;BR /&gt;&lt;BR /&gt;---Tom&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Jun 2006 22:27:40 GMT</pubDate>
    <dc:creator>J2MEJediMaster</dc:creator>
    <dc:date>2006-06-27T22:27:40Z</dc:date>
    <item>
      <title>Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141148#M1358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi all !&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am getting an error when compiling a C application with references to an assembly function. Asm functions are defined in .s file and declared as extern in .c file. The linker error is undefined reference to ASM function.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here are code:&lt;/DIV&gt;&lt;DIV&gt;jtag.s&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;; ================================================; Function : JTAG_Read_Bkru ; ================================================; input parameters; r0 : address of the register to read ; ================================================; output parameters; r1 : address to store the result&amp;nbsp; ; ================================================; r4 : used by TDO, TDI, TCK, TMS ; r5 : used by TDO, TDI, TCK, TMS; r6 : address bitmask ; r7 : output bitmask ; r8 : output value; r9 : scratch register; r10 : used to clear TDI&lt;STRONG&gt;JTAG_Read_Bkru&lt;/STRONG&gt; INIT_JTAG MOV r6, #1&amp;nbsp; ; init address bitMask&amp;nbsp;&amp;nbsp; MOV r7, #1&amp;nbsp; ; init output bitMask&amp;nbsp;&amp;nbsp; MOV r8, #0 MOV r10, #0...&lt;/PRE&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;jtag.h&lt;/DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;...extern void &lt;STRONG&gt;JTAG_Read_Bkru&lt;/STRONG&gt;(unsigned char address, unsigned int *data);...&lt;/PRE&gt;&lt;DIV&gt;&lt;BR /&gt;jtag.c&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;...unsigned int JTAG_Read_Debug_Status(){&amp;nbsp; unsigned int value;&amp;nbsp; //* Select ICEBreaker Scan Chain JTAG_Select_Scan_Chain(ICE_BREAKER);&amp;nbsp; //* Read the Debug Status register &lt;STRONG&gt;JTAG_Read_Bkru&lt;/STRONG&gt;(ICE_DBG_STS, &amp;amp;value); return (value &amp;amp; ICE_DBG_STS_MASK);}...&lt;/PRE&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;It seems that .s file is not passed into linker. But&amp;nbsp;.s file is in project.&lt;/DIV&gt;&lt;DIV&gt;Could you please help me with this problem ?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:41:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141148#M1358</guid>
      <dc:creator>iam</dc:creator>
      <dc:date>2020-10-29T08:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141149#M1359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am missing a little bit of context information here.&lt;/P&gt;&lt;P&gt;However, did you tell the label &lt;STRONG&gt;JTAG_Read_Bkru&lt;/STRONG&gt; should be visible&amp;nbsp;outside of the .s file?&lt;BR /&gt;Just add a&lt;/P&gt;&lt;P&gt;&amp;nbsp; xref JTAG_Read_Bkru&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;in your assembly source file.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 20:51:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141149#M1359</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-06-27T20:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141150#M1360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I'm looking at some HC12 assembly code here, and you need to use a XDEF declaration to make the function's name visible to other files. To wit:&lt;BR /&gt;&lt;BR /&gt;XDEF JTAG_Read_Bkru&lt;BR /&gt;&lt;BR /&gt;Your assembler may use the same declaration or something similar.&lt;BR /&gt;&lt;BR /&gt;---Tom&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 20:55:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141150#M1360</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2006-06-27T20:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141151#M1361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Yes, JTAG_Read_Bkru should be visible outside the .s file.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The line you proposed to add is already exist in assembly file. But with some differences. 'EXTERN' is used instead of 'xref'. (i&amp;nbsp;use Metrowerks CodeWarrior)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;iam&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 21:13:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141151#M1361</guid>
      <dc:creator>iam</dc:creator>
      <dc:date>2006-06-27T21:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141152#M1362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;OK, if EXTERN is being used in the assembly file for JTAG_Read_Bkru, that says the symbol and code are defined somewhere *other than this file*.&lt;BR /&gt;&lt;BR /&gt;What you're wanting to do is *export* the symbol of the JTAG_Read_Bkru from this file, so that the function is visible to other the files. So you either need to use the 'XDEF' or 'XREF' (Crasycat's suggestion) declaration. Replace the EXTERN in the assembly file with either of these.&lt;BR /&gt;&lt;BR /&gt;---Tom&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 21:30:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141152#M1362</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2006-06-27T21:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141153#M1363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Oups&amp;nbsp; I had a typo in my last message. In fact you HAVE to use XDEF not XREF in your assembly source file.&lt;/P&gt;&lt;P&gt;Sorry about the confusion.&lt;/P&gt;&lt;P&gt;I am not sure EXTERN is supported.&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 21:46:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141153#M1363</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-06-27T21:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141154#M1364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I have tried to use XDEF and XREF instead. The result was the same (&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 21:47:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141154#M1364</guid>
      <dc:creator>iam</dc:creator>
      <dc:date>2006-06-27T21:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141155#M1365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;OK... Is the assembler generating an object file?&lt;BR /&gt;&lt;BR /&gt;---Tom&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2006 22:27:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141155#M1365</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2006-06-27T22:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141156#M1366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Please send a whole project reproducing the trouble.&lt;/P&gt;&lt;P&gt;We will not be able to move forward without&amp;nbsp; a real project&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2006 15:09:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141156#M1366</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-06-28T15:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141157#M1367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;here is CW project reproducing error...&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;iam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2006 18:29:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141157#M1367</guid>
      <dc:creator>iam</dc:creator>
      <dc:date>2006-06-28T18:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141158#M1368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;OK I took a look at the project you have attached.&lt;BR /&gt;Apparently you are targeting an ARM core. Am I right?&lt;/P&gt;&lt;P&gt;Build tools delivered with CodeWarrior for ARM are not supported and maintained by&lt;BR /&gt;Freescale.&lt;BR /&gt;You will have to request some help from ARM. They will be able to assist you in programming with their build tools.&lt;BR /&gt;Sorry for the confusion, I did not check first which CPU you were targeting.&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2006 18:51:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141158#M1368</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-06-28T18:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141159#M1369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Yes, you are right.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you. Sorry for the lost time.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2006 19:59:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Linker-error/m-p/141159#M1369</guid>
      <dc:creator>iam</dc:creator>
      <dc:date>2006-06-28T19:59:58Z</dc:date>
    </item>
  </channel>
</rss>

