<?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>Is MWU in Softdevice?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59170/is-mwu-in-softdevice</link><description>Hi, 
 I am using nRF52832 along with Softdevice 6.0.0, SDK 15.0.0, Chip Revision 2 (QFAA-EX0). 
 I understand that softdevice uses MWU from this document 
 
 As per the Errata 75 there is increased current consumption when MWU is used. 
 We are not using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Mar 2020 14:28:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59170/is-mwu-in-softdevice" /><item><title>RE: Is MWU in Softdevice?</title><link>https://devzone.nordicsemi.com/thread/241173?ContentTypeID=1</link><pubDate>Mon, 23 Mar 2020 14:28:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e23fb01-ca8a-4df2-96b8-d2a790c4b23f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;if you are not using the softdevice and you are not enabling MWU anywhere in the application, then you do not need to apply workaround for Errata 75.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is MWU in Softdevice?</title><link>https://devzone.nordicsemi.com/thread/240966?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2020 22:15:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f6e5efc-08c3-44b8-b1ac-6c53c89e826a</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;You don&amp;#39;t; just the other workaround.&amp;nbsp; I use both though and am hoping for any feedback from other users. I hadn&amp;#39;t anticipated having to look so closely at this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is MWU in Softdevice?</title><link>https://devzone.nordicsemi.com/thread/240965?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2020 22:07:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c80d6a3b-1ddf-41ef-bc74-d7044e278960</guid><dc:creator>Justin</dc:creator><description>&lt;p&gt;If we are not using softdevice and not using MWU why do we need to add the workaround?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is MWU in Softdevice?</title><link>https://devzone.nordicsemi.com/thread/240964?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2020 22:03:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05c53059-c169-4b1f-8b17-e1a1744d1b8b</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;For a more general case where the Softdevice is/isn&amp;#39;t installed and user code does/doesn&amp;#39;t use the MWU I am using the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Errata 75: MWU: Increased current consumption
//  This has to be handled by turning off MWU region 0 which is used in SoftDevice
//  see https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52832_EngB%2FERR%2FnRF52832%2FEngineeringB%2Flatest%2Fanomaly_832_75.html
#define MWU_ACCESS_WATCH_MASK (0x0F0000FF)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The code replacing the WFE() is as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  // Errata 220: CPU: RAM is not ready when written - Disable IRQ while using WFE
  // Enable SEVONPEND to disable interrupts so the internal events that generate the interrupt cause wakeuup in __WFE context and not in interrupt context
  // Before: ENABLE_WAKEUP_SOURCE -&amp;gt; __WFE -&amp;gt; WAKEUP_SOURCE_ISR -&amp;gt; CONTINUE_FROM_ISR  next line of __WFE
  // After:  ENABLE_WAKEUP_SOURCE -&amp;gt; SEVONPEND -&amp;gt; DISABLE_INTERRUPTS -&amp;gt; __WFE -&amp;gt; WAKEUP inside __WFE -&amp;gt; ENABLE_interrupts -&amp;gt; WAKEUP_SOURCE_ISR
  //
  // Errata 75: MWU: Increased current consumption
  // This has to be handled by turning off MWU but it is used in SoftDevice
  // see https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52832_EngB%2FERR%2FnRF52832%2FEngineeringB%2Flatest%2Fanomaly_832_75.html
  //
  // Errata 220: Enable SEVONPEND
  SCB-&amp;gt;SCR |= SCB_SCR_SEVONPEND_Msk;
  __disable_irq();
  // Errata 75: MWU Disable
  uint32_t MWU_AccessWatchMask = NRF_MWU-&amp;gt;REGIONEN &amp;amp; MWU_ACCESS_WATCH_MASK;
  // Handle MNU if any areas are enabled
  if (MWU_AccessWatchMask)
  {
     NRF_MWU-&amp;gt;REGIONENCLR = MWU_AccessWatchMask; // Disable write access watch in region[0] and PREGION[0]
     __WFE();
     __NOP(); __NOP(); __NOP(); __NOP();
     // Errata 75: MWU Enable
     NRF_MWU-&amp;gt;REGIONENSET = MWU_AccessWatchMask;
  }
  else
  {
     __WFE();
     __NOP(); __NOP(); __NOP(); __NOP();
  }
  __enable_irq();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This code is required in &lt;em&gt;nrf_pwr_mgmt.c&lt;/em&gt;, &lt;em&gt;main.c&lt;/em&gt; and &lt;em&gt;nrf_soc.c&lt;/em&gt; to cover our use cases with both BLE SoftDevice and without. Feel free to provide constructive feedback .. this is very hard to test!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is MWU in Softdevice?</title><link>https://devzone.nordicsemi.com/thread/240758?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2020 07:36:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b24226fe-f3c4-411a-af4f-9904c908e599</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am sorry Justin,&lt;/p&gt;
