<?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>Don&amp;#39;t understand page numbering for sd_flash_write and sd_flash_erase</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1834/don-t-understand-page-numbering-for-sd_flash_write-and-sd_flash_erase</link><description>I want to use the last page of codespace for storing a single 32 bit word of non volatile data. I am failing so far and I think I just don&amp;#39;t understand the page numbering scheme the soft device API is using. 
 So the page number I think I want to use</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Apr 2017 07:37:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1834/don-t-understand-page-numbering-for-sd_flash_write-and-sd_flash_erase" /><item><title>RE: Don't understand page numbering for sd_flash_write and sd_flash_erase</title><link>https://devzone.nordicsemi.com/thread/7939?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 07:37:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe4069a5-d398-427b-96ae-2f5492d17677</guid><dc:creator>huyuxiang</dc:creator><description>&lt;p&gt;USing sd_flash_page_erase() function , first ,you should call ble_stack_init() function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't understand page numbering for sd_flash_write and sd_flash_erase</title><link>https://devzone.nordicsemi.com/thread/7946?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 07:34:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f81f9bfb-94fd-4430-9513-d2995c2e180e</guid><dc:creator>huyuxiang</dc:creator><description>&lt;p&gt;Using sd_flash_page_erase() should after the ble_stack_init();&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't understand page numbering for sd_flash_write and sd_flash_erase</title><link>https://devzone.nordicsemi.com/thread/7945?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2016 16:27:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32f90a79-f756-4265-a815-3081e3a7e887</guid><dc:creator>SoothingMist</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2185.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Am just getting my first real exposure to embedded programming but the attached from an IAR/Nordic example (flashwrite_example) appears to contain an implementation of the necessary approach.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't understand page numbering for sd_flash_write and sd_flash_erase</title><link>https://devzone.nordicsemi.com/thread/7944?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2014 21:29:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8267d149-12c5-47c6-986e-eaa570afc717</guid><dc:creator>David Smoot</dc:creator><description>&lt;p&gt;Ok, I don&amp;#39;t know if this will help anyone else but here goes in case:&lt;/p&gt;
&lt;p&gt;My original code did not work for two reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you use the sd_flash_* API only allows one pending operation at a time.  Learned this from a reply on another thread &lt;a href="https://devzone.nordicsemi.com/index.php/flash-write#reply-5695"&gt;flash_write&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;But more importantly is the scope of the variable being written.  If you use a local function variable as an argument to sd_flash_write, it will most likely be out of scope and not holding the data you want when the soft device gets around to actually performing the flash write.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't understand page numbering for sd_flash_write and sd_flash_erase</title><link>https://devzone.nordicsemi.com/thread/7943?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2014 16:50:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72f9e9d8-1d6b-457f-830a-778427461759</guid><dc:creator>David Smoot</dc:creator><description>&lt;p&gt;Some progress due to a very smart coworker.  A reason the code above does not work as I posted it is that I am trying to schedule a write operation immediately after scheduling the erase operation.  The erase operation has not completed yet when I call sd_flash_write.  I am still working on my code, will try to update this thread if / when I get it correct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't understand page numbering for sd_flash_write and sd_flash_erase</title><link>https://devzone.nordicsemi.com/thread/7942?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2014 14:52:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c651303-ae09-4dea-abca-a4df5561193c</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;That should be valid, unless there&amp;#39;s something else in your application using that address area.&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't understand page numbering for sd_flash_write and sd_flash_erase</title><link>https://devzone.nordicsemi.com/thread/7941?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2014 14:48:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a62b291c-9b19-4bd4-932e-600c6ef5afcb</guid><dc:creator>David Smoot</dc:creator><description>&lt;p&gt;Thanks, I will try the call back method and the pstorage API if the call back does not work.&lt;/p&gt;
&lt;p&gt;Can you confirm that my addressing is correct?  If I use the sd_flash_write function to write to page number NRF_FICR-&amp;gt;CODESIZE -1, can I then access the first address on that page by dereferencing (NRF_FICR-&amp;gt;CODEPAGESIZE * (NRF_FICR-&amp;gt;CODESIZE - 1))?&lt;/p&gt;
&lt;p&gt;Thanks,
David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't understand page numbering for sd_flash_write and sd_flash_erase</title><link>https://devzone.nordicsemi.com/thread/7940?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2014 11:46:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ceb17b3-ce0a-4c2c-ac7f-e91c0c301e29</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;The softdevice will schedule the write-process in between connection intervals and give you an event back when the write has finished (NRF_EVT_FLASH_OPERATION_SUCCESS or NRF_EVT_FLASH_OPERATION_ERROR) in the callback set in function &amp;quot;softdevice_sys_evt_handler_set(my_handler);&amp;quot;.&lt;/p&gt;
&lt;p&gt;Note: if you&amp;#39;re using pstorage module, it uses the last two pages by-default, and you should then use calls to pstorage instead of directly accessing the sd_*-API.&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>