<?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>How to open and access files in directory other than root directory in fatfs ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28418/how-to-open-and-access-files-in-directory-other-than-root-directory-in-fatfs</link><description>Hi , 
 I am working interfacing SD card with nrf52 using fatfs example given in SDK 12.0.0. While writing to text file created in root directory, code gets stopped as size of file becomes greater than 300kB. Is it because of the size limitation of writing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Jan 2017 14:11:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28418/how-to-open-and-access-files-in-directory-other-than-root-directory-in-fatfs" /><item><title>RE: How to open and access files in directory other than root directory in fatfs ?</title><link>https://devzone.nordicsemi.com/thread/112165?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2017 14:11:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3f916e8-2b85-431c-8763-895e570471c6</guid><dc:creator>Ankush</dc:creator><description>&lt;p&gt;Hi Pawel ,&lt;/p&gt;
&lt;p&gt;Thanks for your reply. As per your suggestion I have used the f_chdir() function. And I am not facing the  mentioned issue while writing to SD card. I can create and access the files in sub-directory. My SPI clock frequency is 8 Mhz.&lt;/p&gt;
&lt;p&gt;I have uploaded the sample example based on fatfs example in SDK12.0.
I have one more query mentioned in following thread. Do you have any idea about that?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/109562/how-to-use-dma-in-nrf52-while-writing-on-sd-card-while-ble-is-also-operating/"&gt;Here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to open and access files in directory other than root directory in fatfs ?</title><link>https://devzone.nordicsemi.com/thread/112164?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2017 09:16:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcc824a9-336f-4f98-9bbc-a809504046b1</guid><dc:creator>Pawel Zadrozniak</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t noticed the size limitation in my setup. What is the SPI clock speed? There might be some communication artifacts due to GPIO output strength with some cards. If you&amp;#39;re running at 8MHz then try do lower the frequency to 4 or 2MHz and check if the problem still exists.&lt;/p&gt;
&lt;p&gt;To open/create the file in a specific directory, add this directory to the path, e.g. &amp;quot;logs/1.txt&amp;quot;. You may also use full path including drive number - &amp;quot;0:/path/file.txt&amp;quot; (see the fatfs documentation for logical volume configuration if using multiple volumes). Paths without the drive number are relative to current directory (set by fs_chdir) only when _FS_RPATH is enabled (disabled by default).
See the description here: &lt;a href="http://elm-chan.org/fsw/ff/en/filename.html"&gt;elm-chan.org/.../filename.html&lt;/a&gt; .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to open and access files in directory other than root directory in fatfs ?</title><link>https://devzone.nordicsemi.com/thread/112162?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 14:26:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cad54be1-5a3b-4fae-94b0-54badfef5e19</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;As far as I can see from the SDK examples you should do something like this: f_mount-&amp;gt;f_opendir-&amp;gt;f_readdir-&amp;gt;f_open-&amp;gt;f_write-&amp;gt;f_close.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to open and access files in directory other than root directory in fatfs ?</title><link>https://devzone.nordicsemi.com/thread/112163?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2017 17:26:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:863ddc73-c5d3-414a-80c2-e84ee6952200</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Note that FatFs is 3rd-party software - nothing to do with Nordic.&lt;/p&gt;
&lt;p&gt;For FatFs documentation, examples, etc see: &lt;a href="http://elm-chan.org/fsw/ff/00index_e.html"&gt;elm-chan.org/.../00index_e.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;FatFs User Forum: &lt;a href="http://elm-chan.org/fsw/ff/bd/"&gt;http://elm-chan.org/fsw/ff/bd/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>