<?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>No call of registered &amp;quot;flash write complete&amp;quot; callback function</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42491/no-call-of-registered-flash-write-complete-callback-function</link><description>Hi Team 
 I created an own interface layer using the mesh SDK&amp;#39;s &amp;quot;flash_manager&amp;quot; to have a simple API for accessing my application flash area. 
 Now, I am facing the problem, that the my callback function &amp;quot;flash_write_complete_cb&amp;quot; is not called by the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 Jan 2019 10:41:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42491/no-call-of-registered-flash-write-complete-callback-function" /><item><title>RE: No call of registered "flash write complete" callback function</title><link>https://devzone.nordicsemi.com/thread/167334?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 10:41:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:979f9e2d-6263-4ddb-ba01-92a61e0b3f81</guid><dc:creator>ti_me1</dc:creator><description>&lt;p&gt;Problem solved: By mistake I waited for Flash write completion during initialization, before Interrupts were enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No call of registered "flash write complete" callback function</title><link>https://devzone.nordicsemi.com/thread/167329?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 10:30:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8af0db40-bf65-4060-9422-3d05e8732cfa</guid><dc:creator>ti_me1</dc:creator><description>&lt;p&gt;Hi Edvin&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With the enocean example I just wanted to find out what I am doing wrong when using the flash manager. In the meantime I assume that it was&amp;nbsp;a user fault of mine, when receiving the FM_RESULT_ERROR_NOT_FOUND, because I didn&amp;#39;t deal a lot with this example.&lt;/p&gt;
&lt;p&gt;Anyway, after that, I continued to search in&amp;nbsp;my own&amp;nbsp;project where I had the Initial problem that&amp;nbsp;the &amp;quot;write callback&amp;quot; function&amp;nbsp;was not called. After diving deep into the source,&amp;nbsp;I guess, I found the reason for that. I tried to write to flash during initialization. After committing the write packet, I waited for completion to read the data back before continuing the initialization code. As the Interrupts were not yet started at this time,&amp;nbsp;the write only has been scheduled but never executed, and therefore, the callback function was not called.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No call of registered "flash write complete" callback function</title><link>https://devzone.nordicsemi.com/thread/166800?ContentTypeID=1</link><pubDate>Mon, 21 Jan 2019 11:24:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ae43f8a-9f83-4a50-a479-a925f3ca6fa3</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am terribly sorry for the late reply. I just tested the unmodified enocean example, and I could not replicate the FM_RESULT_ERROR_NOT_FOUND error. I just tested this example, no provisioners or servers connected. This return value is not received in the app_data_store_try() function, right? Can you specify in what function you get it?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is it possible to send the project (preferably the one that you initially mentioned).&lt;/p&gt;
&lt;p&gt;I want to see if I can reproduce it, and figure out why it is not working.&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: No call of registered "flash write complete" callback function</title><link>https://devzone.nordicsemi.com/thread/165574?ContentTypeID=1</link><pubDate>Mon, 14 Jan 2019 16:45:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2037fbee-d781-46de-b5e7-effc8f75a9a3</guid><dc:creator>ti_me1</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I am using the Mesh SDK v3.0.0 with the included original flash manager. For reference, now, I tried the enocean switch example. Here, flash data storage is triggered by pressing button 1. When debugging this (unmodified) example, the callback function is called, but with the error code &amp;quot;FM_RESULT_ERROR_NOT_FOUND&amp;quot;... anyway, it could be a &amp;quot;user error&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here you find the code snippets of my flash manager usage. It was implemented based on examples. Could it be a problem that I want to write-access the flash during initialization, before the start()-function is called in the main?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Add&amp;nbsp;the flash manager&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    /* Get the start address of the flash area used by the mesh stack */
    const uint32_t * start_address;
    uint32_t allocated_area_size;
    RETURN_ON_ERROR(mesh_stack_persistence_flash_usage(&amp;amp;start_address, &amp;amp;allocated_area_size));

    /* Configure the application flash manager */
    flash_manager_config_t manager_config;
    manager_config.write_complete_cb = flash_write_complete_cb;
    manager_config.invalidate_complete_cb = NULL;
    manager_config.remove_complete_cb = NULL;
    manager_config.min_available_space = WORD_SIZE;
    manager_config.p_area = (const flash_manager_page_t *)((uint32_t)start_address - PAGE_SIZE * APP_FLASH_PAGE_COUNT);
    manager_config.page_count = APP_FLASH_PAGE_COUNT;       //page count set to 1
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;app page address: %d\n&amp;quot;, manager_config.p_area);

    RETURN_ON_ERROR(flash_manager_add(&amp;amp;m_flash_manager, &amp;amp;manager_config));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Init of&amp;nbsp;the flash content&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    /* Setup handle filter */
    fm_handle_filter_t handle_filter = {
        .mask = 0xffff,
        .match = m_entry_handle,
    };

    /* If there is not an entry yet, the default value is written */
    if (flash_manager_entry_count_get(&amp;amp;m_flash_manager, &amp;amp;handle_filter) == 0)
    {
        RETURN_ON_ERROR(prepare_flash_write_timer(timeout_ms));
        RETURN_ON_ERROR(app_flash_manager_write_u32(m_entry_handle, default_u32));
        RETURN_ON_ERROR(wait_flash_write());
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;created default entry: %d\n&amp;quot;, default_u32);
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Allocate &amp;amp;&amp;nbsp;commit the buffer for write&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    /* allocate a buffer for writing to flash */
    fm_entry_t * p_entry = flash_manager_entry_alloc(&amp;amp;m_flash_manager, handle, sizeof(uint32_t));
    if (p_entry == NULL)
    {
        return NRF_ERROR_NO_MEM;
    }

    /* store the new data to the entry struct, then commit */
    uint32_t * p_u32 = (uint32_t *) p_entry-&amp;gt;data;
    *p_u32 = new_u32;
    flash_manager_entry_commit(p_entry);
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;start write u32: %d\n&amp;quot;, *p_u32);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No call of registered "flash write complete" callback function</title><link>https://devzone.nordicsemi.com/thread/165488?ContentTypeID=1</link><pubDate>Mon, 14 Jan 2019 13:49:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68547a24-e6c9-482c-bd4e-c18c1c633162</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;So are you using the Mesh SDK, or have you ported this to another SDK? What version of the Mesh SDK did you get the flash_manager from?&lt;/p&gt;
&lt;p&gt;Did the flash manager work in any of the original examples?&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>