<?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>pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15215/pstorage-with-bootloader-issue</link><description>hi guys
im using nrf51822 board sdk10 s130.
i want to use pstorage to store some data that could be preserved even after resetting the chip or after dfu. I have gone through the infocenter page for &amp;#39;Persistent storage Manager&amp;#39; for sdk10 and followed</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Sep 2016 05:24:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15215/pstorage-with-bootloader-issue" /><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58107?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2016 05:24:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bab37cc-7082-4026-a256-5e4e4519f834</guid><dc:creator>piyush</dc:creator><description>&lt;p&gt;hey Vidar, i had the flash store working fine but now i have a new issue. the code that u sent me is for storing static data in flash, but now i want to save a run time constant value and i get the error &amp;quot;initializer element is not compile time constant&amp;quot;. How to resolve this issue??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58105?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2016 09:30:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54a0ce5a-bf66-43b1-897d-2f3899dbcd44</guid><dc:creator>piyush</dc:creator><description>&lt;p&gt;hey, it worked!! thank you so much..pstorage was being a pain for me&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58106?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2016 06:48:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1582cb24-d9d7-4a9a-b02e-7d24c98b4da0</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The return value is typically loaded into CPU register R0 when you have optimization on. Did you try the attached example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58104?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 13:57:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:860d9d3c-9191-4db5-af0d-4bf3d83d4216</guid><dc:creator>piyush</dc:creator><description>&lt;p&gt;So how should I proceed further with this then, is there a way for knowing if func gave NRF_SUCCESS without having retval? also while debugging pressing F11 on retval=pstorage_store(&amp;amp;block_0_handle, source_data_0, 16, 0); it goes inside the function and then gets stuck at  if ((!is_word_aligned(p_src))&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58103?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 13:43:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f703d89-492c-4d27-a9a2-db602bfdcfb4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Ok, the code size is limited to 32K for the eval version of Keil. But the return value is typically loaded into R0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58102?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 13:41:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52e52010-c872-49ed-bffd-4ff5d61b8e25</guid><dc:creator>piyush</dc:creator><description>&lt;p&gt;Yes, I have tried that but it threw back an linker error---&amp;gt;
The code size of this image exceeds the maximum allowed for this version of the linker.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58101?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 13:39:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d95c8f1-5811-4ac9-a508-e0b932df9d39</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Yes, if you have compiling with optimization, may not be pushed on stack then. You can change the optimization level in options for target -&amp;gt; C/C++. Use -O0 for debugging&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58100?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 13:37:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ede9be5-4823-4edf-ad05-80f5d3ca0181</guid><dc:creator>piyush</dc:creator><description>&lt;p&gt;well that&amp;#39;s another issue here. the retval come as &amp;#39;not in scope&amp;#39; in the watch window, is this normal?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58099?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 13:33:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8f9a53e-6d7d-4567-ab34-b46629a67fc9</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The functions should return imitatively with a return value where &amp;#39;0&amp;#39; equals NRF_SUCCESS, but it should not become stuck. Have you checked the return values?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58098?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 12:50:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be155daf-c4d3-4369-8c23-a76c911e21af</guid><dc:creator>piyush</dc:creator><description>&lt;p&gt;Hi Vidar,
Thanks for the prompt reply. i have removed the while() statements from the code but the debugger still seems to get stuck at pstorage_store(). Also, the first while loop was after the pstorage_store, so the debugger should have crossed it and then moved to callback. Could this be related to addresses.. pstorage data start address or codepagesize or something like that because the code i have written is from the infocenter only, meaning there may be some problem in memory allocation?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pstorage with bootloader issue</title><link>https://devzone.nordicsemi.com/thread/58097?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 12:33:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:979d3f83-d172-4824-9f7e-1104d393ecd5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The blocking while() statements need to be removed from pstorage_store_clear_update() if you want to be able to call this function from an interrupt context. Otherwise the pstorage callback will not get through. Thus, the wait flag will not be cleared and it will become stuck in that interrupt.&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t need the wait statements between calls to pstorage as it&amp;#39;s automatically added to the scheduler queue, and dequeued once the flash success event is received from the softdevice stack.&lt;/p&gt;
&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;Attached a very simple (didn&amp;#39;t have much time) example  where pstorage is used to store some dummy data @ 0x3F800 on startup.  Replace the attached file with &amp;quot;\nRF51_SDK_10.0.0\examples\ble_peripheral\ble_app_hrs\main.c&amp;quot; and make sure that PSTORAGE_NUM_OF_PAGES is set to &amp;#39;2&amp;#39;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/38562.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>