<?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>how to save data into file in keil IDE</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/40115/how-to-save-data-into-file-in-keil-ide</link><description> 
hi 
I want to save my intermediate data into a file. 
I tried to use fopen, fwrite, it can not even read. how should i use
rtl.h ? 

 
 int count[10];
 FILE *fout;

 fout = fopen (&amp;quot;Counter.bin&amp;quot;,&amp;quot;w&amp;quot;);
 if (fout != NULL) {
 fwrite (&amp;amp;count[0], sizeof </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: how to save data into file in keil IDE</title><link>https://community.arm.com/thread/145489?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2013 09:43:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:49789e54-98e9-4caa-85dc-a399c9bbb9b0</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Another thing to consider, is to have the program store the data
you want to save into a RAM buffer or known address. Let the debugger
retrieve this data and save to file. On another run, load this file
and have the debugger send it to the RAM of your device.&lt;/p&gt;

&lt;p&gt;
So similar operations as when programming, or reading, the
contents of the flash memory.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to save data into file in keil IDE</title><link>https://community.arm.com/thread/143368?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2013 09:41:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c9d24fe8-b4d1-483c-939e-1426f6c17c71</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
If you skip fopen() etc, then yes. There are support for having
Cortex chips &amp;quot;print&amp;quot; debug data to the debugger. Documentation
available on this site.&lt;/p&gt;

&lt;p&gt;
For other chips, the normal route is to just connect printf() to a
serial port and then log all data sent out on that port.&lt;/p&gt;

&lt;p&gt;
But then we are talking about strict write of data on a stream.
You did also mention &amp;quot;read&amp;quot; in your original post. If you need
two-way communication, then it&amp;#39;s time to implement a server
application and use RS232, USB, Ethernet, ... to communicate between
your device and the server. Then you can do whatever you want.
Including having the server &amp;quot;tunnel&amp;quot; accesses to the file system of a
PC.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to save data into file in keil IDE</title><link>https://community.arm.com/thread/131957?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2013 09:14:54 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ec31302b-fa6b-4701-b0ec-a52275479c89</guid><dc:creator>Richard Lau</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks for your link. it seems like that I have to set the .ini
file with creation of the exec(&amp;quot;save&amp;quot;) and button.&lt;/p&gt;

&lt;p&gt;
I understand that &amp;quot;Embedded products normally don&amp;#39;t have any
fopen(), fread(), ... because there are normally no standard hardware
available to store files.&amp;quot;&lt;/p&gt;

&lt;p&gt;
why could not we use potential stream functions (if not fopen,
fwrite )in the simulation mode to save the data to a file? should I
have to run in specific mode or use some special library?&lt;/p&gt;

&lt;p&gt;
Keil IDE should be able to do so, theoretically, it is doable
.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to save data into file in keil IDE</title><link>https://community.arm.com/thread/128070?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2013 10:22:52 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7fab9b80-1102-4601-91ee-88d14ab7a3a2</guid><dc:creator>Richard Lau</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks for reply!&lt;/p&gt;

&lt;p&gt;
I want to save a long array into a file, this file can be .hex or
.bin format.&lt;br /&gt;
it is good to do this in the c coding.&lt;/p&gt;

&lt;p&gt;
The LOG or SLOG are the commands, similar as SAVE. can you give an
example about your suggestion?&lt;/p&gt;

&lt;p&gt;
Thanks again.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to save data into file in keil IDE</title><link>https://community.arm.com/thread/119994?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2013 12:43:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:39fa4cfc-ee36-4b8c-9f98-df685af77b0a</guid><dc:creator>doubt that my ISP Al Bradford</dc:creator><description>&lt;p&gt;&lt;p&gt;
Not sure what you are trying to save but would LOG or SLOG save
the data you need? If so, you can write a simple script to LOG the
data to a file.&lt;/p&gt;

&lt;p&gt;
Then set a BreakExec at a code point where you would like to save
the data. A BreakExec will fire the script but will not stop code
execution.&lt;/p&gt;

&lt;p&gt;
Might this work for you? Good luck.&lt;/p&gt;

&lt;p&gt;
Bradford&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to save data into file in keil IDE</title><link>https://community.arm.com/thread/106957?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2013 10:17:11 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ccd945a1-a7f7-471f-9566-768267b28ec9</guid><dc:creator>Richard Lau</dc:creator><description>&lt;p&gt;&lt;p&gt;
After running debugging, I can use &amp;quot;save&amp;quot; command to save the data
in memory to one file.&lt;br /&gt;
is there any way to do it in code ?&lt;/p&gt;

&lt;p&gt;
Thanks&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to save data into file in keil IDE</title><link>https://community.arm.com/thread/81066?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2013 13:11:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e9d1750c-b175-4c53-aad9-bf808a07ded9</guid><dc:creator>Richard Lau</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks for your reply!&lt;br /&gt;
I did this in simulation mode, no hardware related.&lt;br /&gt;
All I want to do is to save a long array into a file.&lt;/p&gt;

&lt;p&gt;
Thanks&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to save data into file in keil IDE</title><link>https://community.arm.com/thread/68152?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2013 12:39:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:549b66be-f307-4906-aae4-39060cf254ec</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Did your hardware come with an installed hard disk?&lt;/p&gt;

&lt;p&gt;
Embedded products normally don&amp;#39;t have any fopen(), fread(), ...
because there are normally no standard hardware available to store
files.&lt;/p&gt;

&lt;p&gt;
So - what have you done to map your code to your hardware for file
support? Have you linked your project with any file system support?
Memory card support?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>