<?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 Re: Config for SPI interrupts in MCUXpresso Config Tools</title>
    <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Config-for-SPI-interrupts/m-p/905483#M671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="267388" data-username="stefanlindblad" href="https://community.nxp.com/people/stefanlindblad"&gt;Stefan Lindblad&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;Yes, the sequence is wrong,&amp;nbsp; the right sequence should like below:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;void SPI_1_init(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Initialization function */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; SPI_SlaveInit(SPI_1_PERIPHERAL, &amp;amp;SPI_1_config);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; /* Enable interrupt SPI0_IRQn request in the NVIC */&lt;BR /&gt;&amp;nbsp; EnableIRQ(SPI_1_IRQN);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Enable interrupts */&lt;BR /&gt;&amp;nbsp; SPI_EnableInterrupts(SPI_1_PERIPHERAL, (kSPI_RxFullAndModfInterruptEnable | kSPI_TxEmptyInterruptEnable));&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Initialization function */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I will report it to development team. And now , I recommend you refer to the SPI demo under KL27 board,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/83986iE56597B0CFD44DB2/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2019 08:56:45 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2019-05-28T08:56:45Z</dc:date>
    <item>
      <title>Config for SPI interrupts</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Config-for-SPI-interrupts/m-p/905482#M670</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’m starting out with KL17Z64 and MCUXpresso. For a quick start I decided to use the Config Tool to generate initialization code for the peripherals.&lt;/P&gt;&lt;P&gt;For the SPI in interrupt mode the tool&amp;nbsp; generated this init function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&lt;SPAN style="color: #7f0055;"&gt;void&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt; SPI_1_init(&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055;"&gt;void&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;) {&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;/* Enable interrupts */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp; SPI_EnableInterrupts(SPI_1_PERIPHERAL, (&lt;/SPAN&gt;&lt;EM style="color: #0000c0; "&gt;kSPI_RxFifoNearFullInterruptEnable&lt;/EM&gt;&lt;SPAN style="color: black;"&gt; | &lt;/SPAN&gt;&lt;EM style="color: #0000c0; "&gt;kSPI_TxFifoNearEmptyInterruptEnable&lt;/EM&gt;&lt;SPAN style="color: black;"&gt;));&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;/* Enable interrupt SPI0_IRQn request in the NVIC */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 13px; color: black; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; EnableIRQ(SPI_1_IRQN);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;/* Initialization function */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 13px; color: black; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; SPI_SlaveInit(SPI_1_PERIPHERAL, &amp;amp;SPI_1_config);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; color: black; font-family: 'courier new', courier, monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;Looks like the functions are called in wrong order, SPI_EnableInterrupts() crashes as the clock for the SPI is enabled first in SPI_SlaveInit().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;Stefan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2019 09:51:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Config-for-SPI-interrupts/m-p/905482#M670</guid>
      <dc:creator>stefanlindblad</dc:creator>
      <dc:date>2019-05-23T09:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Config for SPI interrupts</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Config-for-SPI-interrupts/m-p/905483#M671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="267388" data-username="stefanlindblad" href="https://community.nxp.com/people/stefanlindblad"&gt;Stefan Lindblad&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;Yes, the sequence is wrong,&amp;nbsp; the right sequence should like below:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;void SPI_1_init(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Initialization function */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; SPI_SlaveInit(SPI_1_PERIPHERAL, &amp;amp;SPI_1_config);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; /* Enable interrupt SPI0_IRQn request in the NVIC */&lt;BR /&gt;&amp;nbsp; EnableIRQ(SPI_1_IRQN);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Enable interrupts */&lt;BR /&gt;&amp;nbsp; SPI_EnableInterrupts(SPI_1_PERIPHERAL, (kSPI_RxFullAndModfInterruptEnable | kSPI_TxEmptyInterruptEnable));&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Initialization function */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I will report it to development team. And now , I recommend you refer to the SPI demo under KL27 board,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/83986iE56597B0CFD44DB2/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2019 08:56:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Config-for-SPI-interrupts/m-p/905483#M671</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2019-05-28T08:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Config for SPI interrupts</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Config-for-SPI-interrupts/m-p/905484#M672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is indeed issue in SPI component in Peripherals tool. It affects also the FLEXCOMM variant of the SPI component used by&amp;nbsp;LPC processors.&lt;/P&gt;&lt;P&gt;Attached please find patch fixing the issue in MCUXpresso Config Tools v5. Instructions how to apply the patch are included in the archive. This issue will be fixed in upcoming MCUXpresso Config Tools v6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for reporting this issue and we apologizes for the inconvenience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lukas&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2019 12:36:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Config-for-SPI-interrupts/m-p/905484#M672</guid>
      <dc:creator>Lukas_Heczko</dc:creator>
      <dc:date>2019-05-28T12:36:06Z</dc:date>
    </item>
  </channel>
</rss>

