<?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 I²C - Interrupts gives &amp;quot;Exception vector name: address error&amp;quot; in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136991#M1872</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hello once again with another kind of problem,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just created my own interrupt to react on i²c.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i did the following.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in File:&amp;nbsp;&amp;nbsp;&amp;nbsp; vectors.s&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;...#define _i2c_handler&amp;nbsp;&amp;nbsp; i2c_handler....extern _i2c_handler...vector81: .long _i2c_handler&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;declaration of the interrupt in interrupt_handlers.c&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;__interrupt__ voidi2c_handler (void){ extern i2c_next_tx; printf("i2c_handler\n"); if (MCF_I2C_I2SR &amp;amp;= MCF_I2C_I2SR_RXAK)&amp;nbsp; i2c_next_tx = 0; else&amp;nbsp; i2c_next_tx = 1;&amp;nbsp; /* Clear the interrupt event */&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_I2C_I2SR &amp;amp;= ~MCF_I2C_I2SR_IIF;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;until here i think it is the same procedure as done with all the other interrupts in the vector table..&lt;BR /&gt;&lt;BR /&gt;while debugging and comparing the registers i see that the iack cycle provides the the right vectornumber in the SWIACK...its #51, but all i get is a notice of codewarrior "Exception vector name: address error" as you can see in the image i attached.&lt;BR /&gt;it´s not clear to me, why he jumps to that kind of interrupt and to that address in memory.&lt;BR /&gt;&lt;BR /&gt;i also tried to jump to the interrupt routine via the function "board_handle_interrupt" but this has no effect&lt;BR /&gt;&lt;BR /&gt;maybe you´ll find something?&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alban Edit: title changed, too vague&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by Alban on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2007-06-15&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;08:35 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Jun 2007 16:34:42 GMT</pubDate>
    <dc:creator>Student_Exams</dc:creator>
    <dc:date>2007-06-15T16:34:42Z</dc:date>
    <item>
      <title>I²C - Interrupts gives "Exception vector name: address error"</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136991#M1872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hello once again with another kind of problem,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just created my own interrupt to react on i²c.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i did the following.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in File:&amp;nbsp;&amp;nbsp;&amp;nbsp; vectors.s&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;...#define _i2c_handler&amp;nbsp;&amp;nbsp; i2c_handler....extern _i2c_handler...vector81: .long _i2c_handler&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;declaration of the interrupt in interrupt_handlers.c&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;__interrupt__ voidi2c_handler (void){ extern i2c_next_tx; printf("i2c_handler\n"); if (MCF_I2C_I2SR &amp;amp;= MCF_I2C_I2SR_RXAK)&amp;nbsp; i2c_next_tx = 0; else&amp;nbsp; i2c_next_tx = 1;&amp;nbsp; /* Clear the interrupt event */&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_I2C_I2SR &amp;amp;= ~MCF_I2C_I2SR_IIF;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;until here i think it is the same procedure as done with all the other interrupts in the vector table..&lt;BR /&gt;&lt;BR /&gt;while debugging and comparing the registers i see that the iack cycle provides the the right vectornumber in the SWIACK...its #51, but all i get is a notice of codewarrior "Exception vector name: address error" as you can see in the image i attached.&lt;BR /&gt;it´s not clear to me, why he jumps to that kind of interrupt and to that address in memory.&lt;BR /&gt;&lt;BR /&gt;i also tried to jump to the interrupt routine via the function "board_handle_interrupt" but this has no effect&lt;BR /&gt;&lt;BR /&gt;maybe you´ll find something?&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alban Edit: title changed, too vague&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by Alban on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2007-06-15&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;08:35 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2007 16:34:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136991#M1872</guid>
      <dc:creator>Student_Exams</dc:creator>
      <dc:date>2007-06-15T16:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupts</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136992#M1873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Did you just set up the interrupt vector, or have you also set up the interrupt level and priority?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What CPU?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Did you really mena to put &amp;amp;= in your if clause or should this be (MCF_I2C_I2SR &amp;amp; MCF_I2C_I2SR_RXAK)?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;There is some discussion on interrupts here that may help:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=2100" target="_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=2100&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Cheers,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Paul.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2007 17:58:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136992#M1873</guid>
      <dc:creator>mccPaul</dc:creator>
      <dc:date>2007-06-15T17:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupts</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136993#M1874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;oh sry. Its the mcf52235evb&lt;BR /&gt;&lt;BR /&gt;Thanks for correction in my if-clause. The debugger never reached this part, so i hadn´t mentioned yet.&lt;BR /&gt;&lt;BR /&gt;What do you mean with setting up the vector exactly? i declared the routine as you you can see above. nothing else. i tried to use this function&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;ADDRESSmcf5xxx_set_handler (int vector, ADDRESS new_handler){    extern uint32 __VECTOR_RAM[];    ADDRESS old_handler;        old_handler = (ADDRESS) __VECTOR_RAM[vector];    __VECTOR_RAM[vector] = (uint32)new_handler;    return old_handler;}

...

