<?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>Can I use MPU to mark all of SRAM as XN, when using SoftDevice v5.0.0?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43502/can-i-use-mpu-to-mark-all-of-sram-as-xn-when-using-softdevice-v5-0-0</link><description>Similar question to https://devzone.nordicsemi.com/f/nordic-q-a/38571/can-i-use-mpu-to-mark-memory-as-xn-when-using-softdevice 
 but this is specifically about SoftDevice v5.0.0. Does this version of SoftDevice run any code from RAM? 
 If not, is it therefore</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Feb 2019 14:43:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43502/can-i-use-mpu-to-mark-all-of-sram-as-xn-when-using-softdevice-v5-0-0" /><item><title>RE: Can I use MPU to mark all of SRAM as XN, when using SoftDevice v5.0.0?</title><link>https://devzone.nordicsemi.com/thread/170415?ContentTypeID=1</link><pubDate>Mon, 11 Feb 2019 14:43:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c5db06c-d158-4c2e-96f5-f2e9cc3ef290</guid><dc:creator>rjshade</dc:creator><description>&lt;p&gt;That&amp;#39;s great, thanks for the quick response.&lt;/p&gt;
&lt;p&gt;The reason that I&amp;#39;m keen to protect all of SRAM is that the MPU has restrictions on the regions that it can protect: namely a region must begin at an address that&amp;#39;s naturally aligned with the region size. For that reason it seems much simpler to set all of SRAM as a single region with XN set, than to try and determine, at runtime, where SoftDevice ends and then to figure out the necessary region size and alignment.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I use MPU to mark all of SRAM as XN, when using SoftDevice v5.0.0?</title><link>https://devzone.nordicsemi.com/thread/170315?ContentTypeID=1</link><pubDate>Mon, 11 Feb 2019 10:33:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82689c75-3340-4e57-8744-3ad7dcd15309</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="70915" url="~/f/nordic-q-a/43502/can-i-use-mpu-to-mark-all-of-sram-as-xn-when-using-softdevice-v5-0-0"] Does this version of SoftDevice run any code from RAM?[/quote]
&lt;p&gt;No, it does not.&lt;/p&gt;
[quote userid="70915" url="~/f/nordic-q-a/43502/can-i-use-mpu-to-mark-all-of-sram-as-xn-when-using-softdevice-v5-0-0"]If not, is&amp;nbsp;it therefore safe&amp;nbsp;to mark all of SRAM [0x20000000 - 0x20010000] as XN using the MPU?[/quote]
&lt;p&gt;Yes, that should be safe. But it might not be necessary. The SoftDevice&amp;nbsp;&lt;span&gt;protects the SoftDevice RAM Region so that it cannot be written to by the application at runtime using the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/mwu.html?cp=2_1_0_44#concept_hqv_lq2_1s"&gt;MWU&lt;/a&gt;. Violation of sandboxing rules, for example, an attempt to write to the protected SoftDevice memory, will result in the triggering of a fault (unrecoverable error handled by the application).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>