<?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: K64 SPI + DMA eats Data</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802193#M48784</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Early on in the application I write a 32 bit zero to the push register to properly load the upper 16 bits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since only DMA loads the SPI after the initial 32 bit zero is pushed -- the upper 16 bits never change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I manually set and clear the SPI chip select since it is normally in the upper 16 bits of the SPI Push register -- but I keep that at zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for thinking some more on this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Aug 2018 20:53:41 GMT</pubDate>
    <dc:creator>JHinkle</dc:creator>
    <dc:date>2018-08-21T20:53:41Z</dc:date>
    <item>
      <title>K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802188#M48779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm hoping someone can explain this behavior&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K64 SPI set for 8 bit transfers, FIFO disabled, fed by DMA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before the SPI process takes place -- as a note -- the CMD 16 bits of the SPI's Push Register is zero (0).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DMA is set for 8 bit transfers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No CMD pushed into the SPI by the application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SPI transfer is started by setting&amp;nbsp;DMA_SSRT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Source pointer of the DMA channel is pointing to memory which holds an array of bytes increasing by 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data array ===&amp;nbsp; &amp;nbsp;0,1,2,3,4,5 ..... 255&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use a logic probe to capture the actual SPI data and clock coming off the K64&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data on MOSI line is ====&amp;nbsp; 0,1,3,4,5 ... 255&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice byte three (3) of the input data (byte value 2) is eaten and never appears on the MOSI line out of the K64.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NXP/Freescale has never really published good documentation on using DMA with SPI and only pushing DATA - never the upper 16 bits of COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any published documentation that can explain this behavior?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas as to why byte 3 is ALWAYS eaten and never appears on the output?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp; the rest of the data is always transferred - independent of number of bytes -- the behavior is only at the start of the transfer and always byte 3&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;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Aug 2018 14:39:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802188#M48779</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-08-19T14:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802189#M48780</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;Please check below description about SPIx_PUSHR register write requirement:&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/63136iB062872B077A8700/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;When you are using DMA mode, it need to transfer all 32bits (command+8bit data) to this register at the same time.&lt;/P&gt;&lt;P&gt;Thank you for the attention.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Mon, 20 Aug 2018 06:42:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802189#M48780</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-08-20T06:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802190#M48781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply but I don't think your statement addresses the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see post&amp;nbsp;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/381726"&gt;https://community.nxp.com/thread/381726&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's on a K80 but I suspect the SPI and DMA cells are the same on a K64&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said in the post, the upper 16 bits of the push register are zero and I agree - they are passed to the SPI as a command.&amp;nbsp; A SPI command of zero (0) does not affect or explain the third byte missing from the output steam.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been using this SPI DMA combination for a while now.&amp;nbsp; I have a work-around that provides the first 3 bytes of the input with known data and the receiver ignores the first two bytes it receives.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping a long term Freescale engineer was still around that could explain why this occurs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2018 13:12:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802190#M48781</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-08-20T13:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802191#M48782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is helpful -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my DMA and SPI setup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[CODE]&lt;/P&gt;&lt;P&gt;********************************************&lt;/P&gt;&lt;P&gt;DMA&lt;/P&gt;&lt;P&gt;********************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DMA_CERQ = DMA_CERQ_CERQ(13) ; // now disable chan13 for triggers&lt;BR /&gt;DMA_TCD13_SOFF = 1; // 1 byte move address offset&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;DMA_TCD13_ATTR = DMA_ATTR_SMOD(0) | DMA_ATTR_SSIZE(0) | DMA_ATTR_DMOD(0) | DMA_ATTR_DSIZE(0); // no circular addressing S&amp;amp;D, 8 bit S&amp;amp;D&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;DMA_TCD13_NBYTES_MLNO = 1; // 8bit sample every minor loop&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;DMA_TCD13_NBYTES_MLOFFNO = 1;&lt;BR /&gt;DMA_TCD13_NBYTES_MLOFFYES = 1;&lt;BR /&gt;DMA_TCD13_SLAST = 0; // not needed -- IRQ will set new start&lt;BR /&gt;DMA_TCD13_DOFF = 0; // no offset - always spi xmit&lt;BR /&gt;DMA_TCD13_DLASTSGA = 0; // no final last adjustment ( does not move )&lt;BR /&gt;DMA_TCD13_CSR = DMA_CSR_INTMAJOR_MASK ; // interrupt when done&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;DMA_TCD13_DADDR = (dword)&amp;amp;SPI0_PUSHR;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********************************************&lt;/P&gt;&lt;P&gt;SPI&lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;SPI0_SR = 0xffff0000; // clear all pending status flags&lt;/P&gt;&lt;P&gt;SPI0_MCR = SPI_MCR_MSTR_MASK | // master mode&lt;BR /&gt;SPI_MCR_DIS_TXF_MASK |&lt;BR /&gt;SPI_MCR_CLR_RXF_MASK | SPI_MCR_CLR_TXF_MASK | // // clr both FIFO's .. debug&lt;BR /&gt;SPI_MCR_PCSIS(0); // no chip selects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My_SPI_RSER = SPI_RSER_TFFF_RE_MASK | SPI_RSER_TFFF_DIRS_MASK; // xmit avail dma flag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPI0_CTAR0 = SPI_CTAR_FMSZ(7) | // Data is 8 bits&lt;/P&gt;&lt;P&gt;SPI_CTAR_DBR_MASK | // double clock speed so baud is 12mhz&lt;/P&gt;&lt;P&gt;SPI_CTAR_CPOL_MASK | // Clock Polarity HI at Idle&lt;BR /&gt;SPI_CTAR_CPHA_MASK | // Clock Phase - out on leading edge, in on falling&lt;BR /&gt;SPI_CTAR_PCSSCK(0) | // delay prescaler - CS and Clock Edge&lt;BR /&gt;SPI_CTAR_PASC(0) | // delay prescaler - last clk edge and CS off&lt;BR /&gt;SPI_CTAR_PDT(0) | // delay prescaler between CS off and CS on -- between frames&lt;BR /&gt;SPI_CTAR_PBR(2) | // Bard Rate .. 2 == divide by 5 ... 60/5 = 12&lt;BR /&gt;SPI_CTAR_CSSCK(0) | // actual delay between CS and first clk edge&lt;BR /&gt;SPI_CTAR_ASC(0) | // actual delay last clk and CS off&lt;BR /&gt;SPI_CTAR_DT(0) | // actual delay between frames&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;SPI_CTAR_BR(0); // baud rate scaler ... 12 / 2 = 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DMA_TCD13_SADDR = (dword)Work.Data;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DMA_TCD13_CITER_ELINKNO = NumberOfBytes;&lt;BR /&gt;DMA_TCD13_BITER_ELINKNO = NumberOfBytes;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPI0_MCR |= SPI_MCR_CLR_TXF_MASK; // clear any waiting data&lt;/P&gt;&lt;P&gt;DMA_SERQ = DMA_SERQ_SERQ(13) ; // now enable chan13 for triggers&lt;/P&gt;&lt;P&gt;SPI0_RSER = My_SPI_RSER;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DMA_SSRT = DMA_SSRT_SSRT(13); // start transfer&lt;/P&gt;&lt;P&gt;[/CODE]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2018 17:50:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802191#M48782</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-08-20T17:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802192#M48783</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;From the posted code, I don't find there with any code to write the SPIx_PUSHR high 16-bit command filed.&lt;/P&gt;&lt;P&gt;Could you probe the SPI communication signals?&lt;/P&gt;&lt;P&gt;If there with chip select signal asserted during SPI communication?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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, 21 Aug 2018 05:32:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802192#M48783</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-08-21T05:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802193#M48784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Early on in the application I write a 32 bit zero to the push register to properly load the upper 16 bits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since only DMA loads the SPI after the initial 32 bit zero is pushed -- the upper 16 bits never change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I manually set and clear the SPI chip select since it is normally in the upper 16 bits of the SPI Push register -- but I keep that at zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for thinking some more on this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 20:53:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802193#M48784</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-08-21T20:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802194#M48785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have recorded the SPI communication signals?&lt;/P&gt;&lt;P&gt;With the SPI_TX signal we could analyze the actual communication behavior.&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/67230i0A545D49A5BF78D2/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;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Wed, 22 Aug 2018 02:46:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802194#M48785</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-08-22T02:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802195#M48786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for looking into this Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is a snap shot just before kicking off the SPI-DMA transfer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see the SPI code in the editor window, the array of data to be transferred in the bottom memory window, and all the SPI1 registers just prior to starting the process&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="SPI1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/67161i6AC32ED6EAD356B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="SPI1.png" alt="SPI1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the capture of that SPI transfer - notice that the output goes 0,1,3,4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The third byte should be 2 but its 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Logic1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/67200i95E765093F7D6A71/image-size/large?v=v2&amp;amp;px=999" role="button" title="Logic1.png" alt="Logic1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached pictures of the DMA registers for your review.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also included the complete logic probe capture should you want to dig into it further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.joehinkle.com/download/SPI Capture.logicdata"&gt;&lt;/A&gt;&lt;A href="http://www.joehinkle.com/download/SPI" target="test_blank"&gt;http://www.joehinkle.com/download/SPI&lt;/A&gt; Capture.logicdata&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.joehinkle.com/download/DMA20.png"&gt;http://www.joehinkle.com/download/DMA20.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.joehinkle.com/download/DMA21.png"&gt;http://www.joehinkle.com/download/DMA21.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.joehinkle.com/download/DMA22.png"&gt;http://www.joehinkle.com/download/DMA22.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.joehinkle.com/download/DMA23.png"&gt;http://www.joehinkle.com/download/DMA23.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.joehinkle.com/download/DMA24.png"&gt;http://www.joehinkle.com/download/DMA24.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/joehinkle.com/download/SPI Capture.logicdata"&gt;https://community.nxp.com/thread/joehinkle.com/download/SPI Capture.logicdata&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2018 13:27:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802195#M48786</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-08-22T13:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802196#M48787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the DMA register value, I could find there with error at channel 13:&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/67693i0415BA9E4E8835DA/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;The error type is a source read bus error.&lt;/P&gt;&lt;P&gt;From your DMA initialization code, what's the "dword" definition?&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/67779iB0B633375AF2B63B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Thu, 23 Aug 2018 07:47:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802196#M48787</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-08-23T07:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802197#M48788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't explain that DMA error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can tell you that I just ran the test above (code cycles every 25 msec writing out the test data) for the last hour with no DMA errors yet every run byte 3 of the input stream is missing from the output stream.&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;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2018 12:54:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802197#M48788</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-08-23T12:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802198#M48789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&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;Could you post your test project here?&lt;/P&gt;&lt;P&gt;If not possible, just post SPI0 and eDMA related code.&lt;/P&gt;&lt;P&gt;I will do a test on my site with FRDM-K64F board next week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2018 14:35:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802198#M48789</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-08-23T14:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802199#M48790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will create a bare-bones project that demonstrates the issue.&lt;/P&gt;&lt;P&gt;It may take me a day or two to accomplish.&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;Joe&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2018 21:04:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802199#M48790</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-08-23T21:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802200#M48791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Joe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2018 22:29:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802200#M48791</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-08-23T22:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802201#M48792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Link below is the most basic - bare-metal implementation of the test to illustrate the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use Crossworks as my development IDE so I don't think you can outright use the project but there are only a couple of files required to import the test into your own development IDE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running on a Custom K64 board that has a 25mhz oscillator.&amp;nbsp; Clocks.c is used to set the CPU clock to 120mhz.&amp;nbsp; Your implementation will change depending on the board you use to test and what crystal/oscillator is driving it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By default the SPI Push register comes up as Zero so there is no need to prime the upper 16 bits for command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for taking the time to investigate this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a side note - in the process of checking out this implementation I set my break point inside the actual&amp;nbsp;Perform_SPI_Xfer() and the output did NOT show the missing third byte.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is a puzzle!!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the real application does not pause keep your break point at the actual call to&amp;nbsp;Perform_SPI_Xfer() and let you logic probe capture the output -- no DMA errors, and byte 3 is missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Found out where the DMA error came from you earlier noted -- if you set break points within&amp;nbsp;&lt;SPAN&gt;Perform_SPI_Xfer()&amp;nbsp;you can cause the DMA error to set.&lt;/SPAN&gt;&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;Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.joehinkle.com/download/SPI_DMA_Test_Project.zip"&gt;http://www.joehinkle.com/download/SPI_DMA_Test_Project.zip&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 12:26:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802201#M48792</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-08-24T12:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802202#M48793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Never mind - I solved it.&lt;/P&gt;&lt;P&gt;It turn out the issue was me -- I think I was attempting to start the DMA twice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code that causes the issue ... from above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPI1_RSER = My_SPI_RSER; // spi serviced by dma&lt;/P&gt;&lt;P&gt;DMA_SSRT = DMA_SSRT_SSRT(12); // start transfer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turns out the DMA transfer is NOT started with the write to&amp;nbsp;&lt;SPAN&gt;DMA_SSRT&amp;nbsp;but starts with the write to&amp;nbsp;SPI1_RSER&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPI1_RSER = My_SPI_RSER; // spi serviced by dma&lt;/P&gt;&lt;P&gt;//DMA_SSRT = DMA_SSRT_SSRT(12); // start transfer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By removing the&amp;nbsp;&lt;SPAN&gt;DMA_SSRT&amp;nbsp; line -- all is correct and now well understood.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for helping.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Joe&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:55:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802202#M48793</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-08-24T14:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: K64 SPI + DMA eats Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802203#M48794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you let us know the root cause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 06:56:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-SPI-DMA-eats-Data/m-p/802203#M48794</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-08-27T06:56:34Z</dc:date>
    </item>
  </channel>
</rss>

