<?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 Initialisation from PE occurs compiler faild in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155008#M3935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use for the moment CW 6.2. Processor expert has I also. If I now the initialization of the vectors table for the interruptslet make from the PE,&amp;nbsp; there is the following error:&lt;/P&gt;&lt;P&gt;Error : C1822: Type mismatch (expected 'void (*near)()', fiven 'unsigned int')&lt;/P&gt;&lt;P&gt;The code ist the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#ifndef UNASSIGNED_ISR&lt;BR /&gt;&amp;nbsp; #define UNASSIGNED_ISR 0xFFFF&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* unassigned interrupt service routine */&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;void (* near const _vect[])() @0xFFCE = { /* Interrupt vector table */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Intervall1sec,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; =&amp;gt; &amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Here is the first faild, all UNASSIGNED_ISR causes a faild&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the MC9S08QE8CWJ. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Feb 2009 17:28:34 GMT</pubDate>
    <dc:creator>admin</dc:creator>
    <dc:date>2009-02-20T17:28:34Z</dc:date>
    <item>
      <title>Initialisation from PE occurs compiler faild</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155008#M3935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use for the moment CW 6.2. Processor expert has I also. If I now the initialization of the vectors table for the interruptslet make from the PE,&amp;nbsp; there is the following error:&lt;/P&gt;&lt;P&gt;Error : C1822: Type mismatch (expected 'void (*near)()', fiven 'unsigned int')&lt;/P&gt;&lt;P&gt;The code ist the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#ifndef UNASSIGNED_ISR&lt;BR /&gt;&amp;nbsp; #define UNASSIGNED_ISR 0xFFFF&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* unassigned interrupt service routine */&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;void (* near const _vect[])() @0xFFCE = { /* Interrupt vector table */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Intervall1sec,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; =&amp;gt; &amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Here is the first faild, all UNASSIGNED_ISR causes a faild&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNASSIGNED_ISR,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the MC9S08QE8CWJ. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2009 17:28:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155008#M3935</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2009-02-20T17:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Initialisation from PE occurs compiler faild</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155009#M3936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have not reproduced such behaviour. Could you please provide us a project demonstrating the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards&lt;BR /&gt;Vojtech Filip&lt;BR /&gt;Processor Expert Support Team&lt;BR /&gt;UNIS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 17:39:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155009#M3936</guid>
      <dc:creator>ProcessorExpert</dc:creator>
      <dc:date>2009-02-23T17:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Initialisation from PE occurs compiler faild</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155010#M3937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the project which the error has.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regrads&lt;/P&gt;&lt;P&gt;PEBeginner&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by PEBeginner on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-02-23&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;11:20 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 19:19:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155010#M3937</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2009-02-23T19:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Initialisation from PE occurs compiler faild</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155011#M3938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Indeed that code shouldn't compile. ISO C does not allow implicit typecasting from integers to pointers. If PE generated that code, you should demand that they fix it. This should solve the problem:&lt;BR /&gt;&lt;BR /&gt;UNASSIGNED_ISR (void(* near const)())0xFFFF&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;However, that whole code is needlessly ugly and non-portable. And you shouldn't need to use the "near" keyword. Is there any use for "far" memory on the S08? Why not write the code fully ISO C compatible and portable instead?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In the .prm file:&lt;BR /&gt;&lt;BR /&gt;SECTIONS&lt;BR /&gt;VECTOR_TABLE = READ_ONLY 0xFFCE TO 0xFFFF;&lt;BR /&gt;END&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PLACEMENT&lt;BR /&gt;VECTORS INTO VECTOR_TABLE&lt;BR /&gt;END&lt;BR /&gt;&lt;BR /&gt;ENTRIES&lt;BR /&gt;vector_table /* force linking */&lt;BR /&gt;END&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/* vector_table.h */&lt;BR /&gt;&lt;BR /&gt;#define DEFAULT_VECTOR _Startup&lt;BR /&gt;&lt;BR /&gt;#pragma CONST_SEG VECTORS&lt;BR /&gt;extern void (*const vector_table[])(void);&lt;BR /&gt;#pragma CONST_SEG DEFAULT&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/* vector_table.c */&lt;BR /&gt;#pragma CONST_SEG VECTORS&lt;BR /&gt;void (* const vector_table[])(void) = {&lt;BR /&gt;{&lt;BR /&gt;DEFAULT_VECTOR,&lt;BR /&gt;...&lt;BR /&gt;};&lt;BR /&gt;#pragma CONST_SEG DEFAULT&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 23:41:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155011#M3938</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2009-02-23T23:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Initialisation from PE occurs compiler faild</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155012#M3939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; However, that whole code is needlessly ugly and non-portable.&lt;/P&gt;&lt;P&gt;&amp;gt; And you shouldn't need to use the "near" keyword. Is there any use for "far" memory on the S08?&lt;/P&gt;&lt;P&gt;&amp;gt;Why not write the code fully ISO C compatible and portable instead?&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The QE family did introduce a CALL instruction with 3 byte banked addresses. So&lt;/P&gt;&lt;P&gt;in the banked memory model (which is not applicable for all S08/HC08's) the __near is required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as portability is concerned, I'm not sure I like this version better. Obviously vector initialization is for a particular architecture, even for a particular derivative only. So the portability gained can only be with another C compiler for this architecture. As the placement of the section is mandatory in this case, porting would still need to adapt the #pragma's. And now there is a part in the prm file which would not port automatically either (but granted, you have to port the memory layout somehow).&lt;/P&gt;&lt;P&gt;As I see it, using the @ is a bit less noise (less text), using the prm file has the advantage that all addresses are defined in one location.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 23:54:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155012#M3939</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2009-02-23T23:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Initialisation from PE occurs compiler faild</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155013#M3940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Writing a vector table portable to another CPU architecture doesn't make sense, this isn't what I suggested.&lt;BR /&gt;&lt;BR /&gt;The advantage is that the code will compile on any HC(S)08 compiler. It threats the vector table for what it is: an array of numbers. How it gets to the right place in the memory shouldn't be a concern for the compiler, but for the linker. If every compiler implemented this with #pragma, the code would be fully portable between HCS08 compilers. Sure, there would be a lot of pragmas all over the code, but it would still be portable. If a compiler doesn't understand them, it ignores them.&lt;BR /&gt;&lt;BR /&gt;For the same reasons, #pragma TRAP PROC is a better way than messing around with the "interrupt" keyword.&lt;BR /&gt;&lt;BR /&gt;The .prm lines are compiler (linker) specific. It is good to keep all such things in one file, so the code gets easier to port. If all compiler specific things are spread all over the code, porting is more of a mess.&lt;BR /&gt;&lt;BR /&gt;Another advantage is that you can make the code conform to coding standards like MISRA-C. This isn't possible with non-standard code.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2009 16:44:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155013#M3940</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2009-02-24T16:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Initialisation from PE occurs compiler faild</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155014#M3941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@ lundin:&lt;/P&gt;&lt;P&gt;Your first solution didn't solve the errors. So I used your second solution. This solution does work. Now i have only a couple of errors in the code, which I wrote by myself &lt;IMG alt=":smileyvery-happy:" class="emoticon emoticon-smileyvery-happy" id="smileyvery-happy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-very-happy.gif" title="Smiley Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But these errors I could solve by myself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2009 21:36:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155014#M3941</guid>
      <dc:creator>PEBeginnerBeh</dc:creator>
      <dc:date>2009-02-24T21:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Initialisation from PE occurs compiler faild</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155015#M3942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello PEBegginer&lt;BR /&gt;&lt;BR /&gt;Your project is set up to use C++. However, the Device Initialization tool is targeted to ASM and C projects.&lt;BR /&gt;&lt;BR /&gt;To use the code generated by Device Initialization tool, please don't use&amp;nbsp; #include "MCUinit.c" in main.cpp. Instead, declare there the prototype of the MCU_init function:&lt;BR /&gt;&lt;BR /&gt;extern "C" {&lt;BR /&gt;extern void MCU_init(void);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Please note: when declaring your own variables in the MCUinit.c file (zahler, impulse, dis_var) place them in the section "User declarations and definitions" in the top of the "MCUinit.c" file to preserve it after code generation.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;/* User declarations and definitions */&lt;BR /&gt;/*&amp;nbsp;&amp;nbsp; Code, declarations and definitions here will be preserved during code generation */&lt;BR /&gt;extern unsigned long zahler;&lt;BR /&gt;extern unsigned long impulse;&lt;BR /&gt;extern unsigned char dis_var;&lt;BR /&gt;/* End of user declarations and definitions */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards&lt;BR /&gt;Vojtech Filip&lt;BR /&gt;Processor Expert Support Team&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 20:30:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155015#M3942</guid>
      <dc:creator>ProcessorExpert</dc:creator>
      <dc:date>2009-02-25T20:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Initialisation from PE occurs compiler faild</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155016#M3943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the compiler have no problem with compiling the code. But the linker have now problem with the vector_table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;

