<?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>Define partition on extern flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95898/define-partition-on-extern-flash</link><description>Hi, 
 
 I&amp;#39;m using NCS 2.2.0 with on a Actinius Icarus Bee board. The board has an external flash w25q64 chip and I&amp;#39;m trying to place the storage partition on the external flash. 
 I have created an overlay file like this: 
 
 The partition does not show</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Jan 2023 10:39:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95898/define-partition-on-extern-flash" /><item><title>RE: Define partition on extern flash</title><link>https://devzone.nordicsemi.com/thread/406421?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 10:39:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43665575-98bd-4c8e-a34e-0f010b5aa055</guid><dc:creator>asprenger</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;thanks for the explanation, this makes sense for me now.&lt;/p&gt;
&lt;p&gt;I ultimately want to place a filesystem on the external flash. I found the&amp;nbsp;CONFIG_PM_PARTITION_REGION_LITTLEFS_EXTERNAL config option for this. I did not found any support for FAT but this will not matter in this case.&lt;/p&gt;
&lt;p&gt;Thanks again for the help!&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Andre&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Define partition on extern flash</title><link>https://devzone.nordicsemi.com/thread/406181?ContentTypeID=1</link><pubDate>Tue, 24 Jan 2023 09:16:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:306861f4-dfe1-4400-ad0e-c9325c33071b</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi Andre,&lt;/p&gt;
&lt;p&gt;The partition manager will handle the partitions for you.&lt;br /&gt;So you can no longer use devicetree overlays for partitions.&lt;/p&gt;
&lt;p&gt;To configure the partition manager to put for example NVS storage inside external flash, do the following:&lt;/p&gt;
&lt;p&gt;Tell Partition Manager that external flash exists by adding the following to an devicetree overlay:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
	chosen {
		nordic,pm-ext-flash = &amp;amp;w25q64;
	};
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then configure the filesystem in prj.conf:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_PM_PARTITION_REGION_NVS_STORAGE_EXTERNAL"&gt;CONFIG_PM_PARTITION_REGION_NVS_STORAGE_EXTERNAL&lt;/a&gt;=y&lt;/p&gt;
&lt;p&gt;If you want to do this more custom, you can use pm_static.yml.&lt;br /&gt;In that case, I recommend building with the NVS configuration first, and then copy configuration from build/partitions.yml into pm_static.yml.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Define partition on extern flash</title><link>https://devzone.nordicsemi.com/thread/406109?ContentTypeID=1</link><pubDate>Mon, 23 Jan 2023 18:37:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6048a5bc-9b78-4eac-b465-e51a461e8bae</guid><dc:creator>asprenger</dc:creator><description>&lt;p&gt;Hi Sigurd&lt;/p&gt;
&lt;p&gt;here is the gist of what I&amp;#39;m doing. I lookup the storage partition in the device tree to print some data about it. In addition I iterate over all flash areas (that is probably redundant).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define STORAGE_PARTITION		storage_partition
#define STORAGE_PARTITION_ID	FIXED_PARTITION_ID(STORAGE_PARTITION)

void flash_area_cb(const struct flash_area *fa, void *user_data) {
	LOG_INF(&amp;quot;device name: %s id: %d offset: 0x%lx size:%d&amp;quot;, fa-&amp;gt;fa_dev-&amp;gt;name, fa-&amp;gt;fa_id, fa-&amp;gt;fa_off, fa-&amp;gt;fa_size);
}

void main(void) {

	/* Lookup storage partition */
	unsigned int partition_id = STORAGE_PARTITION_ID;
	const struct flash_area *pfa;

	int rc = flash_area_open(partition_id, &amp;amp;pfa);
	if (rc != 0) {
		LOG_ERR(&amp;quot;Error opening flash area %d: %d&amp;quot;, partition_id, rc);
		return;
	}

	LOG_INF(&amp;quot;storage_partition flash Area ID %u: %s @ 0x%x (size: %u bytes)&amp;quot;, partition_id, 
		pfa-&amp;gt;fa_dev-&amp;gt;name, (unsigned int)pfa-&amp;gt;fa_off, (unsigned int)pfa-&amp;gt;fa_size);

	flash_area_close(pfa);


	/* List of flash areas */
	flash_area_foreach(&amp;amp;flash_area_cb, (void*) NULL);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here is the output:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.546,112] &amp;lt;inf&amp;gt; main: storage_partition flash Area ID 12: flash-controller@39000 @ 0xf8000 (size: 8192 bytes)
[00:00:00.557,403] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 0 offset: 0x0 size:49152
[00:00:00.566,680] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 1 offset: 0xc000 size:16384
[00:00:00.576,202] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 2 offset: 0x10000 size:512
[00:00:00.585,662] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 3 offset: 0x10000 size:458752
[00:00:00.595,367] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 4 offset: 0x10000 size:49664
[00:00:00.604,980] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 5 offset: 0x10200 size:458240
[00:00:00.614,685] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 6 offset: 0x10200 size:49152
[00:00:00.624,328] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 7 offset: 0x1c200 size:409088
[00:00:00.634,033] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 8 offset: 0x1c200 size:409088
[00:00:00.643,737] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 9 offset: 0x80000 size:458752
[00:00:00.653,442] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 10 offset: 0xf0000 size:32768
[00:00:00.663,177] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 11 offset: 0xf8000 size:8192
[00:00:00.672,790] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 12 offset: 0xf8000 size:8192
[00:00:00.682,403] &amp;lt;inf&amp;gt; main: device name: flash-controller@39000 id: 13 offset: 0xfa000 size:24576&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I would expect the storage partition&amp;nbsp;to use the&amp;nbsp;w25q64 device but instead it used the&amp;nbsp;flash-controller device.&lt;/p&gt;
&lt;p&gt;Also I&amp;#39;m deleting the original storage partition in my overlay file, this does not seem to have any effect.&lt;/p&gt;
&lt;p&gt;I can see in&amp;nbsp;build/zephyr/include/generated/autoconf.h that the partition manager is enabled:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_PARTITION_MANAGER_ENABLED&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I&amp;#39;m not sure how the partition manager plays into this scenario, I need to read this up!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;Andre&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Define partition on extern flash</title><link>https://devzone.nordicsemi.com/thread/405997?ContentTypeID=1</link><pubDate>Mon, 23 Jan 2023 10:16:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:946c9239-6e2f-41b4-a6e0-3d29de2b4418</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi Andre,&lt;/p&gt;
&lt;p&gt;I tried to add your configurations to the hello world sample, and I can see the storage partition in the devicetree after the build.&lt;br /&gt;How do you see that&amp;nbsp; the following?&lt;/p&gt;
[quote user=""]The partition does not show up when I create a list of flash areas.[/quote]
&lt;p&gt;Do you have the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/scripts/partition_manager/partition_manager.html"&gt;Partition Manager&lt;/a&gt; enabled in your build?&lt;br /&gt;Maybe this overwrites your manual devicetree partitioning?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>