<?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 How to map ISR to a HW interrupt? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369514#M19085</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just started development with FRDM-KL03 board and doing some SPI/I2C stuff. I would like to know how do I map an ISR that I write to service a certain HW interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a beginner question, but any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Oct 2014 09:41:06 GMT</pubDate>
    <dc:creator>willx</dc:creator>
    <dc:date>2014-10-31T09:41:06Z</dc:date>
    <item>
      <title>How to map ISR to a HW interrupt?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369514#M19085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just started development with FRDM-KL03 board and doing some SPI/I2C stuff. I would like to know how do I map an ISR that I write to service a certain HW interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a beginner question, but any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 09:41:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369514#M19085</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2014-10-31T09:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to map ISR to a HW interrupt?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369515#M19086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/message/375597"&gt;Re: How to use interrupts on kinetis?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 13:14:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369515#M19086</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-10-31T13:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to map ISR to a HW interrupt?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369516#M19087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Will X-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't understand correctly what is your intension. Do you make programs from the scratch? It would be a little difficult. I think you can re-use the FRDM-KL25Z Sample Code probably even for KL03. The Sample Code can get from the freescale site (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KL2x&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab"&gt;http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KL2x&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab&lt;/A&gt;&lt;SPAN&gt;). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Software Development Tools &amp;gt; Lab and Test Software &amp;gt; KL25_SC&lt;/P&gt;&lt;P&gt;If you use the KL25 Sample Code, you can map SPI/I2C ISRs for each interrupt to modify isr.h file in the sample code as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----[snip]-----&lt;BR /&gt;void your_SPI_handler();&lt;BR /&gt;void your_I2C_handler();&lt;/P&gt;&lt;P&gt;#under&amp;nbsp;&amp;nbsp; VECTOR_026&lt;BR /&gt;#define&amp;nbsp; VECTOR_026&amp;nbsp; your_SPI_handler&lt;/P&gt;&lt;P&gt;#under&amp;nbsp;&amp;nbsp; VECTOR_024&lt;BR /&gt;#define&amp;nbsp; VECTOR_024&amp;nbsp; your_I2C_handler&lt;BR /&gt;----[snip]-----&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; I am not sure whether the vector number of KL25Z is the same as KL03. From the KL03 reference manual it seems to be the same.&lt;BR /&gt;Do this help you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Yasuhiko Koumoto.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Nov 2014 23:05:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369516#M19087</guid>
      <dc:creator>yasuhikokoumoto</dc:creator>
      <dc:date>2014-11-02T23:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to map ISR to a HW interrupt?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369517#M19088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Yasuhiko-san!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I am making a program from scratch. I am not basing it on anything and I am enabling the HW interrupts for I2C and SPI but I don't know how to map a handler function to service those interrupts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the snippet you provided, where are VECTOR_024 and VECTOR_026 defined? They are defined anywhere in my project. I am using MKL03Z4.h file that contains all the chip related definitions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 01:42:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369517#M19088</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2014-11-04T01:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to map ISR to a HW interrupt?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369518#M19089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Will,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Freescale provides KSDK software for KL03 chip.&lt;/P&gt;&lt;P&gt;Please download [Freescale Kinetis SDK_1.0.0 for the FRDM-KL03Z - Windows installer] from below link:&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL03Z&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab"&gt;http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL03Z&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab&lt;/A&gt;&lt;/P&gt;&lt;P&gt;After installation the KSDK for KL03Z software, customer could find example demo at default path: &lt;/P&gt;&lt;P&gt;C:\Freescale\KSDK_1.0.0-KL03Z\demos&lt;/P&gt;&lt;P&gt;Just using [rtc_func] as an example, the interrupt ISR list at &amp;lt;startup_MKL03Z4.s&amp;gt; file with vector table to related ISR function.&lt;/P&gt;&lt;P&gt;The ISR function should with the same name as &amp;lt;startup_MKL03Z4.s&amp;gt;, and customer could find RTC IRQ ISR and RTC second IRQ ISR function located &amp;lt;rtc_func.c&amp;gt; file line 74:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* override the RTC IRQ handler */&lt;/P&gt;&lt;P&gt;void RTC_IRQHandler(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (RTC_DRV_IsAlarmPending(0))&lt;/P&gt;&lt;P&gt;&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; gAlarmPending = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* disable alarm interrupt */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTC_DRV_SetAlarmIntCmd(0, false);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* override the RTC Second IRQ handler */&lt;/P&gt;&lt;P&gt;void RTC_Seconds_IRQHandler(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gSecsFlag = true;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;BR /&gt;best regards &lt;BR /&gt;Ma Hui&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 06:25:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369518#M19089</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2014-11-04T06:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to map ISR to a HW interrupt?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369519#M19090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you download the code sample code &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Yasuhiko-san pointed you to, you'll see a file named startup_MKL25Z4.s&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;That file contains a table of interrupt vectors with handy names like SPI0_IRQHandler and I2C0_IRQHandler by default these have a weak link to Default_Handler. What that means is if you don't provide a function with that name in your code, than then Default_Handler() gets called if the interrupt occurs. However if you supply and interrupt handler by simply creating a function of that name, it gets linked instead of the default handler.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Note, I'm not really up on the freescale demo code. Some examples instead of the vector table being defined and an assemble (.s) file, it's defined in a .c file instead. But the effect is exactly the same.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;So for an spi handler likely&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;void SPI0_IRQHandler(void)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your code here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;This should totally work. Note an easy test is to use a pin change interrupt to toggle and LED.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Good luck, bare metal projects are often a bit painful to get off the ground.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 06:48:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369519#M19090</guid>
      <dc:creator>gibbon1</dc:creator>
      <dc:date>2014-11-04T06:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to map ISR to a HW interrupt?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369520#M19091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp; Matthew-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for your explanations. they would be almost perfect. Also I would add some comments. &lt;BR /&gt;VECTOR_024 and VECTOR_026 are defined in the vector.h at&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ${PROJ_ROOT}\cpu\vector.h&lt;BR /&gt;which is contained in the KL25 Sample Code package.&lt;BR /&gt;The vector.h is included by the vector.c at the same directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----[snip]-------&lt;BR /&gt;#if (defined(KEIL))&lt;BR /&gt;const vector_entry&amp;nbsp; __vector_table[] = //@ ".intvec" =&lt;BR /&gt;#elif (defined(IAR))&lt;BR /&gt;#pragma location = ".intvec"&lt;BR /&gt;const vector_entry&amp;nbsp; __vector_table[] = //@ ".intvec" =&lt;BR /&gt;#elif (defined(CW))&lt;BR /&gt;const vector_entry __attribute__ ((section(".vectortable"))) __vector_table[] = //@ ".intvec" =&lt;BR /&gt;#endif&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; VECTOR_000,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Initial SP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; VECTOR_001,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Initial PC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; VECTOR_002,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ...........&lt;BR /&gt;&amp;nbsp;&amp;nbsp; VECTOR_PADDING,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; VECTOR_PADDING,&lt;BR /&gt;#ifndef CW&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CONFIG_1,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CONFIG_2,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CONFIG_3,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CONFIG_4,&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;};&lt;BR /&gt;-----[snip]-------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the above tabe is referred in the startup.c like as fllowing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----[snip]-------&lt;BR /&gt;#if (defined(KEIL))&lt;BR /&gt; extern uint32 Image$$VECTOR_ROM$$Base[];&lt;BR /&gt; extern uint32 Image$$VECTOR_RAM$$Base[];&lt;BR /&gt; #define __VECTOR_TABLE Image$$VECTOR_ROM$$Base&amp;nbsp; &lt;BR /&gt; #define __VECTOR_RAM Image$$VECTOR_RAM$$Base&amp;nbsp; &lt;BR /&gt;#elif (defined(IAR))&lt;BR /&gt; /* Addresses for VECTOR_TABLE and VECTOR_RAM come from the linker file */&lt;BR /&gt; extern uint32 __VECTOR_TABLE[];&lt;BR /&gt; extern uint32 __VECTOR_RAM[];&lt;BR /&gt;#elif (defined(CW))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define __VECTOR_TABLE __vector_table&amp;nbsp; &lt;BR /&gt; #define __VECTOR_RAM&amp;nbsp;&amp;nbsp; __vector_ram&lt;BR /&gt; extern uint32 __VECTOR_TABLE[];&lt;BR /&gt; extern uint32 __VECTOR_RAM[];&lt;BR /&gt;#endif&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Copy the vector table to RAM */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (__VECTOR_RAM != __VECTOR_TABLE)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (n = 0; n &amp;lt; 0x104; n++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __VECTOR_RAM[n] = __VECTOR_TABLE[n];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Point the VTOR to the new copy of the vector table */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write_vtor((uint32)__VECTOR_RAM);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;-----[snip]-------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The startup.c is located at&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ${PROJ_ROOT}\common\startup.c.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I wonder why Will X-san don't use the sample code package because KL03 sample codes are re-used from KL25Z on the freescale site (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KL02&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab"&gt;http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KL02&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Yasuhiko Koumoto.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 11:23:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369520#M19091</guid>
      <dc:creator>yasuhikokoumoto</dc:creator>
      <dc:date>2014-11-04T11:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to map ISR to a HW interrupt?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369521#M19092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to just make use the default Kinetis_startup.s that includes the vector table mapping and it worked since I name my ISR SPI0_IRQHandler().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Nov 2014 22:45:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-map-ISR-to-a-HW-interrupt/m-p/369521#M19092</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2014-11-17T22:45:19Z</dc:date>
    </item>
  </channel>
</rss>

