<?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: f_lseek returning FR_INT_ERR</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/f-lseek-returning-FR-INT-ERR/m-p/429485#M2463</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for replying on this issue.&amp;nbsp; I was able to get the copying to recover and continue.&amp;nbsp; I am still bothered that&lt;/P&gt;&lt;P&gt;I don't understand why f_lseek is still reporting this issue??&amp;nbsp; If you have the handle to the file this shouldn't happen&lt;/P&gt;&lt;P&gt;and if you loose it and recover from it, it shouldn't occur repeatedly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This also is really concerning, I am aware that this was written by someone else, but is troubling that nobody has ran &lt;/P&gt;&lt;P&gt;into this issue?&amp;nbsp; Maybe as usual I am doing something wrong or forgot to include something, I am referring to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;//f_closedir(&amp;amp;dir);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;----------------------------************* notice this I have to comment or else the compiler complains ****************************&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;I don't know if that is what your addressing above with the linker file and __stack_size__&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Please let me know what you find on this.&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Neil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Oct 2015 16:17:04 GMT</pubDate>
    <dc:creator>neilporven</dc:creator>
    <dc:date>2015-10-12T16:17:04Z</dc:date>
    <item>
      <title>f_lseek returning FR_INT_ERR</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/f-lseek-returning-FR-INT-ERR/m-p/429483#M2461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to read from an SD card and I am using the FatFs driver on the SDK.&amp;nbsp; I am using a demo&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FatFs + SDHC data logger demo with KSDK By: Jorge Gonzalez&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that at any random given time after a f_lseek the function is returning FR_INT_ERR&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FR_INT_ERR - &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: serif; font-size: medium; background-color: #e0ffff;"&gt;Assertion failed. An insanity is detected in the internal process. One of the following possibilities is suspected.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Work area (file system object, file object or etc...) has been broken by stack overflow or any other tasks. This is the reason in most case.&lt;/LI&gt;&lt;LI&gt;There is any error of the FAT structure on the volume.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: serif; font-size: medium; background-color: #e0ffff;"&gt;Note that if once this error occured at any operation to an open file, the file object is aborted and all operations to the file except for close will be rejected.&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 style="color: #000000; font-family: serif; font-size: medium; background-color: #e0ffff;"&gt;The above was taken from &lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Felm-chan.org%2Ffsw%2Fff%2Fen%2Frc.html%23ie" rel="nofollow" target="_blank"&gt;FatFs - Return Codes &lt;/A&gt;, I have no idea what the above means, but better yet, it doesn't explain what to do in the event you get &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: serif; font-size: medium; background-color: #e0ffff;"&gt;this error????&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 style="color: #000000; font-family: serif; font-size: medium; background-color: #e0ffff;"&gt;Why am I getting this error, if everything works fine for about say 80K, then the above starts happening???&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 style="color: #000000; font-family: serif; font-size: medium; background-color: #e0ffff;"&gt;I don't think it has to do with my opening and closing the dir (which I am having an issue with, because it doesn't let me place f_closedir(&amp;amp;dir); anywhere)&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 style="color: #000000; font-family: serif; font-size: medium; background-color: #e0ffff;"&gt;Here is the sample code for the directory bit:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DIR&amp;nbsp; dir;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Initialize&lt;/P&gt;&lt;P&gt;&amp;nbsp; iDir_Return = 0; //We collected info&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;&amp;nbsp; fr = f_opendir(&amp;amp;dir, ""); // Open the directory&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;&amp;nbsp; //Check if the directory open&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (fr == FR_OK)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {//Begin if (directory open)&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fr = f_readdir(&amp;amp;dir, &amp;amp;DirInfo); // Read a directory item&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Read the directory&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (fr == FR_OK)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {//Begin (read directory)&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Extract SD card directory filename&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(int i=0; i &amp;lt;= 13; i++)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SD_info.file_name[i] = DirInfo.fname[i];&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SD_info.file_attribute = DirInfo.fattrib;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SD_info.file_size =&amp;nbsp; DirInfo.fsize;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //info = DirInfo.fdate;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //strftime(SD_info.date_modified,8,"%x", info);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //strftime(SD_info.time_modified,8,"%X", DirInfo.ftime);&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }//End (read directory)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SD_info.FatFs_status = &amp;amp;ccRead_dir[0]; //Report status (could not read directory)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iDir_Return = 1; //Couldn't collect info&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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 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 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;&amp;nbsp;&amp;nbsp; }//End if (directory open)&lt;/P&gt;&lt;P&gt;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SD_info.FatFs_status = &amp;amp;ccOpen_dir_f[0]; //Report status (could not open directory)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iDir_Return = 1; //Couldn't collect info&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&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;//f_closedir(&amp;amp;dir);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;----------------------------************* notice this I have to comment or else the compiler complains ****************************&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //printf("\nDate(mm/dd/yy):%02u/%02u/%02u\r\n",DirInfo.fdate.Bits.month,DirInfo.fdate.Bits.day,(DirInfo.fdate.Bits.year + 1980));&lt;/P&gt;&lt;P&gt;&amp;nbsp; //printf("\nTime:%02u:%02u:%02u\r\n\r\n",DirInfo.ftime.Bits.hour,DirInfo.ftime.Bits.minute,DirInfo.ftime.Bits.second);&lt;/P&gt;&lt;P&gt; return(iDir_Return);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if it has to do anything with the f_lseek issue I am having...........Need help&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 04:33:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/f-lseek-returning-FR-INT-ERR/m-p/429483#M2461</guid>
      <dc:creator>neilporven</dc:creator>
      <dc:date>2015-10-02T04:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: f_lseek returning FR_INT_ERR</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/f-lseek-returning-FR-INT-ERR/m-p/429484#M2462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Neil:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you still having this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is hard to explain but if the error description points in the right direction, then I would try increasing the project's stack size.&lt;/P&gt;&lt;P&gt;This can be done from the linker file (&lt;STRONG&gt;.ld&lt;/STRONG&gt; file) and in KDS it should be called __stack_size__. Sometimes however the value is overwritten by a flag in the project linker options (Project -&amp;gt; Properties -&amp;gt; C/C++ Build -&amp;gt; Settings -&amp;gt; Cross ARM C++ Linker -&amp;gt; Miscellaneous -&amp;gt; Other linker flags). See this &lt;A href="http://mcuoneclipse.com/2014/08/12/overwriting-symbols-in-the-gnu-linker-file/"&gt;&lt;STRONG&gt;tutorial&lt;/STRONG&gt;&lt;/A&gt;.&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>Thu, 08 Oct 2015 23:04:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/f-lseek-returning-FR-INT-ERR/m-p/429484#M2462</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-10-08T23:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: f_lseek returning FR_INT_ERR</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/f-lseek-returning-FR-INT-ERR/m-p/429485#M2463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for replying on this issue.&amp;nbsp; I was able to get the copying to recover and continue.&amp;nbsp; I am still bothered that&lt;/P&gt;&lt;P&gt;I don't understand why f_lseek is still reporting this issue??&amp;nbsp; If you have the handle to the file this shouldn't happen&lt;/P&gt;&lt;P&gt;and if you loose it and recover from it, it shouldn't occur repeatedly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This also is really concerning, I am aware that this was written by someone else, but is troubling that nobody has ran &lt;/P&gt;&lt;P&gt;into this issue?&amp;nbsp; Maybe as usual I am doing something wrong or forgot to include something, I am referring to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;//f_closedir(&amp;amp;dir);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;----------------------------************* notice this I have to comment or else the compiler complains ****************************&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;I don't know if that is what your addressing above with the linker file and __stack_size__&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Please let me know what you find on this.&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Neil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 16:17:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/f-lseek-returning-FR-INT-ERR/m-p/429485#M2463</guid>
      <dc:creator>neilporven</dc:creator>
      <dc:date>2015-10-12T16:17:04Z</dc:date>
    </item>
  </channel>
</rss>

