<?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>nRF51822 cannot write data to flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15029/nrf51822-cannot-write-data-to-flash</link><description>Hello, 
 I am writing some data to flash, but when it runs to storage_clear, I get the return code---0x10. It seems clear failed. And I tried storage_update, and it failed with 0x10 too. Anybody can help out for this? 
 Thanks
Alex
 main.c 
 TestAsc</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Jul 2016 01:33:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15029/nrf51822-cannot-write-data-to-flash" /><item><title>RE: nRF51822 cannot write data to flash</title><link>https://devzone.nordicsemi.com/thread/57345?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 01:33:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce2542d9-782d-4e75-b543-61f761391eaa</guid><dc:creator>sunnyjet16</dc:creator><description>&lt;p&gt;Hi Petter,
I use SDK nRF51_SDK_7.1.0_372d17a. I will try the version above V8.1.0.&lt;/p&gt;
&lt;p&gt;Regards
Alex&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 cannot write data to flash</title><link>https://devzone.nordicsemi.com/thread/57344?ContentTypeID=1</link><pubDate>Thu, 14 Jul 2016 07:55:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db7a6078-ee00-4e08-8cb6-a2469258b23c</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;So you are using SoftDevice S110 7.1.0. What SDK are you using? It shouldn&amp;#39;t be necessary to use the page size when using storage_clear(). At least not in later SDKs, see &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/lib_pstorage.html?cp=6_0_0_3_19_2_6#pstorage_clear"&gt;this&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 cannot write data to flash</title><link>https://devzone.nordicsemi.com/thread/57343?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2016 07:31:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d5b5271-1cb2-47cc-ae88-2d540590db23</guid><dc:creator>sunnyjet16</dc:creator><description>&lt;p&gt;Hi Petter,
The return is from sd_flash_write(). And my softdevice is 7.1.0. Now, I got answer from a local supplier who said that the cause is I put the size 16 bytes, but it needs to be 1024 bytes(clear page). is there any function which can delete 100 pages once?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 cannot write data to flash</title><link>https://devzone.nordicsemi.com/thread/57342?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2016 07:21:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee6ef742-69a0-4e95-814b-394dacef6f34</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Ok. Could you set some breakpoints inside pstorage_clear() to figure out where the error is returned from? And what SDK version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 cannot write data to flash</title><link>https://devzone.nordicsemi.com/thread/57341?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2016 01:35:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c3911e8-01c8-486f-b1c1-4f4fac4aab91</guid><dc:creator>sunnyjet16</dc:creator><description>&lt;p&gt;Hi Petter,&lt;/p&gt;
&lt;p&gt;I read the address of the block to be cleared. Its address is 0x2000201C which seems aligned with word.
And I checked the data of block. And inside the block, block_id is 0x00027000. And to test if the address is available or not, I used pstorage_store and the return value is 0. I guess probably there are other issues which cause clear fail and update fail.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 cannot write data to flash</title><link>https://devzone.nordicsemi.com/thread/57340?ContentTypeID=1</link><pubDate>Mon, 11 Jul 2016 10:21:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:004c59d4-158e-402a-b654-5a44b6762fa8</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;0x10 is NRF_ERROR_INVALID_ADDR. pstorage_clear() will return this if you use an address that is not word aligned.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>