<?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>halt Flash write</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104/halt-flash-write</link><description>Dear everyone: 
 Can you tell me Using built-in flash and use restrictions, 
 because it halt at ble_flash_page_write() function.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Aug 2013 23:35:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104/halt-flash-write" /><item><title>RE: halt Flash write</title><link>https://devzone.nordicsemi.com/thread/592?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2013 23:35:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54480c8d-c167-4950-a133-9a6c7cf37eb6</guid><dc:creator>steven</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;about the question,
i find that is priorities issue.
Because when i call sd_xx() function at the lower(prior 3,timer interrupt)
that will hardfault error. so i have set that at high prior level(1).&lt;/p&gt;
&lt;p&gt;reference nRF51 reference nrF51_reference_manual.pdf p171 page&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: halt Flash write</title><link>https://devzone.nordicsemi.com/thread/591?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 12:02:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc9f7be5-d195-4c32-b4e1-9f25c7c3bdf3</guid><dc:creator>steven</dc:creator><description>&lt;p&gt;Hi Håkon,
i close the Discuss item now.
i have not to try it ,so i may be create another question next time.&lt;/p&gt;
&lt;p&gt;Thank you for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: halt Flash write</title><link>https://devzone.nordicsemi.com/thread/594?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 11:45:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f663e059-a003-43ee-8efd-314bec58c352</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;To clean things up, I&amp;#39;d be happy if you could evaluate the answers you have received and accept one of them if you feel it&amp;#39;s sufficient. If not, it might be useful to expand your question a little and provide further information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: halt Flash write</title><link>https://devzone.nordicsemi.com/thread/590?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2013 07:18:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47a1f1e8-946c-4641-a97c-3d51d1edbd09</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you explain more about whats not working?
What data are you reading out?&lt;/p&gt;
&lt;p&gt;From looking at the code, your timeout handler &amp;quot;notif_timeout_handler&amp;quot; will run 800 ms after you have called &amp;quot;timers_start&amp;quot; function. Is this wanted behavior?
If you want to store information when link is diconnected, the proper way to do it is to call it in the event &amp;quot;BLE_GAP_EVT_DISCONNECTED&amp;quot; (line 580 in your main.c)&lt;/p&gt;
&lt;p&gt;The &amp;quot;data_array&amp;quot; that you are storing is defaulted to all &amp;quot;0&amp;quot;, as I see it the whole flash page will then be blanked out.&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: halt Flash write</title><link>https://devzone.nordicsemi.com/thread/589?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2013 23:34:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4bc8259-7080-40f6-a4e0-0b54e2091a37</guid><dc:creator>steven</dc:creator><description>&lt;p&gt;Sorry for my late reply!.
I write to flash at the Time event handler (notif_timeout_handler)
. and the B.L.E is not at connect.
every time ,i write 512 B data to flash(top address,(NRF_FICR-&amp;gt;CODESIZE-1))
and then the device into system_off() .&lt;/p&gt;
&lt;p&gt;follow is code :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
				err_code=sd_softdevice_disable ();
				APP_ERROR_CHECK(err_code);
				err_code=ble_flash_page_write(FLASH_PAGE_FLUSATION,data_array,0xFE);//error earse flash data												
				//err_code=ble_flash_page_write(FLASH_PAGE_FLUSATION,data_array_test,1);//error earse flash data												
				APP_ERROR_CHECK(err_code);
				nrf_gpio_port_write(LED_OUTPORT_0,LED_OUTPORT_0_NONE);
				nrf_gpio_port_write(LED_OUTPORT_1,LED_OUTPORT_1_NONE);				
				// Go to system-off mode (this function will not return; wakeup will cause a reset)
				GPIO_WAKEUP_BUTTON_CONFIG(WAKEUP_BUTTON_PIN);					
				err_code=sd_softdevice_enable (NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION,NULL);//ble_evt_dispatch
				APP_ERROR_CHECK(err_code);
				err_code = sd_power_system_off();    				


