<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Error L127 &amp;amp; L128</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/18486/error-l127-l128</link><description> I am getting the following error messages when compiling. I want to programm a can bus for the c167 using the service routines from the infineon homepage. Can anyone help me to solve the L127 &amp;amp; L128 errors. 
 
It would be nice if i get a detailed solution</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Error L127 &amp; L128</title><link>https://community.arm.com/thread/123072?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2005 06:44:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a01de013-3cca-4f12-a336-00b516242dc1</guid><dc:creator>markus hermans</dc:creator><description>&lt;p&gt;thanks for the information&lt;br /&gt;
&lt;br /&gt;
i solved my problems by changing the _blfd syntax into _blfd_ and including the intrins.h into my c file.&lt;br /&gt;
&lt;br /&gt;
today i tested my own file with Canalyser and it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error L127 &amp; L128</title><link>https://community.arm.com/thread/111817?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2005 19:21:15 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:fad27081-f0ce-4c36-afa7-795a770e5e5f</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;pre&gt;INCAN16X.C(29): warning C2: &amp;#39;GLOBAL&amp;#39;: unknown #pragma/control, line ignored
INCAN16X.C(40): warning C2: &amp;#39;PUBLIC&amp;#39;: unknown #pragma/control, line ignored
INCAN16X.C(51): warning C140: &amp;#39;_bfld&amp;#39; undefined; assuming &amp;#39;extern int _bfld()&amp;#39;&lt;/pre&gt;
You need to sort these warnings out &lt;b&gt;first!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Given that you have compiler warnings about undefined identifiers, and things called &amp;quot;PUBLIC&amp;quot; and &amp;quot;GLOBAL&amp;quot;, you should not be in the least bit surprised that you subsequently get Linker problems with unresolved externals!&lt;br /&gt;
&lt;br /&gt;
As Hans-Bernhard has already pointed out, you seem to be using code written specifically for a different compiler - and this is exactly the sort of problem you&amp;#39;re going to get if you don&amp;#39;t pay attention to the implementation-specific details!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error L127 &amp; L128</title><link>https://community.arm.com/thread/97684?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2005 10:11:30 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cafcf85b-3b4f-438e-a9ac-826758b74343</guid><dc:creator>HansBernhard Broeker</dc:creator><description>&lt;p&gt;OK, so how about instead of just throwing it blindly at whoever might be prepared to catch it, actually &lt;b&gt;read&lt;/b&gt; that file?  You might&lt;br /&gt;
come across this line:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt; * Compiler used: BSO/Tasking C166 *&lt;/pre&gt;
&lt;br /&gt;
Still wondering why this doesn&amp;#39;t work in Keil C166?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error L127 &amp; L128</title><link>https://community.arm.com/thread/73680?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2005 09:29:40 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a8deae94-9c81-4f38-9a8e-3e6558e0164e</guid><dc:creator>adhgfhdf asdasgfh</dc:creator><description>&lt;p&gt;/* ----------------------------------------- header: ----------------*/&lt;br /&gt;
/*********************************************************************&lt;br /&gt;
 * Program name:	&amp;quot;INCAN16X.C&amp;quot;                                 *&lt;br /&gt;
 * Compiler used:	BSO/Tasking C166                             *&lt;br /&gt;
 * Task:		Source File for procedure can_init_16x       *&lt;br /&gt;
 *			belonging to Siemens ApNote AP2922           *&lt;br /&gt;
 *			&amp;quot;&amp;#39;C&amp;#39; CAN Driver Routines for the C166 family&amp;quot;*&lt;br /&gt;
 *                                                                   *&lt;br /&gt;
 * Last modifications:	April 28nd 1997                              *&lt;br /&gt;
 * Version:		1.0                                          *&lt;br /&gt;
 * Authors:		Axel Wolf,  SCI Cupertino                    *&lt;br /&gt;
 *			Dr. Jens Barrenscheen, HL MC PD, Munich      *&lt;br /&gt;
 *********************************************************************/&lt;br /&gt;
