<?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 are events scheduled or interrupts?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30887/sd_flash-are-events-scheduled-or-interrupts</link><description>Are sd_flash events NRF_EVT_FLASH_OPERATION_SUCCESS and NRF_EVT_FLASH_OPERATION_ERROR actual events, schedule and only run when app_sched_execute is run. Or are they run from and interrupt handler. 
 Basically, is the NVM event handler run in and interrupt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Feb 2018 13:01:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30887/sd_flash-are-events-scheduled-or-interrupts" /><item><title>RE: sd_flash are events scheduled or interrupts?</title><link>https://devzone.nordicsemi.com/thread/122291?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2018 13:01:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afe4c693-611d-4f05-b047-468da9542ac5</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Yes, that&amp;#39;s correct. Here&amp;#39;s a list of the peripherals that the softdevice uses:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/sd_resource_reqs/hw_block_interrupt_vector.html?cp=2_3_1_0_6_0"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/sd_resource_reqs/hw_block_interrupt_vector.html?cp=2_3_1_0_6_0&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Those marked blocked are all (except FICR) able to generate events and interrupts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash are events scheduled or interrupts?</title><link>https://devzone.nordicsemi.com/thread/122201?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2018 21:43:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbd93832-a40c-4417-953d-1dcd20e535ed</guid><dc:creator>Jordan Archer</dc:creator><description>&lt;p&gt;Thanks, that helps.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But, I could use one clarification.&amp;nbsp; When you say softdevice interrupts, do you mean interrupts that softdevice is handling?&amp;nbsp; i.e the radio operations.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash are events scheduled or interrupts?</title><link>https://devzone.nordicsemi.com/thread/122060?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2018 08:51:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2aaaad8-b195-434f-a269-c3106725770b</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;if you use the app_scheduler, and you have setup your softdevice handler to use it as well, all Softdevice events (SoC, BLE, ANT, System) will be scheduled through the app_scheduler, and handled in a FIFO principle. Softdevice interrupts are asynchronous to the application, and&amp;nbsp;it is not recommended to do a global __disable_irq(); while the softdevice is running. Please note that the CRITICAL_REGION_ENTER/EXIT API in the SDK is provided to disable application interrupts, and not softdevice interrupts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash are events scheduled or interrupts?</title><link>https://devzone.nordicsemi.com/thread/122013?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2018 22:19:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b78210b-2241-4d8e-8792-5bb2d3a39938</guid><dc:creator>Jordan Archer</dc:creator><description>&lt;p&gt;That doesn&amp;#39;t answer the question.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I understand softdevice is scheduling the flash operation in the background, due to BLE management requirements.&amp;nbsp; But that doesn&amp;#39;t answer the relationship of the sd flash event notifications to the application and use of&amp;nbsp;&lt;span&gt;&lt;strong&gt;app_sched_execute&lt;/strong&gt;.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m trying to understand if my application code flash event handling, will be asynchronously&amp;nbsp;called.&amp;nbsp; If it is, I need to protect parts of what I&amp;#39;m doing with critical sections.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This breaks down into what is the relationship in scheduling between&amp;nbsp;app_sched_execute (or app events), sd events and hardware level interrupts.&amp;nbsp; Are sd events and app events synchronized?&amp;nbsp; Or should everything at the app level treat sd events being signaled as asynchronous (interrupts) in execution.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash are events scheduled or interrupts?</title><link>https://devzone.nordicsemi.com/thread/122011?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2018 21:31:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:622c05c3-5e2c-4c21-86d8-dc0d10a72cc8</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Jordan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The sd_flash_* API is a scheduled operation, which will be queued by the application and executed at a later point, in-between your bluetooth events, so that&amp;nbsp;your connection(s) is &amp;quot;the least disrupted&amp;quot;. You&amp;#39;ll then get a event back to the application with either _SUCCESS or _ERROR from the SoftDevice-handler.&lt;/p&gt;
&lt;p&gt;More info on how the softdevice handles these events are described here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/processor_avail_interrupt_latency/flash_usage_patterns.html?cp=2_3_1_0_15_2_0"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/processor_avail_interrupt_latency/flash_usage_patterns.html?cp=2_3_1_0_15_2_0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Why does the softdevice handle flash operations?&lt;/p&gt;
&lt;p&gt;It is mainly because the hardware peripheral for flash erase or write will halt the CPU when it&amp;#39;s on-going. In this sense, you can look at the NVMC-peripheral as a blocking interrupt, which will halt the CPU until the flash operation is finished. Any pending event occurring while the&amp;nbsp;flash-operation is on-going&amp;nbsp;will be handled afterwards, like a TIMERx event or a UART_RX event. This is because peripherals runs independent of the CPU state. This is similar for a normal debug session, where you halt the CPU, but all enabled peripherals still runs (timer keeps counting, rtc keeps ticking, etc.)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As a historical aspect, early versions of the first SoftDevice (back in &amp;#39;11 or &amp;#39;12, for the nRF51-series) did not handle flash operations in the stack, so the application needed to do this when a connection-interval was finished. However, this might cause timing-errors if you used a lower connection interval, like 7.5ms, and triggered an _ERASE operation. The&amp;nbsp;flash operation handling was therefore moved to the stack, so that it could handle such a scenario in a more graceful way, and not cause assertions in the application for tight timing scenarios.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The hardware peripheral that triggers flash operations is the NVMC, which you can read about here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/nvmc.html?cp=2_1_0_10#concept_pcl_wbz_vr"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/nvmc.html?cp=2_1_0_10#concept_pcl_wbz_vr&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>