<?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 USB host MSD Hard Fault in K20 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-MSD-Hard-Fault-in-K20/m-p/219512#M3926</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is as follows:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I adapted one of the examples to work with USB Stack Processor Expert, specifically "C:\Freescale\Freescale USB Stack v4.0.3\Source\Host\examples\msd_mfs_generic\cw10\kinetis_k20". I've checked the processor clock settings, I used the USB Host Stack component of the PE.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way I adapted was creating a new project in PE and adding the libraries used in the example. I also put the pin PTC9 to 1 to enable the USB 5V.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything compiles, the USB get interface.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mount the file system, &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;f_result = f_mount(HOST_CONTROLLER_NUMBER, &amp;amp;fatfs);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when I try to open a file or do any "MFS" operation &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;f_result = f_open(&amp;amp;archivo, "/Test.txt", FA_READ);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Hard Fault. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sometimes instead of a Hard Fault the program continues to run but the function f_mount returns error:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;FR_DISK_ERR,&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;/* (1) A hard error occured in the low level disk I/O layer */&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's related to "diskio.c"&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried a PE component made by Erich Styger to trace HardFaults and trace the last executed code to a function in 'hostmain.c'.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a little confused and don't know where to find.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached the source code to see if someone can give me a hand.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Sorry for spelling errors or syntax, (I do best reading in english than writing)&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-337416"&gt;TestUSB-MSD.rar.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Jan 2013 09:55:34 GMT</pubDate>
    <dc:creator>carxander</dc:creator>
    <dc:date>2013-01-01T09:55:34Z</dc:date>
    <item>
      <title>USB host MSD Hard Fault in K20</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-MSD-Hard-Fault-in-K20/m-p/219512#M3926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is as follows:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I adapted one of the examples to work with USB Stack Processor Expert, specifically "C:\Freescale\Freescale USB Stack v4.0.3\Source\Host\examples\msd_mfs_generic\cw10\kinetis_k20". I've checked the processor clock settings, I used the USB Host Stack component of the PE.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way I adapted was creating a new project in PE and adding the libraries used in the example. I also put the pin PTC9 to 1 to enable the USB 5V.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything compiles, the USB get interface.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mount the file system, &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;f_result = f_mount(HOST_CONTROLLER_NUMBER, &amp;amp;fatfs);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when I try to open a file or do any "MFS" operation &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;f_result = f_open(&amp;amp;archivo, "/Test.txt", FA_READ);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Hard Fault. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sometimes instead of a Hard Fault the program continues to run but the function f_mount returns error:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;FR_DISK_ERR,&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;/* (1) A hard error occured in the low level disk I/O layer */&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's related to "diskio.c"&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried a PE component made by Erich Styger to trace HardFaults and trace the last executed code to a function in 'hostmain.c'.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a little confused and don't know where to find.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached the source code to see if someone can give me a hand.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Sorry for spelling errors or syntax, (I do best reading in english than writing)&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-337416"&gt;TestUSB-MSD.rar.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jan 2013 09:55:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-MSD-Hard-Fault-in-K20/m-p/219512#M3926</guid>
      <dc:creator>carxander</dc:creator>
      <dc:date>2013-01-01T09:55:34Z</dc:date>
    </item>
  </channel>
</rss>

