<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/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/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>looking for a sample, to have writing a file onto the SD-CARD, that a PC will understand</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85095/looking-for-a-sample-to-have-writing-a-file-onto-the-sd-card-that-a-pc-will-understand</link><description>Hi, 
 I managed to have the fat_fs sample to work. 
 
 Now i would like to be able to write and read files, onto the SD-CARD, that a PC will understand, it seems to needs some more then 
 the disk_access_write(), disk_access_read () of the fat_fs, Correct</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 25 Feb 2022 10:47:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85095/looking-for-a-sample-to-have-writing-a-file-onto-the-sd-card-that-a-pc-will-understand" /><item><title>RE: looking for a sample, to have writing a file onto the SD-CARD, that a PC will understand</title><link>https://devzone.nordicsemi.com/thread/354992?ContentTypeID=1</link><pubDate>Fri, 25 Feb 2022 10:47:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7622d6e-ded8-4bed-84d0-43162b782e29</guid><dc:creator>TF mulder</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;Thanks for the pointers.&lt;/p&gt;
&lt;p&gt;I indeed have it working now :-)&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Theo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: looking for a sample, to have writing a file onto the SD-CARD, that a PC will understand</title><link>https://devzone.nordicsemi.com/thread/354755?ContentTypeID=1</link><pubDate>Thu, 24 Feb 2022 10:03:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e8af16d-fd12-47df-b501-e38e44ba983f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You should be able to use a similar approach as the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/app_sdcard_example.html"&gt;FatFS example in nRF5 SDK&lt;/a&gt; uses to write a text file to the SD-card:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define FILE_NAME   &amp;quot;NORDIC.TXT&amp;quot;
#define TEST_STRING &amp;quot;SD card example.&amp;quot;

...

ff_result = f_open(&amp;amp;file, FILE_NAME, FA_READ | FA_WRITE | FA_OPEN_APPEND);
if (ff_result != FR_OK)
{
	NRF_LOG_INFO(&amp;quot;Unable to open or create file: &amp;quot; FILE_NAME &amp;quot;.&amp;quot;);
	return;
}

ff_result = f_write(&amp;amp;file, TEST_STRING, sizeof(TEST_STRING) - 1, (UINT *) &amp;amp;bytes_written);
if (ff_result != FR_OK)
{
	NRF_LOG_INFO(&amp;quot;Write failed\r\n.&amp;quot;);
}
else
{
	NRF_LOG_INFO(&amp;quot;%d bytes written.&amp;quot;, bytes_written);
}

(void) f_close(&amp;amp;file);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note that Zephyr provides a common &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/zephyr/reference/file_system/index.html#api-reference"&gt;FS API&lt;/a&gt;&amp;nbsp;for the different file systems, so you should replace &amp;quot;f_&amp;quot; with &amp;quot;fs_&amp;quot;, and replace the return code checks with the corresponding Zephyr error codes.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>