<?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 Read Exception</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11123/flash-read-exception</link><description>Hi, I am here in the use of Flash memory data when there is a strange question to consult.
Due to my side of the application, you need to enter each case sd_power_system_off need to perform pstorage_update, update my data to the Flash kept inside. But</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Jan 2016 12:11:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11123/flash-read-exception" /><item><title>RE: flash Read Exception</title><link>https://devzone.nordicsemi.com/thread/41670?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2016 12:11:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f740bcba-853a-4367-9e3b-830be224ddb8</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m don&amp;#39;t quite understand your last comment, but the flag is in PSTORAGE_CLEAR_OP_CODE, and you will get this event if you call pstorage_clear(). If you call pstorage_update(), you will get the PSTORAGE_UPDATE_OP_CODE event. You should check that you get this event before you call sd_power_system_off(), for example by using a flag.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash Read Exception</title><link>https://devzone.nordicsemi.com/thread/41668?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2016 11:25:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:049db133-7a56-43b1-b7c8-d0dc13eb19f5</guid><dc:creator>chad.ou</dc:creator><description>&lt;p&gt;“Maybe you should add some code in case PSTORAGE_UPDATE_OP_CODE:”I just feel the need for a flag here，“pstorage_wait_flag ”The Flag indicates success。&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash Read Exception</title><link>https://devzone.nordicsemi.com/thread/41671?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2016 10:49:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:388667e2-2a16-4fb7-b65d-da664be2fb15</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I can&amp;#39;t see any call to sd_power_system_off(). Are you sure all flash operations are complete when you call it? When are you calling it? Maybe you should add some code in case PSTORAGE_UPDATE_OP_CODE:?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash Read Exception</title><link>https://devzone.nordicsemi.com/thread/41672?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2016 01:59:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7b4c9a9-267d-459f-8bd8-4c947d0fd389</guid><dc:creator>chad.ou</dc:creator><description>&lt;p&gt;Link part of the code of Flash operation
&lt;a href="https://github.com/ChadOu/Code/blob/nrf51822/Flash_op.c"&gt;link text&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash Read Exception</title><link>https://devzone.nordicsemi.com/thread/41666?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 15:26:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c87de8bd-8d67-45e4-997b-d01d3e699cff</guid><dc:creator>chad.ou</dc:creator><description>&lt;p&gt;Sorry, I still study how to put the code up here。&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash Read Exception</title><link>https://devzone.nordicsemi.com/thread/41667?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 15:21:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a8e71c7-ae8c-4af5-9498-67b8b3e7b3c4</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Next time, please edit your question and add the code there. I can&amp;#39;t see any call to sd_power_system_off(). Are you sure all flash operations are complete when you call it? When are you calling it? Maybe you should add some code in case PSTORAGE_UPDATE_OP_CODE:?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash Read Exception</title><link>https://devzone.nordicsemi.com/thread/41669?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 15:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3265ec4-e9b2-4a95-93ca-7124564cc06b</guid><dc:creator>chad.ou</dc:creator><description>&lt;p&gt;Thank Petter reply, I tested is from the normal working pstorage_update, then sd_power_system_off, wake up, pstorage_load, pstorage_update, such a cycle. There may be some data becomes 0xff pstorage_updat that after more than twenty normal cycle. In writing to flash when there callback handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash Read Exception</title><link>https://devzone.nordicsemi.com/thread/41665?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 13:44:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fa120e1-f9d8-46ae-ab19-b4b9d61d7685</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Did you test 20 times and it failed 20 times, or did it fail 1 out of 20 times? Are you using any other pstorage operations that are working? That pstorage_update() or cmd_queue_enqueue() returns NRF_SUCCESS only means that the pstorage software accepted your command. It doesn&amp;#39;t mean that flash is actually updated.&lt;/p&gt;
&lt;p&gt;You need to register a callback handler according to the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/lib_pstorage.html?cp=4_0_0_3_17"&gt;documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Then you will have to wait for the PSTORAGE_UPDATE_OP_CODE. This tells you that the update operation is completed, then you can go to System OFF.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash Read Exception</title><link>https://devzone.nordicsemi.com/thread/41664?ContentTypeID=1</link><pubDate>Sun, 03 Jan 2016 17:17:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8571581f-aad9-4311-9892-0e628c2ff273</guid><dc:creator>chad.ou</dc:creator><description>&lt;p&gt;I have to check cmd_queue_enqueue this return NRF_SUCCESS. And judging by pstorage callback handler is complete.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: flash Read Exception</title><link>https://devzone.nordicsemi.com/thread/41663?ContentTypeID=1</link><pubDate>Sun, 03 Jan 2016 17:08:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47766721-e435-4797-94ac-0b97670f38c9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Before your system goes to system_off, does it check if the pstorage operation has completed? It should return the operation result as a system event. You have to wait for it before you go to system off.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>