<?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>LittleFS External Configuration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113727/littlefs-external-configuration</link><description>Hello Support Team, 
 I hope this message finds you well. 
 I&amp;#39;ve been experimenting with the LittleFS sample available at the following link: LittleFS Sample Code . The sample works flawlessly with internal memory. However, after integrating it into my</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Aug 2024 12:12:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113727/littlefs-external-configuration" /><item><title>RE: LittleFS External Configuration</title><link>https://devzone.nordicsemi.com/thread/497481?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2024 12:12:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10af1fcc-d4f3-4e30-96c6-99d8581e6d8a</guid><dc:creator>QBSho</dc:creator><description>&lt;p&gt;&amp;amp;is25lp064a {&lt;br /&gt; address-size-32;&lt;br /&gt;};&lt;br /&gt;was the issue and no custom storagenames (default works without pm_static)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LittleFS External Configuration</title><link>https://devzone.nordicsemi.com/thread/497388?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 22:26:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f93b794c-6f53-4b12-87ce-71db2efc0f7c</guid><dc:creator>QBSho</dc:creator><description>&lt;p&gt;Could it be that there is something wrong with my flash config.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;with normal flash access everything is working.&amp;nbsp;&lt;br /&gt;when i change to littlefs the mounting breaks.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;qspi {
	pinctrl-0 = &amp;lt;&amp;amp;qspi_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;qspi_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
	is25lp064a: is25lp064a@0 {
		compatible = &amp;quot;nordic,qspi-nor&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		writeoc = &amp;quot;pp4io&amp;quot;;
		readoc = &amp;quot;read4io&amp;quot;;
		sck-frequency = &amp;lt;8000000&amp;gt;;
		jedec-id = [9d 60 17];
		size = &amp;lt;8388608&amp;gt;; //8 MB or DT_SIZE_M(8)
	};
};

&amp;amp;pinctrl {
    qspi_default: qspi_default {
        group1 {
            psels = &amp;lt;NRF_PSEL(QSPI_SCK,1, 4)&amp;gt;,    // SCK
                    &amp;lt;NRF_PSEL(QSPI_CSN,0, 26)&amp;gt;,    // CSN
                    &amp;lt;NRF_PSEL(QSPI_IO0,0, 30)&amp;gt;,    // IO0
                    &amp;lt;NRF_PSEL(QSPI_IO1,0, 29)&amp;gt;,    // IO1
                    &amp;lt;NRF_PSEL(QSPI_IO2,0, 28)&amp;gt;,    // IO2
                    &amp;lt;NRF_PSEL(QSPI_IO3,1, 2)&amp;gt;;    // IO3
        };
    };
    qspi_sleep: qspi_sleep {
        group1 {
            psels = &amp;lt;NRF_PSEL(QSPI_SCK,1, 4)&amp;gt;,    // SCK
                    &amp;lt;NRF_PSEL(QSPI_CSN,0, 26)&amp;gt;,    // CSN
                    &amp;lt;NRF_PSEL(QSPI_IO0,0, 30)&amp;gt;,    // IO0
                    &amp;lt;NRF_PSEL(QSPI_IO1,0, 29)&amp;gt;,    // IO1
                    &amp;lt;NRF_PSEL(QSPI_IO2,0, 28)&amp;gt;,    // IO2
                    &amp;lt;NRF_PSEL(QSPI_IO3,1, 2)&amp;gt;;    // IO3
        };
    };
};

