<?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: ksdk spi slave erroneous data - out of sync in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504262#M4937</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to get the sdk 1.3 non-blocking example code working.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The example code had to be modified to get it work with SPI1.&amp;nbsp; in hardware_init() function where the where it is hard coded for spi0 "configure_spi_pins(0);)" and should be a variable based upon the selected instance in main.&amp;nbsp; Second in order to get SPI1 to work I had to enable the clock for portd "CLOCK_SYS_EnablePortClock(PORTD_IDX);".&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it appears that there is a problem with the processor expert generated code.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jan 2016 15:52:17 GMT</pubDate>
    <dc:creator>mjg8t</dc:creator>
    <dc:date>2016-01-22T15:52:17Z</dc:date>
    <item>
      <title>ksdk spi slave erroneous data - out of sync</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504260#M4935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having issues with received slave spi data on the k22f using KSDK 1.3 and processor expert.&amp;nbsp; I have simplified the project using 2 frdm-k22f boards one as master and one as slave.&amp;nbsp; The master send 8 bytes of data 1-8 and I check on the slave to see that it received it.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The recieve data is not correct and sometime is will miss a byte being sent.&amp;nbsp; It misses 0d05 consistently.&amp;nbsp; When 5 is missed the rx does not know that the frame has finished and recieves the first part of the next frame.&amp;nbsp; It seems to be a timing issue, but I checked the phase,polarties and even slowed the master clock to a snails pace of 130Khz.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked at the data on the scope and the tx data is fine.&amp;nbsp; See attachment to see the 0d05 value being sent (but no received on the slave).&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked at the slave registers and the only thing that looks funny is that the SR.TFUF.&amp;nbsp; Though the sdk api sends a successful return.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have simplified the project to 8 bytes from 16 where the more bytes are missed and things get worse.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas what is wrong?&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;#define SPI_BLOCKING 1 #define SPIS_BUF_SIZE 8&amp;nbsp;&amp;nbsp; //volatile uint8_t spisTxBuf[SPIS_BUF_SIZE] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; //tx on MISO volatile uint8_t spisTxBuf[SPIS_BUF_SIZE] = { 0, 1, 2, 3, 4, 5, 6, 7 }; //tx on MISO volatile uint8_t spisRxBuf[SPIS_BUF_SIZE] = { 0 }; //received from MOSI dspi_status_t result;&lt;/PRE&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;#ifdef SPI_BLOCKING &amp;nbsp; result = DSPI_DRV_SlaveTransferBlocking(SPI1_IDX, // number of SPI peripheral &amp;nbsp; spisTxBuf, // pointer to transmit buffer, can be NULL &amp;nbsp; spisRxBuf, // pointer to receive buffer, can be NULL &amp;nbsp; SPIS_BUF_SIZE, // size of receive and receive data &amp;nbsp; 1000); // Time out after 1000ms &amp;nbsp; if (result != kStatus_DSPI_Success) { &amp;nbsp; __asm("NOP"); &amp;nbsp; } #else&amp;nbsp;&amp;nbsp; &amp;nbsp; //non-blocking &amp;nbsp; result = DSPI_DRV_SlaveTransfer(SPI1_IDX,// number of SPI peripheral &amp;nbsp; spisTxBuf,// pointer to transmit buffer, can be NULL &amp;nbsp; spisRxBuf,// pointer to receive buffer, can be NULL &amp;nbsp; SPIS_BUF_SIZE// size of receive and receive data &amp;nbsp; );&amp;nbsp;&amp;nbsp; &amp;nbsp; // Wait for transfer completion &amp;nbsp; while(kStatus_DSPI_Success != DSPI_DRV_SlaveGetTransferStatus(SPI1_IDX, NULL)); #endif&amp;nbsp;&amp;nbsp; &amp;nbsp; __asm("NOP"); //breakpoint to inpect data &amp;nbsp; clearRxArray();&amp;nbsp;&amp;nbsp; &amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ksdk 1.3&lt;/P&gt;&lt;P&gt;kds 3&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338921" rel="nofollow noopener noreferrer" target="_blank"&gt;DEBUG_K22F_SPI_SLAVE.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338921" rel="nofollow noopener noreferrer" target="_blank"&gt;DEBUG_K22F_SPI_MASTER.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 23:33:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504260#M4935</guid>
      <dc:creator>mjg8t</dc:creator>
      <dc:date>2016-01-20T23:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: ksdk spi slave erroneous data - out of sync</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504261#M4936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you test the SPI demo under KSDK1.3 on your board ?&lt;/P&gt;&lt;P&gt;KSDK_1.3.0\examples\frdmk22f\driver_examples\dspi &lt;/P&gt;&lt;P&gt;Whether it can work well ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2016 09:15:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504261#M4936</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-01-22T09:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: ksdk spi slave erroneous data - out of sync</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504262#M4937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to get the sdk 1.3 non-blocking example code working.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The example code had to be modified to get it work with SPI1.&amp;nbsp; in hardware_init() function where the where it is hard coded for spi0 "configure_spi_pins(0);)" and should be a variable based upon the selected instance in main.&amp;nbsp; Second in order to get SPI1 to work I had to enable the clock for portd "CLOCK_SYS_EnablePortClock(PORTD_IDX);".&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it appears that there is a problem with the processor expert generated code.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2016 15:52:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504262#M4937</guid>
      <dc:creator>mjg8t</dc:creator>
      <dc:date>2016-01-22T15:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: ksdk spi slave erroneous data - out of sync</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504263#M4938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please connect the GND( the J2 pin 14 ) from one board to another board , then have a try.&lt;/P&gt;&lt;P&gt;If it still can not work , i will create one new project about SPI on KDS-PE tomorrow , and today&lt;/P&gt;&lt;P&gt;i don't know where is wrong , when i run your project on my side , the slave can received nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 11:36:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504263#M4938</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-01-25T11:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: ksdk spi slave erroneous data - out of sync</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504264#M4939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the reply.&amp;nbsp; I have had gnd connected from board to board in all tests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been able to reproduce the same problem with the sdk example projects master/slave non-blocking at a high enough frequency of baud rate.&amp;nbsp; In order to use the drivers on my custom board I was not BOARD_ClockInit();, but was running of the default internal osc.&amp;nbsp; This was slow enough to cause the sdk drivers to fail at a baud rate of 1Mhz with the SDK drivers.&amp;nbsp; It appears I will have to use the pll to increase the internal clock to get the performance I need. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2016 15:58:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504264#M4939</guid>
      <dc:creator>mjg8t</dc:creator>
      <dc:date>2016-01-25T15:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: ksdk spi slave erroneous data - out of sync</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504265#M4940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp; Michael,&lt;/P&gt;&lt;P&gt;Today , i test your project on my side again , it can work well use the default clock rate .&lt;/P&gt;&lt;P&gt;And i also configure it to 1M , it can work well also .&lt;/P&gt;&lt;P&gt;&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/22197i9D0E653A62BD25AE/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&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/22156i506536F8836CBC9B/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&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/22485i9BF4FC6AFBABF45E/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Alice Yang&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, 27 Jan 2016 03:08:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/ksdk-spi-slave-erroneous-data-out-of-sync/m-p/504265#M4940</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-01-27T03:08:56Z</dc:date>
    </item>
  </channel>
</rss>

