<?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>NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113408/nrf52840-fs_sample-sd-fs_close-error-on-ncs-2-7-0</link><description>I am getting an fs_close() -5 error (-EIO) when I write to an SD card using fatfs. I determined this error was associated with FR_DISK_ERR in fat_fs.c. 
 Additional info 
 
 I&amp;#39;m using a custom board. 
 I didn&amp;#39;t have these problems with NCS 2.5.0 
 The</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Aug 2024 13:07:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113408/nrf52840-fs_sample-sd-fs_close-error-on-ncs-2-7-0" /><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/499578?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 13:07:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76465cbd-ec22-47b0-bbf8-70e8d2079bac</guid><dc:creator>sheldon_b</dc:creator><description>&lt;p&gt;I just verified the fix works on my hardware as well. &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/499563?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 12:38:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c6cbeb9-d39c-411e-9f15-ba51c96e3a26</guid><dc:creator>sheldon_b</dc:creator><description>&lt;p&gt;Hi Tom,&lt;/p&gt;
&lt;p&gt;I really appreciate you picking up the torch here. Excellent work troubleshooting so fast. I&amp;#39;ll swap back to this project right now and see if I can replicate the fix.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/499555?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 12:23:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3345804b-0e6e-44b0-9b3c-f4f79e80b3ab</guid><dc:creator>SST</dc:creator><description>&lt;p&gt;Fixed, see above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/499554?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 12:22:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19831f21-e4a5-432b-a714-40ac79fb2c7c</guid><dc:creator>SST</dc:creator><description>&lt;p&gt;I think I have found the issue.&lt;/p&gt;
&lt;p&gt;There is a missing break between line 796 and 797 of sd_ops.c. The bug was introduced in this commit:&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://github.com/nrfconnect/sdk-zephyr/commit/05c84ccb2d7a7cb39e49d769503ac22edffeb6f7"&gt;https://github.com/nrfconnect/sdk-zephyr/commit/05c84ccb2d7a7cb39e49d769503ac22edffeb6f7&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Do you do any testing on hardware for release? It seems not. Perhaps you might save your customers a lot of time with something like&amp;nbsp;&lt;a id="" href="https://rockface.io/"&gt;https://rockface.io/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Tom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/499517?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 10:45:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5db2419-1d76-4f2d-979d-61533a8f0255</guid><dc:creator>SST</dc:creator><description>&lt;p&gt;Slight progress.&lt;/p&gt;
&lt;p&gt;The write is a red herring I introduced while trying to create a simplified test case. (The fs_sample opens with only&amp;nbsp;FS_O_CREATE, adding&amp;nbsp;FS_O_WRITE fixed it).&lt;/p&gt;
&lt;p&gt;The close is still, however, failing.&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/499433?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 18:38:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8138c95f-3290-401b-b062-bd0c81720018</guid><dc:creator>SST</dc:creator><description>&lt;p&gt;HI Maria,&lt;/p&gt;
&lt;p&gt;I seem to have the same situation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Code based on the&amp;nbsp;fs_sample&lt;/li&gt;
&lt;li&gt;Worked on NCS 2.5.0&lt;/li&gt;
&lt;li&gt;Broken after moving to NCS 2.7.0&lt;/li&gt;
&lt;li&gt;Custom board but it is ultimately an sd card on the&amp;nbsp;SPI port.&lt;/li&gt;
&lt;li&gt;fs_open() succeeds&lt;/li&gt;
&lt;li&gt;fs_write() fails with -13 the file is created but the content is not written&lt;/li&gt;
&lt;li&gt;fs_close() fails with -5&lt;/li&gt;
&lt;li&gt;fs_mkdir() also returns an error. The directory is created.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;The write process fails on line 4032 of ff.c.&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;if (!(fp-&amp;gt;flag &amp;amp; FA_WRITE)) LEAVE_FF(fs, FR_DENIED);    &lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;fp-&amp;gt;flag is 0x58&lt;br /&gt;FA_WRITE is 0x2&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;flag is set to 0x58 in f_open(), (called by&amp;nbsp;fs_open(&amp;amp;file, path, FS_O_CREATE)). It is set via &lt;em&gt;mode&lt;/em&gt;&amp;nbsp;(line 3863) however the steps to this point are optimised out.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Thanks,&lt;/div&gt;
&lt;div&gt;Tom&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/499431?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 18:31:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c6e65f7-a390-4cac-9cb3-bb541925b6de</guid><dc:creator>sheldon_b</dc:creator><description>&lt;p&gt;Hi, thanks for reaching out. I had to take a few weeks off from this issue but will soon be picking it back up.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/499429?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 18:17:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ab53dba-c254-4860-a720-a20f48e6e78e</guid><dc:creator>SST</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I seem to have exactly the same failure. The circumstances and symptoms line up perfectly with everything you mention. Did you find a solution?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/496285?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2024 18:16:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e610dc29-bbc6-4475-a5d4-31d277773985</guid><dc:creator>sheldon_b</dc:creator><description>&lt;p&gt;I will try to find more information for you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/495827?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2024 13:18:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:947bb58f-5db2-44d9-a79e-16f3f57fdcac</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I was not able to find anything meaningful from my initial investigations. The potential sources for FR_DISK_ERR occuring was many, and I would not be able to conclude anything without debugging this. I would like to reproduce this, but it could be tricky since you are using a custom board.&lt;/p&gt;
&lt;p&gt;If you can do a debugging session to find out where FR_DISK_ERR is returned, this will be of much help.&lt;/p&gt;
&lt;p&gt;As a side-note: Since this is a Zephyr sample, there could be help to find in the &lt;a href="https://discord.com/invite/Ck7jw53nU2"&gt;Zephyr project Discord server&lt;/a&gt; as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 fs_sample SD fs_close error on NCS 2.7.0</title><link>https://devzone.nordicsemi.com/thread/495637?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2024 12:56:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f056c341-7ebc-45ee-bdb0-00798abd7508</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have started to investigate this, and I will get back to you tomorrow with my initial findings.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>