&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards
steven&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6136.ble_5F00_app_5F00_uart_5F00_hasbro_5F00_rel1_5F00_715.zip"&gt;ble_app_uart_hasbro_rel1_715.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: halt Flash write</title><link>https://devzone.nordicsemi.com/thread/588?ContentTypeID=1</link><pubDate>Wed, 17 Jul 2013 00:06:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3bf694d-8517-4595-a490-f7b31ab66407</guid><dc:creator>steven</dc:creator><description>&lt;p&gt;My development environment is nRF6310,sotfdevice s110_nrf51822_5.2.0
I want to write a page data(1kB) to flash(at top of flash,FLASH_PAGE_FLUSATION  (NRF_FICR-&amp;gt;CODESIZE-1)&lt;/p&gt;
&lt;p&gt;call err_code=ble_flash_page_write(FLASH_PAGE_FLUSATION,data_array,0xFE);					
function to write data to flash. when master(dongle) un-connect to slave(device).&lt;/p&gt;
&lt;p&gt;When first time ,it can write to flash .but second time, it will block at address a special address(PC,0x2000000A~2000008)&lt;/p&gt;
&lt;p&gt;Could you give me a Direction for this question?
and i have a status ,it can connect to slave but not feedback data(at urat sample project)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: halt Flash write</title><link>https://devzone.nordicsemi.com/thread/593?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2013 10:26:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e04a60a5-84e9-46d6-9926-f957951badd9</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;If you are trying to write to an address which the softdevice uses, you will most likely end up in the hard-fault handler, as this is a restricted address area.
If you write to the top of the flash, this should not be an issue.
How much data are you writing to flash?
Are you doing this while in a BLE connection?&lt;/p&gt;
&lt;p&gt;If you are depending on writing data to the flash while in a connection, you should enable radio notification which will give you a &amp;quot;safe&amp;quot; window of up to 5.5 ms for you to store into flash.
Most examples use this to store bonding information (ex: ble_app_cscs, ble_app_gls etc)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: halt Flash write</title><link>https://devzone.nordicsemi.com/thread/587?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2013 23:10:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4296a980-2251-4b51-8906-01836751517e</guid><dc:creator>steven</dc:creator><description>&lt;p&gt;Thank for your reply.
The Flash Write problem , I have found that because the softdevice open .
so , I want to ask for advice about :&lt;/p&gt;
&lt;p&gt;I have know when I inside softdevice ,it protection the H.W and Memory.
so,my problem must  disable softdevice call nrf_softdevice_disable().&lt;/p&gt;
&lt;p&gt;But ,I don&amp;#39;t know when time can close the softdevice ?
When Close the sotfdevice ,it  Cause happen? restrict ?
(BLE disconnect,i.e...)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: halt Flash write</title><link>https://devzone.nordicsemi.com/thread/586?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2013 23:08:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:824968bc-8f10-4945-9546-4ebea6645bdf</guid><dc:creator>steven</dc:creator><description>&lt;p&gt;Thank for your reply.
The Flash Write problem , I have found that because the softdevice open .
so , I want to ask for advice about :&lt;/p&gt;
&lt;p&gt;I have know when I inside softdevice ,it protection the H.W and Memory.
so,my problem must  disable softdevice call nrf_softdevice_disable().&lt;/p&gt;
&lt;p&gt;But ,I don&amp;#39;t know when time can close the softdevice ?
When Close the sotfdevice ,it  Cause happen? restrict ?
(BLE disconnect,i.e...)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: halt Flash write</title><link>https://devzone.nordicsemi.com/thread/585?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2013 08:46:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db7cc893-5582-4c50-afd5-253eca9b071c</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Writing to the flash will halt your MCU for a given period of time (depending on how much data you write).
When it&amp;#39;s finished, the flash is written, the MCU will return (just like a normal function call).&lt;/p&gt;
&lt;p&gt;Can you explain more about the issue you are seeing?
Are you being disconnected?&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>