<?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 Why is my interrupt hard faulting? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971725#M55233</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 have a TPM counter that is interrupting and then hard faulting.&amp;nbsp; I can see the counter increment, I can see the modulous is set correctly, I can see that the interrupt is enabled and that the overflow flag has triggered.&amp;nbsp; However the interrupt never makes it into the interrupt routine.&amp;nbsp; I also checked the NVIC ISER and ICER and I can see that bit 17 is set in both.&amp;nbsp; The interrupt per the KL17 user manual for TPM0 is IRQ17, so that seems correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I track down where the fault it coming from?&amp;nbsp; I am using a PE Micro debugger with MCUxpresso on a MKL17Z64VDA4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some of my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BOARD_TPM TPM0&lt;BR /&gt;#define BOARD_TPM_IRQ_NUM TPM0_IRQn&lt;BR /&gt;#define BOARD_TPM_HANDLER TPM0_IRQHandler&lt;BR /&gt;//#define TPM_SOURCE_CLOCK (CLOCK_GetFreq(kCLOCK_McgIrc48MClk)/4)&lt;BR /&gt;#define TPM_SOURCE_CLOCK (CLOCK_GetFreq(kCLOCK_McgInternalRefClk))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void TPM0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Clear interrupt flag.*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM_ClearStatusFlags(BOARD_TPM, kTPM_TimeOverflowFlag);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tpmIsrFlag = true;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __DSB();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //__ISB();&amp;nbsp; //Needed?&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void initializeTPM()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;tpm_config_t tpmInfo;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//CLOCK_SetTpmClock(3U);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TPM_GetDefaultConfig(&amp;amp;tpmInfo);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//tpmInfo.prescale = TPM_PRESCALER; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* TPM clock divide by TPM_PRESCALER */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM_Init(BOARD_TPM, &amp;amp;tpmInfo);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Initialize TPM module */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM_SetTimerPeriod(BOARD_TPM, USEC_TO_COUNT(1000U, TPM_SOURCE_CLOCK));&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Set timer period. */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM_EnableInterrupts(BOARD_TPM, kTPM_TimeOverflowInterruptEnable);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //TPM_EnableInterrupts(BOARD_TPM, kTPM_Chnl0InterruptEnable);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EnableIRQ(BOARD_TPM_IRQ_NUM);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Aug 2019 17:09:11 GMT</pubDate>
    <dc:creator>umlengineer</dc:creator>
    <dc:date>2019-08-08T17:09:11Z</dc:date>
    <item>
      <title>Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971725#M55233</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 have a TPM counter that is interrupting and then hard faulting.&amp;nbsp; I can see the counter increment, I can see the modulous is set correctly, I can see that the interrupt is enabled and that the overflow flag has triggered.&amp;nbsp; However the interrupt never makes it into the interrupt routine.&amp;nbsp; I also checked the NVIC ISER and ICER and I can see that bit 17 is set in both.&amp;nbsp; The interrupt per the KL17 user manual for TPM0 is IRQ17, so that seems correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I track down where the fault it coming from?&amp;nbsp; I am using a PE Micro debugger with MCUxpresso on a MKL17Z64VDA4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some of my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BOARD_TPM TPM0&lt;BR /&gt;#define BOARD_TPM_IRQ_NUM TPM0_IRQn&lt;BR /&gt;#define BOARD_TPM_HANDLER TPM0_IRQHandler&lt;BR /&gt;//#define TPM_SOURCE_CLOCK (CLOCK_GetFreq(kCLOCK_McgIrc48MClk)/4)&lt;BR /&gt;#define TPM_SOURCE_CLOCK (CLOCK_GetFreq(kCLOCK_McgInternalRefClk))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void TPM0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Clear interrupt flag.*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM_ClearStatusFlags(BOARD_TPM, kTPM_TimeOverflowFlag);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tpmIsrFlag = true;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __DSB();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //__ISB();&amp;nbsp; //Needed?&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void initializeTPM()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;tpm_config_t tpmInfo;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//CLOCK_SetTpmClock(3U);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TPM_GetDefaultConfig(&amp;amp;tpmInfo);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//tpmInfo.prescale = TPM_PRESCALER; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* TPM clock divide by TPM_PRESCALER */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM_Init(BOARD_TPM, &amp;amp;tpmInfo);&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Initialize TPM module */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM_SetTimerPeriod(BOARD_TPM, USEC_TO_COUNT(1000U, TPM_SOURCE_CLOCK));&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Set timer period. */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM_EnableInterrupts(BOARD_TPM, kTPM_TimeOverflowInterruptEnable);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //TPM_EnableInterrupts(BOARD_TPM, kTPM_Chnl0InterruptEnable);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EnableIRQ(BOARD_TPM_IRQ_NUM);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2019 17:09:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971725#M55233</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-08T17:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971726#M55234</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;How have you entered your interrupt handler? Do you do it via the interrupt vectors in Flash or do you add it to interrupt vectors in RAM?&lt;BR /&gt;Do you have a default interrupt handler in place in case you haven't added your handler correctly?&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;Complete KLx7 solutions for professional needs, training and support:http://www.utasker.com/kinetis.html&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Kinetis K27:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KL27Z.html" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KL27Z.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/Capuccino-KL27.html" target="test_blank"&gt;http://www.utasker.com/kinetis/Capuccino-KL27.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;Complete Kinetis solutions for professional needs, training and support:http://www.utasker.com/kinetis.html&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;uTasker: supporting &amp;gt;1'000 registered Kinetis users get products faster and cheaper to market&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2019 23:10:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971726#M55234</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-08-08T23:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971727#M55235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;#define TPM_SOURCE_CLOCK (CLOCK_GetFreq(kCLOCK_McgInternalRefClk))&lt;/P&gt;&lt;P&gt;Seems that you want to use MCGIRCLK clock for TPM.&lt;/P&gt;&lt;P&gt;Would you please configure SIM_SOPT2[TPMSRC]?&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;CLOCK_SetTpmClock(3U);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Best Regards,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Robin&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&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>Fri, 09 Aug 2019 09:20:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971727#M55235</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2019-08-09T09:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971728#M55236</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 am setting the clocks via the clock tool, this alters some of the boot up functions.&amp;nbsp; I am setting the TPM clock via:&lt;/P&gt;&lt;P&gt;BOARD_InitBootClocks();&amp;nbsp; &lt;/P&gt;&lt;P&gt;which points to:&amp;nbsp; &amp;nbsp;BOARD_BootClockRUN();&lt;/P&gt;&lt;P&gt;which calls:&amp;nbsp; &amp;nbsp;CLOCK_SetTpmClock(SIM_TPM_CLK_SEL_MCGIRCLK_CLK);&lt;/P&gt;&lt;P&gt;which is defined as:&amp;nbsp; #define SIM_TPM_CLK_SEL_MCGIRCLK_CLK&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3U&amp;nbsp; /*!&amp;lt; TPM clock select: MCGIRCLK clock */&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, 09 Aug 2019 17:12:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971728#M55236</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-09T17:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971729#M55237</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;The pointing to the interrupt handler is usually done via the API code.&amp;nbsp; I have tracked it as best as I can below:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EnableIRQ(BOARD_TPM_IRQ_NUM);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#define BOARD_TPM_IRQ_NUM TPM0_IRQn&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TPM0_IRQn&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 17,&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;lt; TPM0 single interrupt vector for all sources */&lt;/P&gt;&lt;P&gt;Which points to:&amp;nbsp; NVIC_EnableIRQ(interrupt);&lt;/P&gt;&lt;P&gt;which points to:&amp;nbsp; __NVIC_EnableIRQ&lt;/P&gt;&lt;P&gt;which points to:&amp;nbsp; __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; if ((int32_t)(IRQn) &amp;gt;= 0)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NVIC-&amp;gt;ISER[0U] = (uint32_t)(1UL &amp;lt;&amp;lt; (((uint32_t)IRQn) &amp;amp; 0x1FUL));&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which I believe is working as I see it set in the ISER and ICER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the routine:&lt;/P&gt;&lt;P&gt;#define BOARD_TPM_HANDLER TPM0_IRQHandler&lt;/P&gt;&lt;P&gt;which points to:&amp;nbsp; TPM0_DriverIRQHandler();&lt;/P&gt;&lt;P&gt;which points to:&amp;nbsp; void TPM0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);&amp;nbsp; in startup_mkl17z644.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I poke around in startup_mkl17z644.c I see:&amp;nbsp;&lt;/P&gt;&lt;P&gt;__attribute__ ((used, section(".isr_vector")))&lt;BR /&gt;void (* const g_pfnVectors[])(void) = {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which contains:&amp;nbsp; TPM0_IRQHandler,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 33: TPM0 single interrupt vector for all sources&lt;/P&gt;&lt;P&gt;which seems to match #define BOARD_TPM_HANDLER TPM0_IRQHandler&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This all looks correct to me, which is partly why I am at a loss.&amp;nbsp; It also all seems to match example code that works on other platforms.&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, 09 Aug 2019 17:42:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971729#M55237</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-09T17:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971730#M55238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also here is a screenshot of what I see when I pause the debug:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/86669i207D0B68EA5D7178/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&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, 09 Aug 2019 18:30:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971730#M55238</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-09T18:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971731#M55239</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;Your call stack suggests that there is a hard fault taking place in your routine tpmDelay().&lt;/P&gt;&lt;P&gt;You need to show the code involved because it may be faulty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also download the uTasker project from GitHub and configure it for the KL27 (equivalent to KL17) and test its TPM references - documentation at &lt;A href="http://www.utasker.com/docs/uTasker/uTaskerHWTimers.PDF" target="test_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerHWTimers.PDF&lt;/A&gt;&lt;BR /&gt;This allows the KLx7, the TPM and its interrupts to be tested in its simulator and the solutions copied where needed.&lt;/P&gt;&lt;P&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 23:36:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971731#M55239</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-08-09T23:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971732#M55240</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;Thanks for the reply.&amp;nbsp; I thought it was the interrupt based off of research, but are you saying that it is the delay, because that is the subroutine that shows beneath the issue?&amp;nbsp; I would like to know how to read that debug info for the future.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the subroutine in question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;volatile uint8_t tpmCounter = 0U;&amp;nbsp;&amp;nbsp; Declared at the top&lt;/P&gt;&lt;P&gt;volatile bool tpmIsrFlag = false;&amp;nbsp;&amp;nbsp; Decared at the top&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint8_t tpmDelay(volatile uint8_t delayTime)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;tpmCounter = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TPM_StartTimer(BOARD_TPM, kTPM_SystemClock);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while(tpmCounter &amp;lt;= delayTime)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if(tpmIsrFlag == true)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;tpmCounter++;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;__WFI();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TPM_StopTimer(BOARD_TPM);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Aug 2019 01:11:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971732#M55240</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-10T01:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971733#M55241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can attach project, we are able to help you more easily.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2019 08:14:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971733#M55241</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2019-08-12T08:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971734#M55242</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 am unable to post a full project to a public forum, sorry.&amp;nbsp; However I am now trying to run a GPIO interupt and having the same issue.&amp;nbsp; There is something wrong somewhere with the NVIC and pointing, but I can not track it down.&amp;nbsp; I am unsure what is going on, as I have implemented almost identical code on other Kinetis MCUs without issue.&amp;nbsp; There is something wonky here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2019 15:56:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971734#M55242</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-12T15:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971735#M55243</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 can clean up my other project for release, but I am having the same issue in another project with GPIOs.&amp;nbsp; I can see that the GPIOs are triggering an interrupt and then the program is hanging because there is no handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached that project here:&amp;nbsp; &lt;A href="https://eink.sharefile.com/d-s89681da26d248998"&gt;https://eink.sharefile.com/d-s89681da26d248998&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2019 22:03:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971735#M55243</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-12T22:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971736#M55244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Evan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your Vector Table Offset Register setting?&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;uTasker: supporting &amp;gt;1'000 registered Kinetis users get products faster and cheaper to market&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Request Free emergency remote desk-top consulting at &lt;A href="http://www.utasker.com/services.html" target="test_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2019 22:11:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971736#M55244</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-08-12T22:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971737#M55245</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 have been digging around looking for it.&amp;nbsp; I am unsure what you mean by setting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I poke around in the code I am able to find a bunch of things that could be reference its location or its setting, I have attached a bunch of stuff in case some of it is helpful.&amp;nbsp; That said my guess is the top two in green are what you are looking for.&amp;nbsp; Its also odd that they have different values and both exist in the project.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;Per the core_armv8mbl.h&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;#if defined (__VTOR_PRESENT) &amp;amp;&amp;amp; (__VTOR_PRESENT == 1U)&lt;BR /&gt;/* SCB Vector Table Offset Register Definitions */&lt;BR /&gt;#define SCB_VTOR_TBLOFF_Pos&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;&amp;nbsp; 7U&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;&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;&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;lt; SCB VTOR: TBLOFF Position */&lt;BR /&gt;#define SCB_VTOR_TBLOFF_Msk&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; (0x1FFFFFFUL &amp;lt;&amp;lt; SCB_VTOR_TBLOFF_Pos)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*!&amp;lt; SCB VTOR: TBLOFF Mask */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;Per core_cm0plus.h&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;#if defined (__VTOR_PRESENT) &amp;amp;&amp;amp; (__VTOR_PRESENT == 1U)&lt;BR /&gt;/* SCB Interrupt Control State Register Definitions */&lt;BR /&gt;#define SCB_VTOR_TBLOFF_Pos&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;&amp;nbsp; 8U&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;&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;&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;lt; SCB VTOR: TBLOFF Position */&lt;BR /&gt;#define SCB_VTOR_TBLOFF_Msk&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; (0xFFFFFFUL &amp;lt;&amp;lt; SCB_VTOR_TBLOFF_Pos)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*!&amp;lt; SCB VTOR: TBLOFF Mask */&lt;BR /&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other stuff:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;Per startup_mkl17z644.h:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;NOTE:&amp;nbsp; __USE_CMSIS is set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;#if !defined (__USE_CMSIS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;// Assume that if __USE_CMSIS defined, then CMSIS SystemInit code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;// will setup the VTOR register&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Check to see if we are running the code from a non-zero&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // address (eg RAM, external flash), in which case we need&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // to modify the VTOR register to tell the CPU that the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // vector table is located at a non-0x0 address.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned int * pSCB_VTOR = (unsigned int *) 0xE000ED08;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((unsigned int *)g_pfnVectors!=(unsigned int *) 0x00000000) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *pSCB_VTOR = (unsigned int)g_pfnVectors;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;#endif // (__USE_CMSIS)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;#if defined (__cplusplus)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Call C++ library initialisation&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __libc_init_array();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;Per the .cproject File:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;amp;lt;peripheralInstance derived_from="NVIC" determined="infoFile" id="NVIC" location="0xE000E100"/&amp;amp;gt;&amp;amp;#13;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff9900;"&gt;Per the core_cm0plus.h file:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff9900;"&gt;#if defined (__VTOR_PRESENT) &amp;amp;&amp;amp; (__VTOR_PRESENT == 1U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff9900;"&gt;&amp;nbsp; __IOM uint32_t VTOR;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*!&amp;lt; Offset: 0x008 (R/W)&amp;nbsp; Vector Table Offset Register */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff9900;"&gt;#else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff9900;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t RESERVED0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff9900;"&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2019 22:35:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971737#M55245</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-12T22:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971738#M55246</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;As I keep reading I keep learning new stuff, this is much more of a deep dive into ARM than I have had to do in the past, so thank you for your patience.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I looked at the SCB -&amp;gt; VTOR setting I see 0x0 and the TBLOFF&amp;nbsp; is 0x0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is what you are looking for, but I will keep hunting and posting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2019 00:29:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971738#M55246</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-13T00:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971739#M55247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Evan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is best to run the code and check the VTOR value in the debugger when you set a breakpoint just before when you know that it fails.&lt;/P&gt;&lt;P&gt;If it pints to 0 it means that it expects the interrupt vectors at the start of Flash. If it points to an address in SRAM they should be (copied to) there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In either case you a memory dump of the first 256 long words form this address and show them in a screen shot.&lt;BR /&gt;The reason for either an unitialised vector or lack of hard fault handler will be visible in the screen shot.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2019 01:24:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971739#M55247</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-08-13T01:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971740#M55248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Evan,&lt;/P&gt;&lt;P&gt;I have checked your GPIO interrupt project, hardfault is caused by &lt;EM&gt;GPIO_PortClearInterruptFlags(GPIOB, 0xFFFFFFFF).&lt;/EM&gt;&lt;BR /&gt;You didn't enable the &lt;STRONG&gt;Clock Gate&lt;/STRONG&gt; of GPIOB and GPIOC, why you clear the &lt;STRONG&gt;ISFR&lt;/STRONG&gt; of GPIOB and GPIOC in &lt;EM&gt;PORTB_PORTC_PORTD_PORTE_IRQHandler&lt;/EM&gt;?&lt;BR /&gt;According to your project, only &lt;STRONG&gt;PTD4&lt;/STRONG&gt; and &lt;STRONG&gt;PTE23&lt;/STRONG&gt; are configured as GPIO interrupt.&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;GPIO_PortClearInterruptFlags(GPIOD, 1U &amp;lt;&amp;lt; 4);&lt;/EM&gt;&lt;/SPAN&gt; is able to clear &lt;STRONG&gt;ISFR&lt;/STRONG&gt; of PTD4.&lt;BR /&gt;You can test it on PTD4, it will not caused hardfault anymore.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="GPIO interrupt.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87284iD230CD679A61BCDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="GPIO interrupt.png" alt="GPIO interrupt.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Best Regards,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Robin&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&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, 13 Aug 2019 03:26:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971740#M55248</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2019-08-13T03:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971741#M55249</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;Sorry for the confusion, I was working with someone internally and they suggested I try clearing all flags to see if that was causing an issue.&amp;nbsp; Previously I was using only the commented out line:&amp;nbsp; GPIO_PortClearInterruptFlags(GPIOD, 1U &amp;lt;&amp;lt; 4);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I was only using pin PTD4 as my interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the base code as follows I do not get a hard fault, I just do not get an interrupt.&amp;nbsp; I do however see an interrupt flag in the PORTD as indicated by the attached image.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void PORTB_PORTC_PORTD_PORTE_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//printf("In Handler\r\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;GPIO_PortClearInterruptFlags(GPIOD, 1U &amp;lt;&amp;lt; 4);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//GPIO_PinWrite(GPIOD, 4U, 1);&amp;nbsp;&amp;nbsp; &amp;nbsp;//VNegBBottomLogic&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;localEraseFlag = 1;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;/* Init board hardware. */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOARD_InitBootPins();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOARD_InitBootClocks();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOARD_InitBootPeripherals();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; EnableIRQ(PORTB_PORTC_PORTD_PORTE_IRQn);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; printf("Starting While\r\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//printf("Pin Value is: %d\r\n", GPIO_PinRead(GPIOD, 4));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if(localEraseFlag == 1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("Received local erase\r\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;localEraseFlag = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//__WFI();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0 ;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is more clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture2.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87080i4D056E0C3473140C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/86866iA95D7295C8778F48/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2019 03:49:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971741#M55249</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-13T03:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971742#M55250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need to upload the full project to here.&lt;/P&gt;&lt;P&gt;Would you please create simple test project that only include TPM interrupt related codes？&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2019 08:24:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971742#M55250</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2019-08-13T08:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971743#M55251</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;Here is the memory dump and how I acquired it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="memDump.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/88180iB7F2A2D491DEC247/image-size/large?v=v2&amp;amp;px=999" role="button" title="memDump.png" alt="memDump.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="data2.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/88212i2BDD325E8273349B/image-size/large?v=v2&amp;amp;px=999" role="button" title="data2.PNG" alt="data2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2019 15:17:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971743#M55251</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2019-08-13T15:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my interrupt hard faulting?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971744#M55252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Evan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you VTOR register is set to 0 it all looks good:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87486iE8A0A82BAAA9B192/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There is a hard fault handler and also a TPM0 handler in the interrupt vectors in flash at this location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another possibility is that you are seeing the return from the exception in your call stack (the interrupt may have executed - did you try a break point in it?) but the saved PC (on stack) has been corrupted by the handler code and so it is jumping back to an invalid address.&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;EM&gt;P.S See Exception Return behavior in the ARM Corex M4 User's Guide, where 0xfffffff9 is the EXC_RETURN value.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2019 02:23:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-is-my-interrupt-hard-faulting/m-p/971744#M55252</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-08-16T02:23:15Z</dc:date>
    </item>
  </channel>
</rss>

