<?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>sd_flash_page_erase() time execution on nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63810/sd_flash_page_erase-time-execution-on-nrf52840</link><description>Hi! 
 We develop our product on nRF52840 using S113 softdevice, version 7.0.1. From time to time, we need to erase some part of flash, so we use sd_flash_page_erase() function. We measured time execution of this function and it usually takes about 50</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Jul 2020 11:02:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63810/sd_flash_page_erase-time-execution-on-nrf52840" /><item><title>RE: sd_flash_page_erase() time execution on nRF52840</title><link>https://devzone.nordicsemi.com/thread/260339?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 11:02:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dda5221-24d9-47be-a922-8bb05a35002f</guid><dc:creator>era</dc:creator><description>&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: sd_flash_page_erase() time execution on nRF52840</title><link>https://devzone.nordicsemi.com/thread/260337?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 10:59:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5455421-4bef-41bc-b881-7e7c0c811124</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I checked with the softdevice developers. The softdevice does not support partial page erase, and will disable all interrupts during the erase (up to 90 ms). You can implement partial erase in timeslots yourself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_page_erase() time execution on nRF52840</title><link>https://devzone.nordicsemi.com/thread/260320?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 09:32:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be4678f7-ffd8-4f2a-b6c2-3aaba432d1fa</guid><dc:creator>era</dc:creator><description>&lt;p&gt;OK. But my main problem is that after scheduling page erase with SD api, I get very high priority interrupt, which takes up to 90 ms. I try to find a workaround, because it is not acceptable for me to stop my application in random moments for so long. So to sum up:&lt;/p&gt;
&lt;p&gt;- I have softdevice enabled (and I want it to be enabled all the time)&lt;/p&gt;
&lt;p&gt;- I need to erase flash page from time to time&lt;/p&gt;
&lt;p&gt;- I can&amp;#39;t let my application to be stopped for tenths of milliseconds&lt;/p&gt;
&lt;p&gt;Is there any workaround for this? Would erasing flash page by chunks in timeslots using NVMC api help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_page_erase() time execution on nRF52840</title><link>https://devzone.nordicsemi.com/thread/260316?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 09:27:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2fa154e-e3df-4414-93ec-04d6f63d6b7c</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;I believe the SD already knows how to partially erase a flash page, otherwise it would be impossible in most BTLE timing setups - especially during a connection (for peer manager).&lt;/p&gt;
&lt;p&gt;Edit: Wrong assumtion, see below.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_page_erase() time execution on nRF52840</title><link>https://devzone.nordicsemi.com/thread/260311?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 09:21:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:307c52c4-cff7-41da-a948-92fafc0c7916</guid><dc:creator>era</dc:creator><description>&lt;p&gt;But does it work with softdevice enabled? I think the only way is to erase page in chunks using timeslots, right? SD has no api for partial erase.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_page_erase() time execution on nRF52840</title><link>https://devzone.nordicsemi.com/thread/260309?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 09:20:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:578867b5-04ca-4f01-8a84-2608d4185846</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;The nRF52840 has partial flash erase, around 1ms each time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_page_erase() time execution on nRF52840</title><link>https://devzone.nordicsemi.com/thread/260233?ContentTypeID=1</link><pubDate>Wed, 15 Jul 2020 19:03:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf020c01-ac1f-4692-af7a-420aa3ea2b58</guid><dc:creator>era</dc:creator><description>&lt;p&gt;Thanks. After page erase scheduling, the erase is performed from priority 0, as Flash erase/write operations are defined as softdevice timing-critical. So this means that I cannot preempt this process and it takes up to 90 ms. Can anything be done about this? Or do I need to be prepared that after page erase scheduling my code can be completely halted for so long?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_page_erase() time execution on nRF52840</title><link>https://devzone.nordicsemi.com/thread/260205?ContentTypeID=1</link><pubDate>Wed, 15 Jul 2020 15:59:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:263a06e2-4c1a-4e96-8539-1c207d8f5564</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;See the following sections in the softdevice specifications:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a title="Flash memory API" href="https://infocenter.nordicsemi.com/topic/sds_s113/SDS/s1xx/flash_mem_api/flash_mem_api.html?cp=4_7_1_0_7"&gt;Flash memory API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title="SoftDevice timing-activities and priorities" href="https://infocenter.nordicsemi.com/topic/sds_s113/SDS/s1xx/multilink_scheduling/priorities_and_events_intro.html?cp=4_7_1_0_14_0"&gt;SoftDevice timing-activities and priorities&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The API call itself is not expected to take a long time, but it can get interrupted by a timing-critical softdevice interrupt, which may take up to 250 us. See&amp;nbsp;&lt;a title="Bluetooth Low Energy processor usage patterns" href="https://infocenter.nordicsemi.com/topic/sds_s113/SDS/s1xx/processor_avail_interrupt_latency/ble_usage_patterns.html?cp=4_7_1_0_15_2_2"&gt;Bluetooth Low Energy processor usage patterns&lt;/a&gt;&amp;nbsp;for more details.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_page_erase() time execution on nRF52840</title><link>https://devzone.nordicsemi.com/thread/260200?ContentTypeID=1</link><pubDate>Wed, 15 Jul 2020 15:27:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90de0d5d-047d-4623-825d-c780831d651f</guid><dc:creator>Turbo J</dc:creator><description>[quote userid="76835" url="~/f/nordic-q-a/63810/sd_flash_page_erase-time-execution-on-nrf52840"]We measured time execution of this function and it usually takes about 50 us to be executed.[/quote]
&lt;p&gt;Yes, this function does not actually erase a page. It just schedules an erase during the next available radio time slot.&lt;/p&gt;
&lt;p&gt;Which may be &lt;em&gt;much&lt;/em&gt; later than anticipated in situations with very high radio usage. The application will be informed (via SD event) when the page erase transaction finshed. This can take significantly more time than 85 ms.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>