<?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>Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97014/trying-to-write-external-flash-with-sdk-2-2-0</link><description>I&amp;#39;ve been porting an app written for SDK 1.8.0 to SDK 2.2.0 
 In the old app I&amp;#39;ve been accessing internal flash memory with device_get_binding ( &amp;quot;NRF_FLASH_DRV_NAME&amp;quot; ); It appears that with 2.2.0 moving to the partition manager that this no longer works</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Feb 2023 15:54:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97014/trying-to-write-external-flash-with-sdk-2-2-0" /><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412575?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 15:54:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dc8ab39-d7e3-4a1d-91af-0e9c273e92ed</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;OK, that worked.&amp;nbsp; I copied partiions.yaml to the file pm_static.yml in my project directory.&amp;nbsp; Edited it to make a portion of my app memory be a stand along partition in the tfm non-secure space and I was able to use it as a writable flash section without screwing up the bootloader.&lt;/p&gt;
&lt;p&gt;So we can mark this as complete.&amp;nbsp; Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412533?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 13:51:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b915264-f2eb-41e4-a633-ddce22ca6809</guid><dc:creator>variant</dc:creator><description>&lt;p&gt;There&amp;#39;s info on that file&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#ug-pm-static"&gt;here&lt;/a&gt;.&amp;nbsp; It might be worthwhile to peruse the entire discussion of the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#ug-pm-static"&gt;Partition Manager&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412529?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 13:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:427d1766-87cc-4f67-9edc-2f4d6d41ff67</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;No.&amp;nbsp; My project is the serial_lte_modem example.&amp;nbsp; So I have everything that is in that application.&amp;nbsp; Is there any description of the use of this file that I can use to create new partitions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412527?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 13:42:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:621e178d-4f69-4aa2-8537-bce4a68c2daa</guid><dc:creator>variant</dc:creator><description>&lt;p&gt;Do you have a pm_static.yml file in your project top-level directory?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412524?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 13:34:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c99af6bc-11e2-4e2a-8629-7a72155facd0</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;Can you give me information about how to redefine the memory partitions.&amp;nbsp; the partitions.yaml file is in the build directory and I can&amp;#39;t find the source files that are used it creating it.&amp;nbsp; I need to be able to change the parition table.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412523?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 13:33:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57c89f96-ec04-48a7-858f-43ad349664bc</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;This is already enabled for my application&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412522?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 13:28:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d63c23b-5028-47bd-b7ea-1098d2c2bcaa</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Try to enable&amp;nbsp;&lt;span&gt;&lt;span dir="ltr"&gt;CONFIG_MPU_ALLOW_FLASH_WRITE for instance.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;-Amanda H.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412521?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 13:27:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53bdd0c7-ecfe-47ce-bef8-e19a4f9b7e10</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;Contining self discovery since I&amp;#39;m not getting any responses, I was able to get internal flash erase/writing working by definiing a const variable in the application that is aligned on a 32k byte boundary.&amp;nbsp; The problem is, that since I&amp;#39;m changing the contents of the application space.&amp;nbsp; The problem with this is that it changes the app image in flash and&amp;nbsp;the bootloader no longer considers it a bootable image.&amp;nbsp; So I need to either be able to figure out how to take out a segment of the app image and define it as a new, non-secure flash partition, or change the bootloader not to do the validation test.&amp;nbsp; Can you help me with either of these?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Randall&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412291?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 13:45:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:141a6a2e-aff5-412d-9775-845b73e517cf</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;I just realized that I mistittled this ticket.&amp;nbsp; I&amp;#39;m not trying to write external flash, but internal flash.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been looking at partitions.yml to try to figure things out.&amp;nbsp; It looks like this section is now defined;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;EMPTY_2&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;address&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;0xf0000&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;end_address&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;0xf8000&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;placement&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;after&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; - &lt;/span&gt;&lt;span&gt;mcuboot_secondary&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;region&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;flash_primary&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;size&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;0x8000&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;That used to be the scratch image in the pre 2.x SDKs.&amp;nbsp; I combined the scratch and the storage partitions in my old builds because I needed 64K of internal storage for my application.&amp;nbsp; Is there anyway to define a 64k chunk somewhere that can be setup an non_secure?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412041?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 15:40:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc3e5b0e-bd26-4dfd-bda7-0cd44162649f</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;&lt;span&gt;I have no idea what uart1 has to do with all of this.&amp;nbsp; I&amp;#39;m trying to write to flash.&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I&amp;#39;m getting my flash device like this;&amp;nbsp;flashDev = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller));&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Then I&amp;#39;m trying to erase like this;&amp;nbsp;err = flash_erase( flashDev, FLASH_BIN_OFFSET, FLASH_BIN_SIZE ))&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Where FLASH_BIN_OFFSET = 0xF0000 (the start of the scratch_partition) and SIZE is the size of the partition.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;When the erase code gets to the following&amp;nbsp;line;&amp;nbsp;&amp;nbsp; &amp;nbsp; *(volatile uint32_t *)page_addr = 0xFFFFFFFF; in file nrf_nvmc.h of the inline function nrf_nvmc_page_erase_start, it immediately&amp;nbsp;goes to the C_SecureFault_Handler in faults.c&lt;/div&gt;
&lt;div&gt;&amp;nbsp;and page_addr = 0xF0000, so it&amp;#39;s as it should be.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Randall&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412027?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 15:05:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fad3e572-b7af-422f-a794-b5dff1dfb096</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;In NCS, we use the Partition Manager, not the device tree to partition the flash.&amp;nbsp;The Partition Manager is enabled automatically in multi-image builds (such as when you build for non-secure, and get TF-M automatically)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Which peripheral instance do you use to communicate with the flash?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;We have always used the Partition Manager, but we switched to TF-M somewhere around 2.0.0. And TF-M by default takes control over UART1&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/412000?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 14:11:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62de59e6-3ce4-40cd-a022-8c40a8c0059a</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;OK. well by using;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;flashDev &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;DEVICE_DT_GET&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;DT_CHOSEN&lt;/span&gt;&lt;span&gt;(zephyr_flash_controller));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Seems to work.&amp;nbsp; But then when I try to erase sectors in there I get a security violation.&amp;nbsp; I&amp;#39;ve tried to update my _ns .dts to add the scratch partiion;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;chosen&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;zephyr,flash&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;flash0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;zephyr,sram&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;sram0_ns&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;zephyr,code-partition&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;slot0_ns_partition&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;zephyr,scratch-partition&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;scratch_partition&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;But I still get the security violation.&amp;nbsp; I&amp;#39;m trying ot figure out how to get this partition configured so that I can erase/write it from my non-secure app.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Thanks.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to write external flash with SDK 2.2.0</title><link>https://devzone.nordicsemi.com/thread/411991?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 13:51:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:522cd84a-752e-4dbd-a9e6-8eec47b3dd17</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;device_get_binding() is indeed deprecated since v2.0.0, see this issue:&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/43230"&gt;https://github.com/zephyrproject-rtos/zephyr/issues/43230&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>