<?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>nrf_dfu_wait funcion never return</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27133/nrf_dfu_wait-funcion-never-return</link><description>hello, 
 I use nrf51822 + S130 + SDK12.2 in my product, nrf51822 work at central + peripheral mode，and i use nrf_duf_flash module for my dfu funtion. 
 The problem is, i use my dongle(as central role) connect my product(as peripheral role) and send</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Nov 2017 02:43:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27133/nrf_dfu_wait-funcion-never-return" /><item><title>RE: nrf_dfu_wait funcion never return</title><link>https://devzone.nordicsemi.com/thread/106807?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 02:43:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:028a7184-db61-4d7d-b8df-2764070b2f8f</guid><dc:creator>Ian</dc:creator><description>&lt;p&gt;I debug the program and  watch NVIC_IP register and call NVIC_GetPriority(SD_EVT_IRQn) function,they all showed that the priority of SD_EVT_IRQn is 3 but not 2.&lt;/p&gt;
&lt;p&gt;I tried change the priority of SD_EVT_IRQn use NVIC_SetPriority(SD_EVT_IRQn, 2), but no matter where i use it (e.g. before or after SOFTDEVICE_HANDLER_INIT,before or after softdevice_enable_get_default_config, before or after softdevice_enable) the program will crash.&lt;/p&gt;
&lt;p&gt;How can I I set or change the priority of SD_EVT_IRQn?&lt;/p&gt;
&lt;p&gt;PS:The details here &lt;a href="https://devzone.nordicsemi.com/question/178078/ble-interrupt-priority-question-and-ble-event-lost-issue/"&gt;link text&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_dfu_wait funcion never return</title><link>https://devzone.nordicsemi.com/thread/106806?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2017 12:00:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:264d2397-68ca-435d-adf7-67b3a1bfe88f</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;You are right of course. I forgot that you were using nRF51. You cannot use level 7 and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.sds/dita/softdevices/s130/processor_avail_interrupt_latency/exception_mgmt_sd.html?cp=3_7_2_0_15_1"&gt;the lowest available level for nRF51 is 3&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_dfu_wait funcion never return</title><link>https://devzone.nordicsemi.com/thread/106808?ContentTypeID=1</link><pubDate>Sun, 12 Nov 2017 13:33:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa2fa560-7f75-423b-a649-f8b8976582d8</guid><dc:creator>Ian</dc:creator><description>&lt;p&gt;Are  you sure i can change he priority of the BLE events use &lt;code&gt;NVIC_SetPriority(SD_EVT_IRQn, 7);&lt;/code&gt;? I am use nrf51822,and the lowest interrupt priority is 3. I try this before, the system will reset in APP_ERROR_CHECK.&lt;/p&gt;
&lt;p&gt;By the way, if i do nothing,the interrupt priority of BLE events is 2, is it right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_dfu_wait funcion never return</title><link>https://devzone.nordicsemi.com/thread/106805?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 10:21:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ea2dace-8c3a-419b-9758-eb7874fd3f0a</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;It should be possible to change the priority of the BLE events like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NVIC_SetPriority(SD_EVT_IRQn, 7);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But be aware that you should only use interrupt priorities allocated to the application, and using an interrupt priority higher than the SVC handler doesn&amp;#39;t really make sense (since it means you can&amp;#39;t call SoftDevice functions inside the event handler), so the only recommended options are 6 and 7.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_dfu_wait funcion never return</title><link>https://devzone.nordicsemi.com/thread/106804?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 09:07:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7172dc6b-f04a-43e5-bb3c-2f3143cc6718</guid><dc:creator>Ian</dc:creator><description>&lt;p&gt;I found SD_EVT_IRQn has the lowest interrupt priority, as same as UART interrupt priotiry, and i can not change SD_EVT_IRQn to a higher interrupt priority（if i do so, the  system will reset in APP_ERROR_CHECK）. I did not operate flash from the UART handler,  i recive data from BLE dongle and put them to a app_fifo， in main funcion i get data and write it to flash, so that does not matter to UART handler.  The flag variable m_flags is not declare by me, it declare in nrf_dfu_flash.c, which is part of SDK12.3.&lt;/p&gt;
&lt;p&gt;In this case, is it prosible that UART receive data continuous cause SD_EVENT_IRQ ISR can not execute and then miss some event? Or is there has some other reasons?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_dfu_wait funcion never return</title><link>https://devzone.nordicsemi.com/thread/106803?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2017 15:12:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8818fc5-8ff9-4c04-85b4-bc5d52c6778f</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;You are probably right in that it is a interrupt priority issue. Are you doing flash writes from the UART handler? Have you made sure to declare you flag variables as volatile?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_dfu_wait funcion never return</title><link>https://devzone.nordicsemi.com/thread/106809?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2017 07:59:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f43814e5-2e69-4833-a20d-dda86da50621</guid><dc:creator>Ian</dc:creator><description>&lt;p&gt;I do some test last night, found this problem is not caused by ble connection, it seems like caused by uart isr.&lt;/p&gt;
&lt;p&gt;When i got DFU_START command from ble dongle, i disable the uart, then this problem will not appear， if i do not disable uart, the problem will appear.&lt;/p&gt;
&lt;p&gt;I think, maybe when the uart is enabled, when uart receive data, the ISR is called, and this sometimes make the SWI2 ISR can not be called, then miss fs event, cause FLASH_FLAG_OPER flag never be clear. But the IRQ priority of uart is set to APP_IRQ_PRIORITY_LOWEST, how can it make CPU miss a higher priority IRQ (SWI2 used by softdevice)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_dfu_wait funcion never return</title><link>https://devzone.nordicsemi.com/thread/106811?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2017 07:35:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e322788-bf1d-46aa-ad81-95b0a896d1c0</guid><dc:creator>Ian</dc:creator><description>&lt;p&gt;Thank you first!&lt;/p&gt;
&lt;p&gt;I use SDK12.2, and the nrf_dfu_flash_wait is not an &amp;quot;end station&amp;quot;， it is &amp;quot;nrf_dfu_flash_wait&amp;quot; but not &amp;quot;nrf_flash_wait&amp;quot;。 This function wait the FLASH_FLAG_OPER  flag in m_flags be cleared, then return.&lt;/p&gt;
&lt;p&gt;I test both debug and free run.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_dfu_wait funcion never return</title><link>https://devzone.nordicsemi.com/thread/106810?ContentTypeID=1</link><pubDate>Tue, 22 Aug 2017 10:18:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bc547b9-3d87-4222-88f3-f25501ecdb60</guid><dc:creator>Goature</dc:creator><description>&lt;p&gt;As far as I know, you seem to be experiencing a feature, not a bug. sd_app_evt_wait will actually not return. When debugging, your IDE may lose its tracks when this functions is entered, because that function is an &amp;quot;end station&amp;quot;. The nRF won&amp;#39;t do any more work, unless a timer/interrupt/reset is done.&lt;/p&gt;
&lt;p&gt;Hope that helps.&lt;/p&gt;
&lt;p&gt;Edit: changed to sd_app_evt_wait&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>