<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>rl-flashfs : fputs/fgets doesn&amp;#39;t works</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/28967/rl-flashfs-fputs-fgets-doesn-t-works</link><description> 
Hello, 
I&amp;#39;m trying to setup the flash-fs library with SPI SD-card on
STM32F100 device. 
I&amp;#39;ve modified the SPI_STM32F100x.c driver to match with SPI2 device
and needed I/O (CS, SD detect..) 

 
The finit(), fformat() and fopen() functions are working</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: rl-flashfs : fputs/fgets doesn't works</title><link>https://community.arm.com/thread/106304?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2012 07:35:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5ec825b4-767c-4bb7-afd4-25dbe82e6b3a</guid><dc:creator>F F</dc:creator><description>&lt;p&gt;&lt;p&gt;
Note that your test string:&lt;/p&gt;

&lt;pre&gt;
 // Write text in the file
 salut = fputs(&amp;quot;fhghr&amp;quot;, fout);
&lt;/pre&gt;

&lt;p&gt;
does not have one specific addition that the Keil string has:&lt;/p&gt;

&lt;pre&gt;
 fputs(&amp;quot;This is an example for fputs.\n&amp;quot;, fout);
&lt;/pre&gt;

&lt;p&gt;
i might be off base here, but as I remember it all strings need to
either be flushed or terminated with the carrage return to be written
to memory. When I tested this is a subtle distinction that is not
highlighted...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: rl-flashfs : fputs/fgets doesn't works</title><link>https://community.arm.com/thread/106317?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2012 07:07:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5deb611f-fee9-42d1-b2e4-1ce2f79a457c</guid><dc:creator>Fournier Micha&amp;#235;l</dc:creator><description>&lt;p&gt;&lt;p&gt;
In addition, the fgets() function is also returning 0 in case the
file exists on SD-Card. But I&amp;#39;m not able to read any content of this
file (I&amp;#39;ve created the file using a PC), the returned string is
null.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: rl-flashfs : fputs/fgets doesn't works</title><link>https://community.arm.com/thread/80492?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2012 07:04:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d7836be5-fbaf-48d4-aaed-cd42ec67195e</guid><dc:creator>Fournier Micha&amp;#235;l</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thank&amp;#39;s for your help.&lt;br /&gt;
But this doesn&amp;#39;t change anything and the return code of fputs is
always 0, what means that the function terminates correctly...&lt;br /&gt;
When I look on SPI signals, this is no activity during fputs()
function execution. On fclose() function, some frames are sent but I
don&amp;#39;t see any data stream with expected content.&lt;br /&gt;
I think the library is not writting anything on the SD card during
fputs() execution..&lt;/p&gt;

&lt;p&gt;
Bests regards&lt;/p&gt;

&lt;p&gt;
Micha&amp;euml;l&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: rl-flashfs : fputs/fgets doesn't works</title><link>https://community.arm.com/thread/61057?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2012 06:45:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:37ca6820-6208-491f-8c38-03e33419db83</guid><dc:creator>F F</dc:creator><description>&lt;p&gt;&lt;p&gt;
Keil example. Notice the difference from yours:&lt;/p&gt;

&lt;pre&gt;
#include &amp;lt;rtl.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;

void tst_fputs (void) {
  FILE *fout;

  fout = fopen (&amp;quot;Test.txt&amp;quot;,&amp;quot;w&amp;quot;);
  if (fout != NULL) {
    fputs(&amp;quot;This is an example for fputs.\n&amp;quot;, fout);
    fclose (fout);
  }
}
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>