<?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>Kinetis Microcontrollers中的主题 Re: K60 SPI In DMA Mode has TX Underflows</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SPI-In-DMA-Mode-has-TX-Underflows/m-p/339858#M16318</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was very helpful. While it was not 100% of my problem, it helped point me to another logic error in my code. Now the same thing is occurring but only at temperatures above 45 deg C!&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;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Dec 2014 00:33:30 GMT</pubDate>
    <dc:creator>norton256</dc:creator>
    <dc:date>2014-12-19T00:33:30Z</dc:date>
    <item>
      <title>K60 SPI In DMA Mode has TX Underflows</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SPI-In-DMA-Mode-has-TX-Underflows/m-p/339856#M16316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm currently running into a problem where the SPI on some boards run into TX underflows when configured to use DMA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My K60 is set up for the SPI to run in slave mode, 16 bits, with ~6MHz clock from master device. The DMA channel is configured to use scatter gather, so that all I really need to do in the interrupt is set the request enable for that DMA channel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am finding is that the SPI peripheral triggers a TX Underflow interrupt in the middle of a DMA transfer!?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a dump of the TCD when the underflow occurs:&lt;/P&gt;&lt;P&gt;Breakpoint 4, SpiIntIsr (arg=0) at Spi.c:1826&lt;/P&gt;&lt;P&gt;1826&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inst_handle-&amp;gt;mErrorTxUnderflow++;&lt;/P&gt;&lt;P&gt;$7 = {SADDR = 0x1fff5e24, SOFF = 0x4, ATTR = 0x202, {NBYTES_MLNO = 0x4, NBYTES_MLOFFNO = 0x4, NBYTES_MLOFFYES = 0x4}, SLAST = 0x0, DADDR = 0x4002c034, DOFF = 0x0, {CITER_ELINKNO = 0x1fb, CITER_ELINKYES = 0x1fb}, DLAST_SGA = 0x0, CSR = 0xa, {BITER_ELINKNO = 0x200, BITER_ELINKYES = 0x200}}&lt;/P&gt;&lt;P&gt;(gdb) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running bare metal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 15:31:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SPI-In-DMA-Mode-has-TX-Underflows/m-p/339856#M16316</guid>
      <dc:creator>norton256</dc:creator>
      <dc:date>2014-12-10T15:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SPI In DMA Mode has TX Underflows</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SPI-In-DMA-Mode-has-TX-Underflows/m-p/339857#M16317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have other burst mode DMA taking place? If you do you may need to set up the crossbar switch to allow peripheral DMA to get a share of the bandwidth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use a lot of memory to memory DMA and could see that the USB peripheral was aborting often (having to repeat) because its output was underflowing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By switching the crossbar switch to round-robin mode (rather than allowing higher priority sources to have full bandwidth during bursts) allowed them to all live peacefully together again. Something like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AXBS_CRS0 = AXBS_CRS_ARB_ROUND_ROBIN;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AXBS_CRS1 = AXBS_CRS_ARB_ROUND_ROBIN; // flash and SRAM slaves priority set to rotating so that SW DMA transfers don't block peripheral transfers&lt;/STRONG&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>Thu, 11 Dec 2014 03:14:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SPI-In-DMA-Mode-has-TX-Underflows/m-p/339857#M16317</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-12-11T03:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SPI In DMA Mode has TX Underflows</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SPI-In-DMA-Mode-has-TX-Underflows/m-p/339858#M16318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was very helpful. While it was not 100% of my problem, it helped point me to another logic error in my code. Now the same thing is occurring but only at temperatures above 45 deg C!&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;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 00:33:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SPI-In-DMA-Mode-has-TX-Underflows/m-p/339858#M16318</guid>
      <dc:creator>norton256</dc:creator>
      <dc:date>2014-12-19T00:33:30Z</dc:date>
    </item>
  </channel>
</rss>