&lt;FONT color="#FF6600"&gt;#define DEFAULT_VECTOR _Startup
&lt;/FONT&gt;   
&lt;FONT color="#FF6600"&gt;#pragma CONST_SEG VECTORS&lt;/FONT&gt;
extern void ( *const vector_table[])(void);
#pragma CONST_SEG DEFAULT


/* vector_table.c */
#pragma CONST_SEG VECTORS
void ( * const vector_table[])(void) = {
{
Intervall1sec,
DEFAULT_VECTOR,
DEFAULT_VECTOR,
DEFAULT_VECTOR,
DEFAULT_VECTOR,            
DEFAULT_VECTOR,            
DEFAULT_VECTOR,            
DEFAULT_VECTOR,             
DEFAULT_VECTOR,             
DEFAULT_VECTOR,             
DEFAULT_VECTOR,             
DEFAULT_VECTOR,            
DEFAULT_VECTOR,          
Intervall1Min,              
DEFAULT_VECTOR,              
DEFAULT_VECTOR,              
DEFAULT_VECTOR,              
isrVtpm1ovf,                 
SIG,                        
DEFAULT_VECTOR,              
Reset_Zahler,                
isrVlvd,                     
DEFAULT_VECTOR,             
DEFAULT_VECTOR,              
_Startup                    
};
#pragma CONST_SEG DEFAULT&lt;/PRE&gt;&lt;P&gt;The lines which are written in orange occurs the error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error: L4101: Preprocessor failure because of not supported preprocessor directive. Only&amp;nbsp; #line supported directly by linker.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What should I do?&lt;/P&gt;&amp;nbsp;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:58:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155016#M3943</guid>
      <dc:creator>PEBeginnerBeh</dc:creator>
      <dc:date>2020-10-29T08:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Initialisation from PE occurs compiler faild</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155017#M3944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I solved the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2009 20:05:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialisation-from-PE-occurs-compiler-faild/m-p/155017#M3944</guid>
      <dc:creator>PEBeginnerBeh</dc:creator>
      <dc:date>2009-02-26T20:05:24Z</dc:date>
    </item>
  </channel>
</rss>