&amp;amp;is25lp064a {
    address-size-32;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is there a way to debug this further?&lt;/p&gt;
&lt;p&gt;I just try all option form this post!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/101242/unable-to-use-littlefs-on-external-flash-on-nrf9160"&gt;Unable to use LittleFS on External Flash on nrf9160&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LittleFS External Configuration</title><link>https://devzone.nordicsemi.com/thread/497370?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 15:54:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7819e01-3250-4191-962b-cf8fb3464cc4</guid><dc:creator>QBSho</dc:creator><description>&lt;p&gt;The simple littlefs works, but as i going to external and do not use the standard the problem pops up.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1723046375234v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LittleFS External Configuration</title><link>https://devzone.nordicsemi.com/thread/497339?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 12:29:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f1b33cb-a936-4377-8807-d18b87b3f1ef</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have tried to see if anyone else have reported the same error I have also tried to dig a bit into the code, but I can&amp;#39;t really find&amp;nbsp;what may be failing here. It could be some configuration problem so maybe going back to the simple littlf sample.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LittleFS External Configuration</title><link>https://devzone.nordicsemi.com/thread/497281?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 08:09:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c4d3cd8-66f6-43ae-a3af-242defd7ca07</guid><dc:creator>QBSho</dc:creator><description>&lt;p&gt;I got a little further,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;a restart of the system and before flash manually trigger the build brings now the right paritions.&amp;nbsp;&lt;br /&gt;It uses now 1MB as configured but the mounting point is not showing up&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Where i could debug the mounting point?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(storage);
static struct fs_mount_t lfs_storage_mnt = {
	.type = FS_LITTLEFS,
	.fs_data = &amp;amp;storage,
	.storage_dev = (void *)FLASH_AREA_ID(littlefs_storage),
	.mnt_point = &amp;quot;/lfs1&amp;quot;,
};

struct fs_mount_t *mp = &amp;amp;lfs_storage_mnt;


int data_archive_init(void) {

	unsigned int id = (uintptr_t)mp-&amp;gt;storage_dev;
	struct fs_statvfs sbuf;
	const struct flash_area *pfa;
	int rc;

    rc = flash_area_open(id, &amp;amp;pfa);
	if (rc &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;FAIL: unable to find flash area %u: %d\n&amp;quot;,
			   id, rc);
		return;
	}

	LOG_INF(&amp;quot;Area %u at 0x%x for %u bytes\n&amp;quot;,
		   id, (unsigned int)pfa-&amp;gt;fa_off, (unsigned int)pfa-&amp;gt;fa_size);

	/* Optional wipe flash contents */
	if (IS_ENABLED(CONFIG_APP_WIPE_STORAGE))
	{
		LOG_INF(&amp;quot;Erasing flash area ... &amp;quot;);
		rc = flash_area_erase(pfa, 0, pfa-&amp;gt;fa_size);
		LOG_INF(&amp;quot;%d\n&amp;quot;, rc);
	}

	flash_area_close(pfa);

	rc = fs_mount(mp);
	if (rc &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;FAIL: mount id %u at %s: %d\n&amp;quot;,
			   (unsigned int)mp-&amp;gt;storage_dev, mp-&amp;gt;mnt_point,
			   rc);
		return;
	}
	LOG_INF(&amp;quot;%s mount: %d\n&amp;quot;, mp-&amp;gt;mnt_point, rc);

	rc = fs_statvfs(mp-&amp;gt;mnt_point, &amp;amp;sbuf);
	if (rc &amp;lt; 0)
	{
		LOG_ERR(&amp;quot;FAIL: statvfs: %d\n&amp;quot;, rc);

	}

	LOG_INF(&amp;quot;%s: bsize = %lu ; frsize = %lu ;&amp;quot;
		   &amp;quot; blocks = %lu ; bfree = %lu\n&amp;quot;,
		   mp-&amp;gt;mnt_point,
		   sbuf.f_bsize, sbuf.f_frsize,
		   sbuf.f_blocks, sbuf.f_bfree);
    

    return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00:00:00.559,448] &amp;lt;inf&amp;gt; littlefs: LittleFS version 2.5, disk version 2.0
[00:00:00.559,478] &amp;lt;dbg&amp;gt; littlefs: littlefs_flash_init: FS area 9 at 0x700000 for 1048576 bytes
[00:00:00.559,600] &amp;lt;err&amp;gt; fs: fs mount error (-22)
[00:00:00.559,631] &amp;lt;err&amp;gt; data_archive: FAIL: mount id 9 at /lfs1: -22

[00:00:00.559,661] &amp;lt;err&amp;gt; fs: mount point not found!!
[00:00:00.559,692] &amp;lt;err&amp;gt; data_archive: FAIL: open /lfs/archive.dat: -2&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1723018197291v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How to fix the invalid -22 mountpoint!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LittleFS External Configuration</title><link>https://devzone.nordicsemi.com/thread/497258?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 05:37:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c2a49f0-966e-4f65-9c34-e24ce3826aee</guid><dc:creator>QBSho</dc:creator><description>&lt;p&gt;Thank you luckyyorange,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I already know this guy and the video.&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;#Partion manager
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n&lt;/pre&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;seems not working, because of&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;external_flash:
address: 0x0
end_address: 0x00800000
region: external_flash
size: 0x8388608
littlefs_storage:
address: 0x0
device: is25lp064a
region: external_flash
size: 0x00100000&lt;/pre&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1723008670086v1.png" /&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Anything to force this?&lt;/div&gt;
&lt;div&gt;the build log looks good.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Also my app doesn&amp;#39;t start correctly - non output on RTT.&amp;nbsp; Also without automount!&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;BR&amp;nbsp;S&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LittleFS External Configuration</title><link>https://devzone.nordicsemi.com/thread/497252?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 02:59:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56957164-8df3-49f6-9ed6-d862b14ce40a</guid><dc:creator>luckyyorange</dc:creator><description>&lt;p&gt;Hey QBSho,&lt;/p&gt;
&lt;p&gt;I recommend checking out &lt;a href="https://www.youtube.com/watch?v=zgMMC0eWkkM"&gt;this video&lt;/a&gt;&amp;nbsp;for configuring littlefs for use on an external flash. Configuring littlefs is the toughest part, and the video goes over it very well.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>