<?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 Installing interrupts with KSDK 2.0? in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Installing-interrupts-with-KSDK-2-0/m-p/755133#M7735</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is sort of resurrecting &lt;A _jive_internal="true" href="https://community.nxp.com/thread/385459" rel="nofollow noopener noreferrer" target="_blank"&gt;the thread I started a while back&lt;/A&gt;. In that thread, I was having a problem with installing an interrupt routine. The&amp;nbsp;way I solved it was to&amp;nbsp;add&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;-Xlinker --defsym=__ram_vector_table__=1&lt;/SPAN&gt; to the linker options, and then use&amp;nbsp;&lt;SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;InstallIRQHandler&lt;/SPAN&gt; to explicitly install the IRQ handler.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;Now, the other solution was to simply define the IRQ handler and it would override the weak one defined elsewhere.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;However, I've dusted off that example, and it does not work! It's very nearly a copy of the PIT example included with the SDK.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="language-cpp"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;bool&lt;/SPAN&gt; pitIsrFlag &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;PIT0_IRQHandler&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;/* Clear interrupt flag.*/&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;PIT_ClearStatusFlags&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PIT&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kPIT_Chnl_0&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kPIT_TimerFlag&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 pitIsrFlag &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;First, when running the code and the timer goes off, I get stuck in&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;IntDefaultHandler&lt;/SPAN&gt;. This shows that the IRQ handler was definitely not installed properly. I've checked the map file, and it shows two instances of PIT0_IRQHandler, one from my main file, and one from&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;startup_mk64f12.o.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Jan 2018 21:34:33 GMT</pubDate>
    <dc:creator>robertgbaruch</dc:creator>
    <dc:date>2018-01-01T21:34:33Z</dc:date>
    <item>
      <title>Installing interrupts with KSDK 2.0?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Installing-interrupts-with-KSDK-2-0/m-p/755133#M7735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is sort of resurrecting &lt;A _jive_internal="true" href="https://community.nxp.com/thread/385459" rel="nofollow noopener noreferrer" target="_blank"&gt;the thread I started a while back&lt;/A&gt;. In that thread, I was having a problem with installing an interrupt routine. The&amp;nbsp;way I solved it was to&amp;nbsp;add&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;-Xlinker --defsym=__ram_vector_table__=1&lt;/SPAN&gt; to the linker options, and then use&amp;nbsp;&lt;SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;InstallIRQHandler&lt;/SPAN&gt; to explicitly install the IRQ handler.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;Now, the other solution was to simply define the IRQ handler and it would override the weak one defined elsewhere.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;However, I've dusted off that example, and it does not work! It's very nearly a copy of the PIT example included with the SDK.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="language-cpp"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;bool&lt;/SPAN&gt; pitIsrFlag &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;PIT0_IRQHandler&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;/* Clear interrupt flag.*/&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;PIT_ClearStatusFlags&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PIT&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kPIT_Chnl_0&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kPIT_TimerFlag&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 pitIsrFlag &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;First, when running the code and the timer goes off, I get stuck in&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;IntDefaultHandler&lt;/SPAN&gt;. This shows that the IRQ handler was definitely not installed properly. I've checked the map file, and it shows two instances of PIT0_IRQHandler, one from my main file, and one from&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;startup_mk64f12.o.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jan 2018 21:34:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Installing-interrupts-with-KSDK-2-0/m-p/755133#M7735</guid>
      <dc:creator>robertgbaruch</dc:creator>
      <dc:date>2018-01-01T21:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Installing interrupts with KSDK 2.0?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Installing-interrupts-with-KSDK-2-0/m-p/755134#M7736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solution found! According to &lt;A _jive_internal="true" href="https://community.nxp.com/thread/389106"&gt;Startup Code and Interrupt Handlers&lt;/A&gt;, the handler must be inside an extern "C" block if you're compiling under C++. Otherwise the name gets mangled and will not match the weak symbol.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jan 2018 05:04:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Installing-interrupts-with-KSDK-2-0/m-p/755134#M7736</guid>
      <dc:creator>robertgbaruch</dc:creator>
      <dc:date>2018-01-02T05:04:56Z</dc:date>
    </item>
  </channel>
</rss>