&lt;p&gt;It is my fault that I did not think about Errata 75 when suggesting you to apply the workaround for Errata 220.&lt;/p&gt;
&lt;p&gt;You are right, we need to apply the workaround of Errata 75 too into the workaround of Errata-220.&lt;/p&gt;
&lt;p&gt;So the required and combined workaround&amp;nbsp;for 220 and 75 becomes like below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SCB-&amp;gt;SCR |= SCB_SCR_SEVONPEND_Msk;
__disable_irq();

/* MWU Disable */
NRF_MWU-&amp;gt;REGIONENCLR
    = ((MWU_REGIONENCLR_RGN0WA_Clear &amp;lt;&amp;lt; MWU_REGIONENCLR_RGN0WA_Pos) 
     | (MWU_REGIONENCLR_PRGN0WA_Clear &amp;lt;&amp;lt; MWU_REGIONENCLR_PRGN0WA_Pos));

__WFE()
__nop();__nop();__nop();__nop();

/* MWU Enable */
NRF_MWU-&amp;gt;REGIONENSET
    = ((MWU_REGIONENSET_RGN0WA_Set &amp;lt;&amp;lt; MWU_REGIONENSET_RGN0WA_Pos) 
     | (MWU_REGIONENSET_PRGN0WA_Set &amp;lt;&amp;lt; MWU_REGIONENSET_PRGN0WA_Pos));

__enable_irq();&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is MWU in Softdevice?</title><link>https://devzone.nordicsemi.com/thread/240750?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2020 07:00:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f34b012-b07d-4e78-ae50-abf01f4f3dae</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Sorry for the delayed reply, I think we need to do, I am asking the experts to confirm this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is MWU in Softdevice?</title><link>https://devzone.nordicsemi.com/thread/240288?ContentTypeID=1</link><pubDate>Tue, 17 Mar 2020 14:38:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f4f23be-1400-4cd0-9592-c22ac8b9b090</guid><dc:creator>Justin</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;In &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/58988/errata-220-cpu-ram-is-not-ready-when-written"&gt;this&lt;/a&gt; ticket you asked us to use __WFE instead of sd_app_evt&amp;nbsp;as a workaround for Errata 220.&lt;/p&gt;
&lt;p&gt;Please suggest what needs to be done in this case?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is MWU in Softdevice?</title><link>https://devzone.nordicsemi.com/thread/240272?ContentTypeID=1</link><pubDate>Tue, 17 Mar 2020 13:30:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90871609-3498-4717-8304-8997f5f0758a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;If you use sd_app_evt_wait to sleep, then the workaround is applied inside this sleep function. But if you use __WFE instead of sd_app_evt_wait, then when you go to sleep then MWU remains enabled by the softdevice and the ERRATA issue exists keeping higher power consumption in the sleep.&lt;/p&gt;
&lt;p&gt;Is there any specific reason you do not use sd_app_evt_wait() to go to sleep?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>