<?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>Storing values to flash using fstorage in the mesh dimming_server example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80547/storing-values-to-flash-using-fstorage-in-the-mesh-dimming_server-example</link><description>I am using the nRF5_SDK_17.0.2_d674dde and the nrf5_SDK_for_Mesh_v5.0.0. I am using the nRF52 development kit and I want to know if I can use the flash fstorage on the mesh &amp;quot;dimming_server&amp;quot; example? I noticed that you use a different method for writing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Oct 2021 22:16:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80547/storing-values-to-flash-using-fstorage-in-the-mesh-dimming_server-example" /><item><title>RE: Storing values to flash using fstorage in the mesh dimming_server example</title><link>https://devzone.nordicsemi.com/thread/335829?ContentTypeID=1</link><pubDate>Mon, 25 Oct 2021 22:16:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffa7ede6-7485-4802-9114-69b6ba9db05f</guid><dc:creator>Redleader</dc:creator><description>&lt;p&gt;Terje,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have tried to use the set function to write a &amp;#39;5&amp;#39; during the initialization function.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void initialize(void)
{
    __LOG_INIT(LOG_SRC_APP | LOG_SRC_ACCESS | LOG_SRC_BEARER, LOG_LEVEL_INFO, LOG_CALLBACK_DEFAULT);
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;----- BLE Mesh Dimming Server Demo -----\n&amp;quot;);

    pwm_utils_enable(&amp;amp;m_pwm0);
    ERROR_CHECK(app_timer_init());

    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;----- SET -----\n&amp;quot;);
    user_set();

    ble_stack_init();

#if MESH_FEATURE_GATT_ENABLED
    gap_params_init();
    conn_params_init();
#endif

    mesh_init();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is my user set function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void user_set(void)
{
    set_value = 5;
    mesh_config_entry_set(APP_ENTRY_ID, &amp;amp;set_value);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I run the code this is the output that I get:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;t:          0&amp;gt;, main.c,  530, ----- BLE Mesh Dimming Server Demo -----
&amp;lt;t:          0&amp;gt;, pwm_utils.c,   88, PWM max ticks: 3200
&amp;lt;t:          0&amp;gt;, main.c,  537, ----- SET -----
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, &amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 65552
&amp;lt;t:          0&amp;gt;, mesh_config.c,  507, ID 6555&#x3;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand why it is looping and outputting the &amp;quot;ID&amp;quot;. With no output error I can&amp;#39;t figure out what is going on. Is this happening because I am using an invalid ID or is my flash address not usable?&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been looking at the enocean example as well as the generic_level_mc.c to see how to store a value to flash and there is much more complicated code at work. &lt;br /&gt;&lt;br /&gt;Is writing to flash on mesh a very in-depth and complicated process or is it more simple? I have followed the &amp;quot;Mesh configuration example&amp;quot; and looked all over the forums to find a solution and I am not finding any guidance to solve this issue. Do you have any suggestions that could help me understand this further?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Storing values to flash using fstorage in the mesh dimming_server example</title><link>https://devzone.nordicsemi.com/thread/334002?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 16:46:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:faf32de5-4fab-4a80-8498-164de3962c54</guid><dc:creator>Redleader</dc:creator><description>&lt;p&gt;Terje,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes I did register the config file as seen below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/******FLASH****/

MESH_CONFIG_FILE(m_app_file, 0x0010, MESH_CONFIG_STRATEGY_CONTINUOUS);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is my output during the debug session:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;t:          0&amp;gt;, main.c,  540, ----- BLE Mesh Dimming Server Demo -----
&amp;lt;t:          0&amp;gt;, pwm_utils.c,   88, PWM max ticks: 3200
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, &amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
2
1
2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;, mesh_config.c,  531, 1
&amp;lt;t:          0&amp;gt;, mesh_config.c,  534, 2
&amp;lt;t:          0&amp;gt;,&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is my mesh_config.c &amp;#39;mesh_config_entry_get&amp;#39; function with logs to see what is going on:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t mesh_config_entry_get(mesh_config_entry_id_t id, void * p_entry)
{
    if (p_entry == NULL)
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;NRF_ERROR_NULL\n&amp;quot;);
        return NRF_ERROR_NULL;
    }

    const mesh_config_entry_params_t * p_params = entry_params_find(id);
    if (p_params)
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;1\n&amp;quot;);
        if (p_params-&amp;gt;has_default || (*entry_flags_get(p_params, id) &amp;amp; MESH_CONFIG_ENTRY_FLAG_ACTIVE))
        {
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;2\n&amp;quot;);
            p_params-&amp;gt;callbacks.getter(id, p_entry);
        }
        else
        {
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;NRF_ERROR_INVALID_STATE\n&amp;quot;);
            return NRF_ERROR_INVALID_STATE;
        }
        return NRF_SUCCESS;
    }
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;NRF_ERROR_NOT_FOUND\n&amp;quot;);
    return NRF_ERROR_NOT_FOUND;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;There is no error output, the code simply crashes with no error or output available. What do you make of this?&lt;/p&gt;
