<?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>nrf_fstorage_write() returns NRF_SUCESS but not wrting in actual memory</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59190/nrf_fstorage_write-returns-nrf_sucess-but-not-wrting-in-actual-memory</link><description>Hi, 
 I am facing issues in Flash Data Storage (FDS). 
 Here, nrf_fstorage_write function is returns with NRF_SUCCESS but not writing in actual memory location. While nrf_fstorage_is_busy function call returns true when calling the same immediate next</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Jan 2021 08:47:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59190/nrf_fstorage_write-returns-nrf_sucess-but-not-wrting-in-actual-memory" /><item><title>RE: nrf_fstorage_write() returns NRF_SUCESS but not wrting in actual memory</title><link>https://devzone.nordicsemi.com/thread/287140?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2021 08:47:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51687e82-ba4e-4575-88e8-9a2dbfbcfd06</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;You need to wait for the fstorage callback function before the record is actually written. Do you get any callbacks? If so, what is the status of the callback? NRF_SUCCESS, or something else?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_fstorage_write() returns NRF_SUCESS but not wrting in actual memory</title><link>https://devzone.nordicsemi.com/thread/286814?ContentTypeID=1</link><pubDate>Tue, 29 Dec 2020 10:17:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85517a7d-afa3-4f3e-b2d4-dee3d49e9496</guid><dc:creator>Yadhu KP</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;i am also having exactly same issue, im not using FreeRtos, fstorage function is return NRF_SUCCESS,&lt;/p&gt;
&lt;p&gt;do you have any clue how to solve this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_fstorage_write() returns NRF_SUCESS but not wrting in actual memory</title><link>https://devzone.nordicsemi.com/thread/240675?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2020 14:32:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:974f1f0c-b3cf-4910-896b-b08e5b475fa0</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you try your implementation in an example without FreeRTOS? Just to see whether the issue is related to FreeRTOS or not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know how you implemented this functionality, but fstorage should work both with and without FreeRTOS. We have two similar examples, ble_app_hrs and ble_app_hrs_freertos.&lt;/p&gt;
&lt;p&gt;Do you check the return values for your functions that initialize fstorage? Do they all return NRF_SUCCESS?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So two things:&lt;/p&gt;
&lt;p&gt;1. Does it work without FreeRTOS?&lt;/p&gt;
&lt;p&gt;2. Does all the fstorage functions return NRF_SUCCESS?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And bonus:&lt;/p&gt;
&lt;p&gt;Perhaps you can show me how you have implemented fstorage?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_fstorage_write() returns NRF_SUCESS but not wrting in actual memory</title><link>https://devzone.nordicsemi.com/thread/240600?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2020 10:18:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba69a93a-cf1b-407b-8698-29550b183501</guid><dc:creator>Vishal Panchal</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Yes, we are using same kind of functionality but through queue [implemented in nrf_fstorage_sd.c file].&lt;/p&gt;
&lt;p&gt;We are using this in freeRTOS and main issue is, After&amp;nbsp;putting erase or write operations into queue,&amp;nbsp;Ideally, it will be processed in queue and we will get NRF_EVT_FLASH_OPERATION_SUCCESS in nrf_fstorage_sys_evt_handler. But,&amp;nbsp; we are not getting any&amp;nbsp;events in nrf_fstorage_sys_evt_handler.&lt;/p&gt;
&lt;p&gt;nrf_fstorage_sys_evt_handler is registered using NRF_SDH_SOC_OBSERVER.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_fstorage_write() returns NRF_SUCESS but not wrting in actual memory</title><link>https://devzone.nordicsemi.com/thread/240431?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2020 12:48:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9eabf479-421f-4752-b6ab-e7689e821c9e</guid><dc:creator>Edvin</dc:creator><description>[quote user="Vishal Panchal"]The SoftDevice is enabled in my case, so should I&amp;nbsp;wait for a system event (flash operation success ?) or I need to generate this kind of event ?[/quote]
&lt;p&gt;&amp;nbsp;Yes. You should wait for this event. Perhaps you can look at the flash_fsstorage example on how to implement these kind of functions. There is a project file that use the softdevice in this example as well.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The key functions in this example is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    rc = nrf_fstorage_write(&amp;amp;fstorage, 0x3e000, &amp;amp;m_data, sizeof(m_data), NULL);
    APP_ERROR_CHECK(rc);

    wait_for_flash_ready(&amp;amp;fstorage);
    NRF_LOG_INFO(&amp;quot;Done.&amp;quot;);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_fstorage_write() returns NRF_SUCESS but not wrting in actual memory</title><link>https://devzone.nordicsemi.com/thread/240350?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2020 08:16:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f48694a-4366-442d-a740-c58697a22910</guid><dc:creator>Vishal Panchal</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I have gone through the flash_fds example. In my case, we are not using fds.c library file because same variables for nrf_fstorage_t events handler is declared in nrf_dfu_flash.c&amp;nbsp; I verified that the flash is not written by monitoring memory map in segger. And yes, I have performed erase operation (nrf_fstorage_erase)&amp;nbsp;before writing into flash (nrf_fstorage_write).&lt;/p&gt;
&lt;p&gt;After debugging issue, I&amp;nbsp;found that In erase operation, its push one&amp;nbsp;operation in queue, and calls&amp;nbsp;queue_process. Here, its not clearing m_flags.queue_running flag. So, on next call for nrf_storage_write, its not getting m_flags.queue_running as false and not calls the queue_process function. (nrf_atomic_flag_set_fetch(&amp;amp;m_flags.queue_running) )&lt;/p&gt;
&lt;p&gt;Here, I am not sure about why its not clearing m_flags.queue_running flag in nrf_fstorage_erase call.&lt;/p&gt;
&lt;p&gt;The SoftDevice is enabled in my case, so should I&amp;nbsp;wait for a system event (flash operation success ?) or I need to generate this kind of event ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_fstorage_write() returns NRF_SUCESS but not wrting in actual memory</title><link>https://devzone.nordicsemi.com/thread/240264?ContentTypeID=1</link><pubDate>Tue, 17 Mar 2020 13:01:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b8f399e-7cc4-4a8c-b9dd-0d20198633ac</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Have you tested the flash_fds example? (check documentation for example &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/fds_example.html?cp=7_1_4_6_9_1#fds_example_testing" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;How do you determine that nrf_fstorage_write, or fds, for that matter doesn&amp;#39;t actually write to the memory location? Was the flash previously erased? What was written to that location before you write to it again? (hint: bits in flash can only be changed from 1&amp;#39;s to 0&amp;#39;s). Also, did you wait for the &amp;quot;write complete&amp;quot; event before you read back the data written to that specific memory location?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>