<?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>flash_manager works properly only after a reset</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76570/flash_manager-works-properly-only-after-a-reset</link><description>Hello, I have a issue about flash_manager module. 
 When I load a program on processor (that has been previously erased) there is a problem with initialization (flash_manager_add return NRF_ERROR_NO_MEM ) and then with writing data. But when I restart</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Jul 2021 07:15:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76570/flash_manager-works-properly-only-after-a-reset" /><item><title>RE: flash_manager works properly only after a reset</title><link>https://devzone.nordicsemi.com/thread/320816?ContentTypeID=1</link><pubDate>Tue, 20 Jul 2021 07:15:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99fb766a-c805-4b52-a76f-a0631997654a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry for the delay.&amp;nbsp;&lt;span&gt;The support staff is reduced during the summer holidays, and you may experience delayed answers.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Can you try the&amp;nbsp;&lt;a href="https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools"&gt;nRF-Command-Line-Tools&lt;/a&gt;&amp;nbsp;to run &lt;code&gt;nrfjprog -e&lt;/code&gt; before you load the image? Please let me know it can help or not.&lt;/p&gt;
&lt;p&gt;-Amanda H.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash_manager works properly only after a reset</title><link>https://devzone.nordicsemi.com/thread/316595?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 06:49:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d94e28a9-3539-4c64-8d60-247ce4864a2d</guid><dc:creator>rogi1806</dc:creator><description>&lt;p&gt;Yes, I use custom board. I erase / restart program using Segger Embedded Studio debugger. The code look like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void flashStorage_init(){ 
    flash_manager_t flashManager;
    
    flash_manager_page_t * p_area;
    p_area = (flash_manager_page_t *)(((const uint8_t *) flash_manager_recovery_page_get()) 
                                           - (15 * PAGE_SIZE));

    const flash_manager_config_t config =
    {
        .write_complete_cb =      writeCb,
        .invalidate_complete_cb = invalidateCb,
        .remove_complete_cb =     removeCb,
        .min_available_space =    WORD_SIZE,
        .p_area =                 p_area,
        .page_count =             1
    };

    uint32_t ret = flash_manager_add(&amp;amp;flashManager, &amp;amp;config);
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Return code from flash manager %d \n&amp;quot;, ret);  
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The problem appear in&amp;nbsp;flash_manager_add -&amp;gt; flash_area_build -&amp;gt;&amp;nbsp;reserve_action_buffer and that return NULL pointer which leads to an error&amp;nbsp;&lt;span&gt;NRF_ERROR_NO_MEM. After a restart program this method works as it should - there is no problem with initialization and then with writing or reading process.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash_manager works properly only after a reset</title><link>https://devzone.nordicsemi.com/thread/316446?ContentTypeID=1</link><pubDate>Tue, 22 Jun 2021 11:19:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:590abdf4-a78a-47f9-acd8-70d0fd29a9e8</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you use a custom board or nRF52840DK? How do you erase the board and &lt;span&gt;restart progam&lt;/span&gt;?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you step into&amp;nbsp;&lt;span&gt;flash_manager_add to see which function or code returns&amp;nbsp;NRF_ERROR_NO_MEM?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Amanda&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>