/* ----------------------------------- include files: -------------- */&lt;br /&gt;
#include &amp;lt;REG167.H&amp;gt;         /* register definitions C167             */&lt;br /&gt;
#include &amp;lt;CANR_16X.H&amp;gt;       /* CAN control register definitions      */&lt;br /&gt;
&lt;br /&gt;
#define BTR_VALUE_50KBAUD	0x7aC9&lt;br /&gt;
#define BTR_VALUE_125KBAUD	0x7aC3&lt;br /&gt;
#define BTR_VALUE_250KBAUD	0x7aC1&lt;br /&gt;
#define BTR_VALUE_500KBAUD	0x7aC0&lt;br /&gt;
#define BTR_VALUE_1MBAUD	0x25c0&lt;br /&gt;
/* ----------------------------------- externals, prototypes: ------ */&lt;br /&gt;
void init_can_16x(unsigned int baud_rate, unsigned char eie,&lt;br /&gt;
	unsigned char sie, unsigned char ie);&lt;br /&gt;
	/* Initialization of CAN-Module: (baud_rate, eie, sie, ie) */&lt;br /&gt;
/* ----------------------------------- PEC, Register: -------------- */&lt;br /&gt;
/* ----------------------------------- global bit/byte/word data: -- */&lt;br /&gt;
#pragma global&lt;br /&gt;
&lt;br /&gt;
/* C167CR variables: */&lt;br /&gt;
unsigned int *id_ptr_16x[16];		/* pointer to message id&amp;#39;s (UAReg) */&lt;br /&gt;
unsigned char *db0_ptr_16x[16];		/* pointer to &amp;#39;databyte 0&amp;#39;s */&lt;br /&gt;
unsigned int *msgctrl_ptr_16x[16];	/* pointer to msg. contrl. regs */&lt;br /&gt;
unsigned char *msgconf_ptr_16x[16];	/* pointer to msg. conf. regs */&lt;br /&gt;
unsigned char dir_bit_16x[16];		/* DIR bits MO 1...15 */&lt;br /&gt;
unsigned char xtd_bit_16x[16];		/* XTD bits MO 1...15 */&lt;br /&gt;
unsigned char dlc_16x[16];		/* data byte lengths MO 1...15 */&lt;br /&gt;
&lt;br /&gt;
#pragma public&lt;br /&gt;
/* ----------------------------------- code ------------------------ */&lt;br /&gt;
void init_can_16x(unsigned int baud_rate, unsigned char eie,&lt;br /&gt;
	unsigned char sie, unsigned char ie)&lt;br /&gt;
	/* Initialization of CAN-Module: (baud rate, eie, sie, ie) */&lt;br /&gt;
{&lt;br /&gt;
   /* -------------------------------- local  byte/word/bit data: -- */&lt;br /&gt;
	unsigned char i, n;&lt;br /&gt;
	unsigned char *dummy_dbptr;&lt;br /&gt;
   /* -------------------------------- program: -------------------- */&lt;br /&gt;
	/* Initialization PORT4 (CAN) (P4.6 to output; P4.5 to input): */&lt;br /&gt;
	_bfld (P4, 0x0060, 0x0060);&lt;br /&gt;
	_bfld (DP4, 0x0060, 0x0040);&lt;br /&gt;
&lt;br /&gt;
	/* Load C167 pointers: */&lt;br /&gt;
	for (i=1;i&amp;lt;16;i++)&lt;br /&gt;
	{&lt;br /&gt;
	   db0_ptr_16x[i] = (unsigned char *)(0xef07+i*16);&lt;br /&gt;
			/* set pointers to data bytes 0 of MO 1..15 */&lt;br /&gt;
	   id_ptr_16x[i] = (unsigned int *)(0xef02+i*16);&lt;br /&gt;
			/* set pointers to id&amp;#39;s of MO 1..15 (UARs) */&lt;br /&gt;
	   msgconf_ptr_16x[i] = (unsigned char *)(0xef06+i*16);&lt;br /&gt;
		/* set pointers to Message Conf. Registers of MO 1..15 */&lt;br /&gt;
	   msgctrl_ptr_16x[i] = (unsigned int *)(0xef00+i*16);&lt;br /&gt;
		/* set pointers to Message Control Registers of MO 1..15 */&lt;br /&gt;
	   dir_bit_16x[i] = 0;		/* clear DIR bit array */&lt;br /&gt;
	   xtd_bit_16x[i] = 0;		/* clear XTD bit array */&lt;br /&gt;
	   dlc_16x[i] = 0;		/* clear data length code array */&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/* Load General CAN-Registers: */&lt;br /&gt;
	CR=0x41;	/* set CCE and INIT in Control Register (EF00h) */&lt;br /&gt;
	SR=0x00;	/* Clear Status Partition (EF01h) */&lt;br /&gt;
&lt;br /&gt;
	switch (baud_rate)&lt;br /&gt;
	{&lt;br /&gt;
	   case 50:	BTR=BTR_VALUE_50KBAUD;&lt;br /&gt;
			break;&lt;br /&gt;
	   case 125:	BTR=BTR_VALUE_125KBAUD;&lt;br /&gt;
			break;&lt;br /&gt;
	   case 250:	BTR=BTR_VALUE_250KBAUD;&lt;br /&gt;
			break;&lt;br /&gt;
	   case 500:	BTR=BTR_VALUE_500KBAUD;&lt;br /&gt;
			break;&lt;br /&gt;
	   case 1000:	BTR=BTR_VALUE_1MBAUD;&lt;br /&gt;
			break;&lt;br /&gt;
	   default:	BTR=BTR_VALUE_500KBAUD;&lt;br /&gt;
			break;&lt;br /&gt;
		/* 0 1 1 1  1 0 1 0  1 1 0 0  0 0 0 0 = 500 kBit/s @ 20MHz  */&lt;br /&gt;
		/* - TSEG2   TSEG1   SJW|&amp;lt;--  BRP --&amp;gt;|                      */&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	GMS=0xe0ff;	/* Global Mask Short (EF06h) */&lt;br /&gt;
			/* each bit of standard ID must match to store mess. */&lt;br /&gt;
&lt;br /&gt;
	UGML=0xffff;	/* Upper Global Mask Long (EF08h) */&lt;br /&gt;
	LGML=0xf8ff;	/* Lower Global Mask Long (EF0Ah) */&lt;br /&gt;
			/* each bit of extended ID must match to store mess. */&lt;br /&gt;
&lt;br /&gt;
	UMLM=0x0000;	/* Upper Mask of Last Message (EF0Ch) */&lt;br /&gt;
	LMLM=0x0000;	/* Lower Mask of Last Message (EF0Eh) */&lt;br /&gt;
			/* every message into MO 15 (Basic CAN Feature)*/&lt;br /&gt;
&lt;br /&gt;
	/* reset all elements incl MSGVAL in all Message Object Ctrl. Reg.: */&lt;br /&gt;
	for (i=1;i&amp;lt;16;i++) *msgctrl_ptr_16x[i] = 0x5555;&lt;br /&gt;
&lt;br /&gt;
	/* reset all data bytes in all Message Objects: */&lt;br /&gt;
	for (i=1;i&amp;lt;16;i++)&lt;br /&gt;
	{&lt;br /&gt;
	   dummy_dbptr=db0_ptr_16x[i];&lt;br /&gt;
	   for (n=0;n&amp;lt;8;n++) *dummy_dbptr++ = 0x00;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/* end initialization (CCE=0, INIT=0); Interrupts EIE, SIE, IE=user: */&lt;br /&gt;
	CR = (0x00 | (eie&amp;lt;&amp;lt;3) | (sie&amp;lt;&amp;lt;2) | (ie&amp;lt;&amp;lt;1));&lt;br /&gt;
}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error L127 &amp; L128</title><link>https://community.arm.com/thread/45155?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2005 09:18:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:752e904f-ef54-4d70-93bb-7719023b52c9</guid><dc:creator>Andy Curda</dc:creator><description>&lt;p&gt;Markus,&lt;br /&gt;
&lt;br /&gt;
Can you post contents on INCAN16X.C and INCAN16X.h (is this header included in files where functions from INCAN16X.C are called?)?&lt;br /&gt;
Looks like the source of your errors  (as well as some of the warnings) are in there somewhere.&lt;br /&gt;
Dont know about C166 compiler (I only used C51 so far), but if I remember right, using _ before variable names can cause problems (I think because it&amp;#39;s ignored but that&amp;#39;s relying on my own memory banks).  If that is part of your code, you may want to changed it.  If it&amp;#39;s part of a CANned routine though, I don&amp;#39;t know&lt;br /&gt;
&lt;br /&gt;
Andy&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error L127 &amp; L128</title><link>https://community.arm.com/thread/45152?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2005 09:13:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:08e07743-a30b-4c17-97fa-c8555b4dbe04</guid><dc:creator>Keil Software Support Intl.</dc:creator><description>&lt;p&gt;&lt;b&gt;_bfld&lt;/b&gt; looks like a typo in your source code. Maybe you wanted to use &lt;b&gt;_bfld_&lt;b&gt; (see: &lt;a href="http://www.keil.com/support/man/docs/c166/c166__bfld_.htm"&gt;http://www.keil.com/support/man/docs/c166/c166__bfld_.htm&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
Reinhard&lt;/b&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>