&lt;p&gt;Thank you,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sky&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Storing values to flash using fstorage in the mesh dimming_server example</title><link>https://devzone.nordicsemi.com/thread/333874?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 09:29:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9089264a-1aef-4db5-94ad-76255b737205</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you registered the config file through use of the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v5.0.0%2Fgroup__MESH__CONFIG__ENTRY.html&amp;amp;anchor=gacb310f7e7d1ede1e50db3a9d25ba3e26"&gt;MESH_CONFIG_FILE&lt;/a&gt; macro, as described under &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v5.0.0%2Fmd_doc_user_guide_modules_mesh_config.html&amp;amp;anchor=mesh_config_usage_app"&gt;Usage in application&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Also, please check the return values from the API functions such as mesh_config_entry_set(), mesh_config_entry_get(), etc., as that would reveal information about what has gone wrong.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Storing values to flash using fstorage in the mesh dimming_server example</title><link>https://devzone.nordicsemi.com/thread/333784?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 16:29:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d62810a5-9921-4610-9f39-000539dd9ee3</guid><dc:creator>Redleader</dc:creator><description>&lt;p&gt;Terje,&lt;/p&gt;
&lt;p&gt;So I have implemented the functions and implementation&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v5.0.0%2Fmd_doc_user_guide_modules_mesh_config.html"&gt;from here&lt;/a&gt;&amp;nbsp;and my code is crashing during runtime when I try to use my set function. Am I writing to an unusable address or am I doing something else wrong?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//
// Mesh store values
//
// Declare functions
static void user_get(void);
static void user_set(void);

// Static Values
static uint32_t set_value;
static uint32_t get_value;

#define APP_ENTRY_ID    MESH_CONFIG_ENTRY_ID(0x0010, 0x0001)
/* Live RAM representation of the value */
//static uint32_t m_live_value = 5000;

//static uint32_t app_entry_setter(mesh_config_entry_id_t id, const void * p_entry)
//{
//    const uint32_t * p_value = (const uint32_t *) p_entry;
//    if (*p_value &amp;gt;= 10000)
//    {
//        /* Rejecting an invalid value. The value will not be stored to persistent storage. */
//        return NRF_ERROR_INVALID_DATA;
//    }
//    m_live_value = *p_value;
//    return NRF_SUCCESS;
//}
//static void app_entry_getter(mesh_config_entry_id_t id, void * p_entry)
//{
//    uint32_t * p_value = (uint32_t *) p_entry;
//    *p_value = m_live_value;
//}

// SET AND GET FOR FLASH STORE
static void user_get(void)
{
    //uint32_t set_value = 19;
    //mesh_config_entry_set(APP_ENTRY_ID, &amp;amp;set_value);
    //uint32_t get_value;
    mesh_config_entry_get(APP_ENTRY_ID, &amp;amp;get_value);
    // get_value == set_value
    //return get_value;
}

static void user_set(void)
{
    //uint32_t set_value = 19;
    mesh_config_entry_set(APP_ENTRY_ID, &amp;amp;set_value);
    //uint32_t get_value;
    //mesh_config_entry_get(APP_ENTRY_ID, &amp;amp;get_value);
    // get_value == set_value
}

MESH_CONFIG_ENTRY(m_app_entry,
                  APP_ENTRY_ID,
                  1, // The entry is singular
                  sizeof(uint32_t),
                  user_set,
                  user_get,
                  NULL, // No need for a delete callback
                  true); // There is a default value
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It seems that the get function is working because it is returning a &amp;#39;0&amp;#39; when I run the debugger initially.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Storing values to flash using fstorage in the mesh dimming_server example</title><link>https://devzone.nordicsemi.com/thread/333748?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 13:21:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32abc294-1e64-4d0b-9236-618dc693acc2</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;While it is possible to use flash libraries from nRF5 SDK with the nRF5 SDK for Mesh, we highly recommend using the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v5.0.0%2Fmd_doc_user_guide_modules_mesh_config.html"&gt;Mesh configuration&lt;/a&gt; library if you can. The reason for using a separate flash handling library in the nRF5 SDK for Mesh, is mainly for better coexistence with the operation of the Bluetooth mesh stack.&lt;/p&gt;
&lt;p&gt;If using &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Flib_fstorage.html"&gt;Flash Storage (fstorage)&lt;/a&gt; or &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Flib_fds.html"&gt;Flash Data Storage (FDS)&lt;/a&gt;, you must also make sure that those modules writes to different flash pages than what the modules from nRF5 SDK for Mesh does. See the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v5.0.0%2Fmd_doc_user_guide_integrating_mesh_nrf5_sdk.html&amp;amp;anchor=coexistence_mesh_in_nrf5_sdk_nvm"&gt;nRF5 NVM storage modules&lt;/a&gt; section of &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v5.0.0%2Fmd_doc_user_guide_integrating_mesh_nrf5_sdk.html"&gt;Integrating Bluetooth mesh into nRF5 SDK examples&lt;/a&gt; for details.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>