<?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 write works, but when i do hard/soft reset data is lost ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15788/flash-write-works-but-when-i-do-hard-soft-reset-data-is-lost</link><description>Hi, i&amp;#39;m using a code to save 4 bytes on the flash memory and it works. In, fact i checked the data address concerned using the keil and i see the changes when i write and it works well (data address 0x0003F400 ). I used this method before on another project</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 Aug 2016 11:31:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15788/flash-write-works-but-when-i-do-hard-soft-reset-data-is-lost" /><item><title>RE: Flash write works, but when i do hard/soft reset data is lost ?</title><link>https://devzone.nordicsemi.com/thread/60254?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2016 11:31:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aefb191-0d70-4953-9c81-ad63e201ca5f</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;Thanks for you help. i solved my problem .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash write works, but when i do hard/soft reset data is lost ?</title><link>https://devzone.nordicsemi.com/thread/60251?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2016 13:25:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9929ce7a-26bb-4e3a-925a-ceee131c4725</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;you said &amp;quot;use the page that is not used by pstorage or other modules.&amp;quot; :  is that any way to know how to have a page that it&amp;#39;s not used, i don&amp;#39;t even know how that the address 0x0003f400 was chosen. In anther project , i did month ago, the chosen address was 0x0003f800 :/  . this the code of bonding, that erases the flash :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; static void device_manager_init(bool erase_bonds)
    {
    uint32_t               err_code;
    dm_init_param_t        init_param = {.clear_persistent_data = erase_bonds};
    dm_application_param_t register_param;

// Initialize persistent storage module.
err_code = pstorage_init();
APP_ERROR_CHECK(err_code);

err_code = dm_init(&amp;amp;init_param);
APP_ERROR_CHECK(err_code);

memset(&amp;amp;register_param.sec_param, 0, sizeof(ble_gap_sec_params_t));

register_param.sec_param.bond         = SEC_PARAM_BOND;
register_param.sec_param.mitm         = SEC_PARAM_MITM;
register_param.sec_param.io_caps      = SEC_PARAM_IO_CAPABILITIES;
register_param.sec_param.oob          = SEC_PARAM_OOB;
register_param.sec_param.min_key_size = SEC_PARAM_MIN_KEY_SIZE;
register_param.sec_param.max_key_size = SEC_PARAM_MAX_KEY_SIZE;
register_param.evt_handler            = device_manager_evt_handler;
register_param.service_type           = DM_PROTOCOL_CNTXT_GATT_SRVR_ID;

err_code = dm_register(&amp;amp;m_app_handle, &amp;amp;register_param);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash write works, but when i do hard/soft reset data is lost ?</title><link>https://devzone.nordicsemi.com/thread/60250?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2016 13:22:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0be03470-48b2-47d5-877d-49b7930f64b2</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;i need to work with the version of softdevice i told u, in fact i&amp;#39;m adding a functionality to an existing program.  The program include buttonless OTA and with connection bonding . now the problem, how can i be sure to do not affect wrongly that bonding functionality  with my added functionality.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash write works, but when i do hard/soft reset data is lost ?</title><link>https://devzone.nordicsemi.com/thread/60253?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2016 13:17:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c786fd3-25f0-434c-a2a2-9ea2be0a2abb</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;i  made it the right answer by accident. Ok i find that there is somewhere in the program , just before i use my own pstorage initialisation ,there is another one done for the connection bonding, in fact there is a flash erase to erase all data of bonding and the use that initialized memory for bonding later if there is an OTA. What i did so is to take my information from the address 0x0003f400 (doing init pstorage and load data) then let the previous code of deleting flash and after that i write my data that i just loaded( so do an init again and this time call store function after a clear on the 0x0003f400 address)  to be sure that it will be the same for another reset. The functionality i added is working well now,  but i&amp;#39;m scared that will have a bad impact for bonding and loading context if there if an OTA :/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash write works, but when i do hard/soft reset data is lost ?</title><link>https://devzone.nordicsemi.com/thread/60252?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2016 10:45:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d58c383-c8ea-491f-b22e-6b8ca8fb615f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;did it work for you ToTo? was that the problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash write works, but when i do hard/soft reset data is lost ?</title><link>https://devzone.nordicsemi.com/thread/60249?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2016 08:34:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41cca666-3937-47e2-9f92-e52f4b8601ef</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;if you are using pstorage then you can configure in pstorage_platform.h of how many pages you need for your application.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define PSTORAGE_NUM_OF_PAGES       2
#define PSTORAGE_SWAP_ADDR          PSTORAGE_DATA_END_ADDR   
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I am assuming you are using nRF51,  0X3FC00 is used for swap page. if you have PSTORAGE_NUM_OF_PAGES set to 2 then your address 0x3F400 is used by pstorage and that module will clear the page when it is initialized after reset. use the page that is not used by pstorage or other modules.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash write works, but when i do hard/soft reset data is lost ?</title><link>https://devzone.nordicsemi.com/thread/60248?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2016 08:27:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26d07b21-c2bb-465a-9069-7753020879cc</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Why don&amp;#39;t you use S130 2.0.1 ? &lt;a href="https://www.nordicsemi.com/eng/nordic/Products/nRF51422/S130-SD-v2/53727"&gt;Check here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;By the way, I see no code...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>