<?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: SPI DMA interrupt issue in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-interrupt-issue/m-p/879941#M52217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aldo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I did enable it back, but it didn't work. Now I found that it was caused by DMA. When SPI DMA mode was disabled and only SPI interrupt was enabled, it worked properly. However I don't know the root cause. It was easy to reproduce. You can a simple DMA SPI slave application with FreeRTOS and jumps to itself after first run. The DAM interrupt works in the first time and doesn't after jumping.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Mar 2019 20:11:17 GMT</pubDate>
    <dc:creator>jasonedn</dc:creator>
    <dc:date>2019-03-11T20:11:17Z</dc:date>
    <item>
      <title>SPI DMA interrupt issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-interrupt-issue/m-p/879939#M52215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm writing the second boot loader for LPC54101. When it jumps from boot to application, the SPI DMA interrupt never fired again, but other interrupts such as tick did. The boot and application use the SPI DMA initialization codes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The jump codes are below.&lt;/P&gt;&lt;P&gt;void jumpToUserApp( void )&lt;BR /&gt;{&lt;BR /&gt; USER_ENTRY_PFN user_entry;&lt;BR /&gt; user_entry = (USER_ENTRY_PFN)*((uint32_t*)(APP_IMAGE_START + 4));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// stop all interrupts&lt;BR /&gt; __disable_irq();&lt;BR /&gt; __set_CONTROL(0);&lt;/P&gt;&lt;P&gt;__set_MSP(*(uint32_t *)APP_IMAGE_START); // load stack pointer with initial value&lt;BR /&gt; (user_entry)();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SPI DMA initialization codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Config SPI&lt;BR /&gt; spi_slave_config_t slaveConfig;&lt;BR /&gt; SPI_SlaveGetDefaultConfig(&amp;amp;slaveConfig);&lt;BR /&gt; slaveConfig.sselPol = (spi_spol_t)kSPI_SpolActiveAllLow;&lt;BR /&gt; slaveConfig.fifoConfig.enableTxFifo = true;&lt;BR /&gt; slaveConfig.fifoConfig.enableRxFifo = true;&lt;BR /&gt; slaveConfig.fifoConfig.txFifoSize = 3;&lt;BR /&gt; slaveConfig.fifoConfig.rxFifoSize = 3;&lt;BR /&gt; slaveConfig.fifoConfig.txFifoThreshold = 3;&lt;BR /&gt; slaveConfig.fifoConfig.rxFifoThreshold = 3;&lt;BR /&gt; SPI_SlaveInit(SPI0, &amp;amp;slaveConfig);&lt;/P&gt;&lt;P&gt;// Config DMA&lt;BR /&gt; DMA_Init(DMA0);&lt;BR /&gt; DMA_EnableChannel(DMA0, 9);&lt;BR /&gt; DMA_EnableChannel(DMA0, 8);&lt;BR /&gt; DMA_SetChannelPriority(DMA0, 9, kDMA_ChannelPriority0);&lt;BR /&gt; DMA_SetChannelPriority(DMA0, 8, kDMA_ChannelPriority1);&lt;/P&gt;&lt;P&gt;DMA_CreateHandle(&amp;amp;s_slaveTxHandle, DMA0, 9);&amp;nbsp;&lt;/P&gt;&lt;P&gt;DMA_CreateHandle(&amp;amp;s_slaveRxHandle, DMA0, 8);&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt; //DMA_EnableChannelPeriphRq( DMA0, 8 );&lt;BR /&gt; //DMA_EnableChannelPeriphRq( DMA0, 9 );&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;NVIC_SetPriority(DMA0_IRQn, 2);&lt;/P&gt;&lt;P&gt;// Create handle for slave instance&lt;BR /&gt; SPI_SlaveTransferCreateHandleDMA(SPI0, &amp;amp;s_slaveHandle, SPI_SlaveUserCallback, NULL, &amp;amp;s_slaveTxHandle, &amp;amp;s_slaveRxHandle);&lt;/P&gt;&lt;P&gt;// Set slave transfer ready to receive/send data&lt;BR /&gt; s_xfer.txData = (uint8_t*) &amp;amp;s_txSpiCmd;&lt;BR /&gt; s_xfer.rxData = (uint8_t*) &amp;amp;s_rxSpiCmd;&lt;BR /&gt; s_xfer.dataSize = 3;&lt;/P&gt;&lt;P&gt;// Start SPI&lt;BR /&gt; SPI_SlaveTransferDMA(SPI0, &amp;amp;s_slaveHandle, &amp;amp;s_xfer);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2019 20:30:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-interrupt-issue/m-p/879939#M52215</guid>
      <dc:creator>jasonedn</dc:creator>
      <dc:date>2019-03-08T20:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: SPI DMA interrupt issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-interrupt-issue/m-p/879940#M52216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Hello,&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I see that you disable all interrupts, did you enable it back?&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Best Regards,&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;Aldo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2019 16:59:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-interrupt-issue/m-p/879940#M52216</guid>
      <dc:creator>AldoG</dc:creator>
      <dc:date>2019-03-11T16:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: SPI DMA interrupt issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-interrupt-issue/m-p/879941#M52217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aldo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I did enable it back, but it didn't work. Now I found that it was caused by DMA. When SPI DMA mode was disabled and only SPI interrupt was enabled, it worked properly. However I don't know the root cause. It was easy to reproduce. You can a simple DMA SPI slave application with FreeRTOS and jumps to itself after first run. The DAM interrupt works in the first time and doesn't after jumping.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2019 20:11:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-interrupt-issue/m-p/879941#M52217</guid>
      <dc:creator>jasonedn</dc:creator>
      <dc:date>2019-03-11T20:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: SPI DMA interrupt issue</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-interrupt-issue/m-p/879942#M52218</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 delay,&lt;/P&gt;&lt;P&gt;Could you share your test code?&lt;/P&gt;&lt;P&gt;If not a good idea would be de initialize the DMA and re initialize it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Aldo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Mar 2019 00:22:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-interrupt-issue/m-p/879942#M52218</guid>
      <dc:creator>AldoG</dc:creator>
      <dc:date>2019-03-16T00:22:38Z</dc:date>
    </item>
  </channel>
</rss>

