<?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 Software Development KitのトピックRe: How to write / read data to a USB memory stick by using KSDK and Processor Expert</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430028#M2480</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you take a look at the example code sdbench and &lt;STRONG&gt;mfs_benchmark.c&lt;/STRONG&gt; there are operations with file.&lt;/P&gt;&lt;P&gt;There are no operations as fopen, fclose etc., they were replaced by new ones :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;operation for open file&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14393899720209570" data-renderedposition="155_8_1231_16" jivemacro_uid="_14393899720209570" modifiedtitle="true"&gt;&lt;P&gt;file_ptr = open(file_name, write_mode);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;operation for write&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14393903376583823" data-renderedposition="213_8_1231_16" jivemacro_uid="_14393903376583823"&gt;&lt;P&gt;wr = write(file_ptr, data_ptr, block_size);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;operation for read&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14393902549947265" data-renderedposition="271_8_1231_16" jivemacro_uid="_14393902549947265"&gt;&lt;P&gt;rd = read(file_ptr, data_ptr, block_size);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;operation for close&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14393903750989961 jive_text_macro" data-renderedposition="329_8_1231_16" jivemacro_uid="_14393903750989961"&gt;&lt;P&gt;close(file_ptr);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Iva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Aug 2015 14:42:43 GMT</pubDate>
    <dc:creator>ivadorazinova</dc:creator>
    <dc:date>2015-08-12T14:42:43Z</dc:date>
    <item>
      <title>How to write / read data to a USB memory stick by using KSDK and Processor Expert</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430025#M2477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm starting a new project and I need to implement a data logger in a USB memory stick with K22, but I'm not very experienced in this area, I found the documentation of the KSDK drivers API, but I don't know which function to use to correctly do it.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found an interesting document posted in this Community, explaining step by step how to quickly create a RAM disk demo with KSDK and Processor Expert, that can be used as reference and adapt to my application needs, but this demo only formats the memory stick.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still don't know how to create, open, close and manipulate files into the USB memory stick, and write and read data to / from USB memory stick, by using the available KSDK API functions.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody guide me on that or provide me with some examples?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and best regards,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marco Coelho&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 21:14:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430025#M2477</guid>
      <dc:creator>MAPC</dc:creator>
      <dc:date>2015-08-11T21:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to write / read data to a USB memory stick by using KSDK and Processor Expert</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430026#M2478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;examples for USB are located at &amp;lt;ksdk_path&amp;gt;\examples\frdmk22f\demo_apps\usb&lt;/P&gt;&lt;P&gt;There are examples for both - device and host, and the documentation for USB Stack is under folder doc\usb&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, look at the examples sdbench and sdcard located at &amp;lt;ksdk_path&amp;gt;\middleware\filesystem\mfs\examples&lt;/P&gt;&lt;P&gt;there are example without PEx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In other case FatFS and SDHC data logger example is here&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-105852"&gt;FatFs + SDHC data logger with KSDK in Kinetis Design Studio&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;Iva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:42:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430026#M2478</guid>
      <dc:creator>ivadorazinova</dc:creator>
      <dc:date>2015-08-12T13:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to write / read data to a USB memory stick by using KSDK and Processor Expert</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430027#M2479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Iva&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this demo, a list of commands are executed, including Write and Read commands in the USB memory stick, but it seems that it doesn't create a .txt file before. As far as I understand the correct way to do it is creating a file and then write / read to / from the file inside the USB memory stick. So, I don't understand how this demo works and I didn't find any document explaining these commands in detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I'm not sure if this stack supports functions like fopen, fmount, putchar, getchar to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Could you put it in more detail to me, please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 14:19:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430027#M2479</guid>
      <dc:creator>MAPC</dc:creator>
      <dc:date>2015-08-12T14:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to write / read data to a USB memory stick by using KSDK and Processor Expert</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430028#M2480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you take a look at the example code sdbench and &lt;STRONG&gt;mfs_benchmark.c&lt;/STRONG&gt; there are operations with file.&lt;/P&gt;&lt;P&gt;There are no operations as fopen, fclose etc., they were replaced by new ones :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;operation for open file&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14393899720209570" data-renderedposition="155_8_1231_16" jivemacro_uid="_14393899720209570" modifiedtitle="true"&gt;&lt;P&gt;file_ptr = open(file_name, write_mode);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;operation for write&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14393903376583823" data-renderedposition="213_8_1231_16" jivemacro_uid="_14393903376583823"&gt;&lt;P&gt;wr = write(file_ptr, data_ptr, block_size);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;operation for read&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14393902549947265" data-renderedposition="271_8_1231_16" jivemacro_uid="_14393902549947265"&gt;&lt;P&gt;rd = read(file_ptr, data_ptr, block_size);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;operation for close&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14393903750989961 jive_text_macro" data-renderedposition="329_8_1231_16" jivemacro_uid="_14393903750989961"&gt;&lt;P&gt;close(file_ptr);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Iva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 14:42:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430028#M2480</guid>
      <dc:creator>ivadorazinova</dc:creator>
      <dc:date>2015-08-12T14:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to write / read data to a USB memory stick by using KSDK and Processor Expert</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430029#M2481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marco Aurelio:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need the USB MSD Host class and also a file system for the file operations (f_open, f_write, etc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take the example from KSDK v1.2 at the next path:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Freescale\KSDK_1.2.0\examples\frdmk22f\demo_apps\usb\host\msd\msd_fatfs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To compile that example you first need to build the SDK platform library and USB Host library. Refer to the file &lt;STRONG&gt;Integration of the USB&lt;/STRONG&gt;&lt;STRONG&gt; Stack annd Kinetis SDK&lt;/STRONG&gt; on how to build the required libraries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us know if you have issues or doubts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 20:43:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-write-read-data-to-a-USB-memory-stick-by-using-KSDK-and/m-p/430029#M2481</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-08-12T20:43:11Z</dc:date>
    </item>
  </channel>
</rss>

