<?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>Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48436/configure-spm-peripherals-without-modifying-spm-files</link><description>Hi, 
 
 I am using &amp;quot;http_upgrade_ota&amp;quot; project. 
 I have added UARTE2 , SPIM3 and WDT peripherals in the application. 
 To use this peripherals i had to make change in &amp;quot;spm.c&amp;quot; file as below 
 
 spm_config_peripheral( NRFX_PERIPHERAL_ID_GET(NRF_UARTE2)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Jan 2020 09:56:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48436/configure-spm-peripherals-without-modifying-spm-files" /><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/231065?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 09:56:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e877a447-68f4-4b90-912e-f6db8efdfe27</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;If you want to enable/disable configurations of another module without modifying it directly, you should use the approach explained here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/56459/watchdog-with-bootloader-on-nrf9160"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/56459/watchdog-with-bootloader-on-nrf9160&lt;/a&gt;. This allows you to have several projects with different secure/nonsecure peripherals.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/230992?ContentTypeID=1</link><pubDate>Sun, 26 Jan 2020 15:22:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0b29924-c1a3-49cc-a1d1-a91b1f682b76</guid><dc:creator>StefanHri</dc:creator><description>&lt;p&gt;Dear &lt;a href="https://devzone.nordicsemi.com/members/simon"&gt;Simon Ferres&lt;/a&gt; and &lt;a href="https://devzone.nordicsemi.com/members/smitesh-mali"&gt;Smitesh Mali&lt;/a&gt; did you solve this problem?&lt;/p&gt;
&lt;p&gt;For my evaluations I want to have several separate projects with different peripherals places in the secure wold. Therefore, it is not practical to modify nrf/subsys/spm/spm.c.&lt;/p&gt;
&lt;p&gt;In the bast case I need a boilerplate which I can place outside the ncs folder.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/196248?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 12:07:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0d1b092-5721-49ad-92d2-72b05c1c55fe</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I explained your problem to one of the developers, and&amp;nbsp;he said that the intended way of&amp;nbsp;configuring&amp;nbsp;non-secure peripherals was to&amp;nbsp;do it through nrf/subsys/spm/spm.c. If the peripherals was not included you had to either: &lt;strong&gt;Modify the SPM library yourself or wait for somebody to add it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;However, &lt;em&gt;somebody&lt;/em&gt; could be you, he said the following about modifying the library:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;they can open a pull request to nrf themselves if they like&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;if they have a patch they can just submit it&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Link to the nrf repo:&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf"&gt;https://github.com/NordicPlayground/fw-nrfconnect-nrf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/196207?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 09:27:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60178614-f678-455b-8070-2891dd96b8fe</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Ok. I will ask &lt;span&gt;of the developers of the SPM library of how to go about this.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/196205?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 09:18:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcf8277e-aa66-4b1a-aae9-eb808d64146b</guid><dc:creator>Smitesh Mali</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;But then it will collide with the&amp;nbsp;&amp;quot;&lt;span&gt;CMakeLists.txt&amp;quot;&amp;nbsp; of &amp;quot;\ncs\nrf\samples\CMakeLists.txt&amp;quot; path.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Both will have below statement&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;if (CONFIG_SPM)&lt;br /&gt; zephyr_add_executable(spm require_build)&lt;br /&gt; if (${require_build})&lt;br /&gt; add_subdirectory(nrf9160/spm ${CMAKE_BINARY_DIR}/spm)&lt;br /&gt; endif ()&lt;br /&gt;endif()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In application &amp;quot;CMakeLists.txt&amp;quot; file &amp;quot;add_subdirectory(ncs/myfolder/spm ${CMAKE_BINARY_DIR}/spm)&amp;quot;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;path will be different. but it will give error.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/196200?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 09:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e52e8bc-1e2f-4e04-aa49-52cd5ae2d2c6</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;A solution might be to put it in the CMakeLists.txt file inside &amp;lt;..&amp;gt;\&lt;em&gt;ncs\nrf\samples\nrf9160\http_application_update. &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;However, you are free to place the application folder wherever you want, e.g. in&amp;nbsp;&lt;em&gt;C:\ncs_projects\http_application_update.&amp;nbsp;&lt;/em&gt;All you have to do is to set ZEPHYR_BASE appropriately, and cmake will find all the repositories (nrf, zephyr, nrfxlib etc..).&lt;/p&gt;
&lt;p&gt;In the &lt;a href="https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/getting-started-cellular/posts/nrf-connect-sdk-tutorial"&gt;NCS tutorial&lt;/a&gt;, under&amp;nbsp;&lt;em&gt;2.1.4 Manage your project with west -- How to preserve your application,&amp;nbsp;&lt;/em&gt;&amp;nbsp;I will soon explain where and how to develop your application.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/196186?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 08:53:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce5d8aaa-7aae-4a61-9277-73e3fbf87ea3</guid><dc:creator>Smitesh Mali</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Above option you suggested would bring change inside &amp;quot;nrf&amp;quot; folder.&lt;/p&gt;
&lt;p&gt;So this option is not feasible.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Smitesh Mali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/196042?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2019 14:29:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f264424a-7d14-4eb8-be08-8c1e170ce4f9</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I think this should be possible, take a look at ..\ncs\nrf\samples\CMakeLists.txt and the following lines:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (CONFIG_SPM)
  zephyr_add_executable(spm require_build)
  if (${require_build})
    add_subdirectory(nrf9160/spm ${CMAKE_BINARY_DIR}/spm)
  endif ()
endif()&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can see that the SPM path is added through the line&amp;nbsp;&lt;em&gt;add_subdirectory(..).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In order to use another path, e.g. &lt;em&gt;ncs/your_folder&lt;/em&gt;, try this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;add_subdirectory(../your_folder/spm ${CMAKE_BINARY_DIR}/spm)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If this doesn&amp;#39;t work, please tell me and I will look into it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/195339?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2019 10:46:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:131d38a0-1162-4211-92e0-bf6e19172188</guid><dc:creator>Smitesh Mali</dc:creator><description>&lt;p&gt;Hi simon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;any update on this issue ?&lt;/p&gt;
&lt;p&gt;I want to ask whether we can change path of &amp;quot;SPM&amp;quot; project included in the &amp;quot;http_update_ota&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;project.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If we can then i can move SPM outside &amp;quot;nrf&amp;quot; folder and use it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Smitesh Mali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/193021?ContentTypeID=1</link><pubDate>Sat, 15 Jun 2019 19:50:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17d44944-f808-4d8e-adb4-2e223b2c21af</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;In order to set a peripheral to a Non-Secure state, you have to access the SPU register&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf9160%2Fspu.html&amp;amp;cp=2_0_0_5_14&amp;amp;anchor=register.PERIPHID-0-66.PERM"&gt;PERIPHID[n].PERM&lt;/a&gt;, and I don&amp;#39;t think this is possible to do from Non-Secure firmware. E.g. the&amp;nbsp;user application (I couldn&amp;#39;t find any documentation confirming this, but it doesn&amp;#39;t make sense that Non-Secure firmware can modify the Security state of peripherals).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If my understanding is right, you have to configure security state of the peripheral from a separate &lt;strong&gt;Secure&lt;/strong&gt; firmware image. Thus you have to do it from the SPM application.&lt;/p&gt;
&lt;p&gt;I understand your concern about modifying Nordic libraries, as it doesn&amp;#39;t seem like a clean way of doing things.&lt;/p&gt;
&lt;p&gt;However, I will be gone for the next two weeks, but I will ask somebody else to take over the case, which can ask one of the developers of the SPM library how to go about this.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/192813?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2019 04:27:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:286162f0-33c4-442f-be21-f34cc09d8b45</guid><dc:creator>Smitesh Mali</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I think there is some disconnect between what i want&amp;nbsp; and what you understood from my question.&lt;/p&gt;
&lt;p&gt;I know that by modifying kconfig and spm.c&amp;nbsp; or by modifying proj.conf file we can configure peripheral.&lt;/p&gt;
&lt;p&gt;But all these files are inside &amp;quot;nrf&amp;quot; submodule.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t want to modify any of these files inside &amp;quot;nrf&amp;quot; submodule and want to use it as it is provided by you through github.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If we want to make change to application then we generally copy that application folder outside&lt;/p&gt;
&lt;p&gt;&amp;quot;nrf&amp;quot; folder and then we use it so that there is no change inside &amp;quot;nrf&amp;quot; folder.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As you mentioned in your earlier thread &amp;quot;UARTE2&amp;quot; and &amp;quot;SPIM3&amp;quot; are both included as &amp;quot;Non-secure&amp;quot; in&amp;nbsp;&lt;/p&gt;
&lt;p&gt;spm.c file. So i don&amp;#39;t need to configure them.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Only peripheral i need to configure is &amp;quot;WDT&amp;quot;.&lt;/p&gt;
&lt;p&gt;So is there a way to configure &amp;quot;WDT&amp;quot; as non-secure without modifying &amp;quot;kconfig&amp;quot; or &amp;quot;spm.c&amp;quot; or &amp;quot;proj.conf&amp;quot;&lt;/p&gt;
&lt;p&gt;files inside &amp;quot;nrf&amp;quot; submodule ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Smitesh Mali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/192800?ContentTypeID=1</link><pubDate>Thu, 13 Jun 2019 23:04:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4862248-6376-4d80-a031-7392aabea28d</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Take a look at the &lt;a href="https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/getting-started-cellular/posts/nrf-connect-sdk-tutorial"&gt;nRF Connect SDK Tutorial&lt;/a&gt;, at the bottom of &lt;a href="https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/getting-started-cellular/posts/nrf-connect-sdk-tutorial#h158sjwjjwp3j1gz499wsfryw01mj8tuc"&gt;section 2.2.4&lt;/a&gt;. There I am showing how to include peripherals to the SPM library.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/192302?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 09:32:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2777b37a-aad4-42d7-af96-eb9b318b8066</guid><dc:creator>Smitesh Mali</dc:creator><description>&lt;p&gt;Simon,&lt;/p&gt;
&lt;p&gt;If i don&amp;#39;t write below in spm.c file inside &amp;quot;spm_jump()&amp;quot; function then&amp;nbsp;&lt;/p&gt;
&lt;p&gt;spm doesn&amp;#39;t jump to the application&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;spm_config_peripheral(&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;NRFX_PERIPHERAL_ID_GET(NRF_UARTE2), 0);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;spm_config_peripheral(&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;NRFX_PERIPHERAL_ID_GET(NRF_SPIM3_S), 0);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;spm_config_peripheral(&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;NRFX_PERIPHERAL_ID_GET(NRF_WDT_S), 0);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I either need to write above 3 functions in &amp;quot;spm_jump()&amp;quot; function or i need to add macro as i mentioned in above thread&amp;nbsp;&lt;/p&gt;
&lt;p&gt;in the proj.conf.&lt;/p&gt;
&lt;p&gt;otherwise &amp;quot;spm&amp;quot; won&amp;#39;t jump to application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So basically i don&amp;#39;t want to make these changes to &amp;quot;nrf&amp;quot; submodule files.&lt;/p&gt;
&lt;p&gt;So is it possible ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Smitesh Mali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure SPM peripherals without modifying SPM files</title><link>https://devzone.nordicsemi.com/thread/192297?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 09:18:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:701b70af-e857-4718-bb65-387e08db4358</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;&lt;strong&gt;UPDATE 2/24/2020:&amp;nbsp;&lt;/strong&gt;Check out&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/56459/watchdog-with-bootloader-on-nrf9160"&gt; this ticket&lt;/a&gt; for instructions on how to do this&amp;nbsp;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;If you look at the latest commit of the nrf repo, you can see that the the &lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/subsys/spm/spm.c"&gt;subsys/spm&lt;/a&gt; library includes both the UARTE2 and SPIM3, so I don&amp;#39;t see any problems of you modifying the library. I am not sure&amp;nbsp;if the WDT will be inlcuded, but I can look into it if you would like so.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;
&lt;div style="left:214px;position:absolute;top:-20px;" id="gtx-trans"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>