mcf5xxx_set_handler (81, i2c_handler());
&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;but the debugger starts immediatly to process the routine i2c_handler.&lt;BR /&gt;interrupt level and priority are set to 0x3&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2007 18:26:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136993#M1874</guid>
      <dc:creator>Student_Exams</dc:creator>
      <dc:date>2007-06-15T18:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupts</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136994#M1875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;update:&lt;BR /&gt;&lt;BR /&gt;I implemented some code in the way described in the example of the other topic you gave me.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;It looks like this now.&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;__interrupt__ void i2c_handler (void){ extern i2c_next_tx; printf("i2c_handler\n"); if (MCF_I2C_I2SR &amp;amp; MCF_I2C_I2SR_RXAK)  i2c_next_tx = 0; else  i2c_next_tx = 1; //bei ACKN = 1 /* Clear the interrupt event */    MCF_I2C_I2SR &amp;amp;= ~MCF_I2C_I2SR_IIF;}void mcf52235_interrupt_init(uint8 source, uint8 ipl, void (*handler)(void)){ uint8 sysint = asm_set_ipl(7);  if (handler) {  MCF_INTC0_ICR(source) = (ipl &amp;amp; 0x3F);  mcf5xxx_set_handler (source + 64, (ADDRESS) handler); } asm_set_ipl(sysint);}int main(){ void (*handler)(void) = i2c_handler; init_main(); mcf52235_interrupt_init(0x11, MCF_INTC_ICR_IL(TIMER_NETWORK_LEVEL),handler); mcf5xxx_wr_sr(0x2000); mcf5xxx_irq_enable();        ...}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;after all the result is still the same &lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" id="smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2007 19:53:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136994#M1875</guid>
      <dc:creator>Student_Exams</dc:creator>
      <dc:date>2007-06-15T19:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupts</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136995#M1876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi&lt;BR /&gt;&lt;BR /&gt;At a first glance it looks as though the interrupt vector is jumping to the address 0 (like a null pointer) where there is emply FLASH. I assume that you are downloading to and debugging from RAM(?)&lt;BR /&gt;&lt;BR /&gt;Are you sure that the Vector Base Register is set up correctly (are other interrupts working?).&lt;BR /&gt;mcf5xxx_wr_vbr((unsigned long)__VECTOR_RAM); // set VBR to work with vectors in RAM&lt;BR /&gt;&lt;BR /&gt;If you are working with interrupt vectors in RAM then the vectors.s file will not actually be used. It is only used if working from FLASH where the vector table is fixed - in this case mcf5xxx_set_handler() will also not be of any use. Since it looks more as though the vector table has a null pointer entry I would suspect that it is somewhere in RAM but not being initialised correctly. [check the value of VBR in the debugger. Then open a memory window at that address and check the interrupt vector addresses which are there.]&lt;BR /&gt;&lt;BR /&gt;Note also that you can activate I2C support in the uTasker code by activating the define IIC_INTERFACE in config.h.&lt;BR /&gt;&lt;BR /&gt;It is configured by&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;PRE&gt;    IC_ICR_0_17 = IIC_INTERRUPT_PRIORITY;                                // define interrupts level and priority    fnSetIntHandler(IIC_VECTOR, (unsigned char *)_IIC_Interrupt);        // enter the handler routine    IC_IMRL_0 &amp;amp;= ~(IIC_PIF_INT_L | MASK_ALL_INT);&lt;/PRE&gt;&lt;/DIV&gt;where fnSetIntHandler is equivalent to the one you are using.&lt;BR /&gt;The interrupt level and priority are user configurable in app_hw_m5223x.h (in SP4) and is defined as default to (INTERRUPT_LEVEL_2 | INTERRUPT_PRIORITY_2).&lt;BR /&gt;&lt;BR /&gt;If you also activate TEST_IIC in application.c the code will read and write test data from/to an IIC EEPROM - see the description: &lt;A href="http://www.utasker.com/docs/uTasker/uTaskerIIC.PDF" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerIIC.PDF&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow noopener noreferrer" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2007 20:12:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136995#M1876</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2007-06-15T20:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupts</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136996#M1877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hey mark...&lt;BR /&gt;&lt;BR /&gt;that´s it.&lt;BR /&gt;&lt;BR /&gt;the VBR was defined wrong. i added it like this and it works...&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;mcf5xxx_set_handler (int vector, ADDRESS new_handler){    extern uint32 __VECTOR_RAM[];    ADDRESS old_handler;        old_handler = (ADDRESS) __VECTOR_RAM[vector];    __VECTOR_RAM[vector] = (uint32)new_handler;    mcf5xxx_wr_vbr((uint32)__VECTOR_RAM);      //&amp;lt;----here we are    return old_handler;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;THX and and nice weekend &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2007 20:41:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136996#M1877</guid>
      <dc:creator>Student_Exams</dc:creator>
      <dc:date>2007-06-15T20:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupts</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136997#M1878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Ah, good..&lt;BR /&gt;&lt;BR /&gt;Normally the&amp;nbsp; &lt;SPAN&gt;&lt;/SPAN&gt;mcf5xxx_wr_vbr() initialiation is performed at start up (rather than in interrupt entry) so that it is only performed once.&lt;BR /&gt;In addition it will then also then catch exceptions in the normal exception handlers early on in the code.&lt;BR /&gt;&lt;BR /&gt;See mcf52235_init() in m5223x.c in the uTasker project.&lt;BR /&gt;It is more of less the Freescale reference startup code which fills the vector table with an undefined interrupt handler and sets the VBR.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2007 20:50:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/I-C-Interrupts-gives-quot-Exception-vector-name-address-error/m-p/136997#M1878</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2007-06-15T20:50:23Z</dc:date>
    </item>
  </channel>
</rss>

