<?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: DSPI Master Transfer in KSDK 2.0? in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/DSPI-Master-Transfer-in-KSDK-2-0/m-p/603830#M6199</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Found it, looks like my config flags were off.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Sep 2016 19:27:29 GMT</pubDate>
    <dc:creator>mooreken</dc:creator>
    <dc:date>2016-09-09T19:27:29Z</dc:date>
    <item>
      <title>DSPI Master Transfer in KSDK 2.0?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/DSPI-Master-Transfer-in-KSDK-2-0/m-p/603829#M6198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I was wondering if anyone else had run into this kind of issue working the DSPI_MasterTransferBlocking function in the latest version of the KSDK. I am working on with a SPI EEPROM chip and a MK22FN512VLL12, essentially I have a function that accepts a pointer to a struct, the size of that struct in bytes, and the starting location in EEPROM to write to.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;uint8_t read_eeprom( void *setup, uint16_t size, uint16_t addr)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DSPI_MasterTransferBlocking function needs the SPI_Type pointer and a pointer to the dspi_transfer_t struct. This struct is created in the following fashion.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dspi_transfer_t eeprom_command;&lt;/P&gt;&lt;P&gt;eeprom_command.txData = (uint8_t *) calloc(200, sizeof(uint8_t));&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;eeprom_command.rxData = (uint8_t *) calloc(200, sizeof(uint8_t));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Next, I populate the eeprom transfer data (txData) with the contents of the read command and the address.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;eeprom_command.txData[0] = 0x03; //read command&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;eeprom_command.txData[1] = (uint8_t) (addr &amp;gt;&amp;gt; 8);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;eeprom_command.txData[2] = (uint8_t) (addr &amp;amp; 0x00FF);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now here's where I have my first question, the dataSize field in the dspi_transfer_t struct. I assume this pertains to both the transfer data and the received data. Or does this field only for the txData length?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;eeprom_command.dataSize = size + 3? or just 3?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Next is the configFlags field, set this to (kDSPI_MasterCtar1 | kDSPI_MasterPcs1) based off hardware. Then I enable the EEPROM chip select and send the command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DSPI_MasterTransferBlocking(SPI1, &amp;amp;eeprom_command);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I read 0xFF in all the rxData locations... I have a KSDK 1.3 version of this code as well, so I used that to write data and used 2.0 to read that data back.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help is appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2016 16:10:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/DSPI-Master-Transfer-in-KSDK-2-0/m-p/603829#M6198</guid>
      <dc:creator>mooreken</dc:creator>
      <dc:date>2016-09-08T16:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: DSPI Master Transfer in KSDK 2.0?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/DSPI-Master-Transfer-in-KSDK-2-0/m-p/603830#M6199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Found it, looks like my config flags were off.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 19:27:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/DSPI-Master-Transfer-in-KSDK-2-0/m-p/603830#M6199</guid>
      <dc:creator>mooreken</dc:creator>
      <dc:date>2016-09-09T19:27:29Z</dc:date>
    </item>
  </channel>
</rss>

