<?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>USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113000/usb-mass-sample-and-partition-manager-build-issues</link><description>I have my application code which builds and runs on my nrf5340DK. The project files were based on the zephyr sample for multi-advertising BLE. 
 Right now I&amp;#39;m building the &amp;#39;secure&amp;#39; app version (board target nrf5340dk_nrf5340_cpuapp) 
 I now want to add</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Jul 2024 13:43:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113000/usb-mass-sample-and-partition-manager-build-issues" /><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/494400?ContentTypeID=1</link><pubDate>Wed, 17 Jul 2024 13:43:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8828189e-9180-4675-a732-eedd42d7a1e0</guid><dc:creator>BrianW</dc:creator><description>[quote userid="106736" url="~/f/nordic-q-a/113000/usb-mass-sample-and-partition-manager-build-issues/494384"]s it okay for you if I mark your last reply as Verified and close the ticket?[/quote]
&lt;p&gt;Sure.&lt;/p&gt;
&lt;p&gt;A final couple of notes:&lt;/p&gt;
&lt;p&gt;- if you change the size of the partition _after_ FAT FS has formatted it, it won&amp;#39;t be taken into account and you need to re-format it (I did this by explicitly asking the flash driver to erase the partition at boot, and having&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_FS_FATFS_MOUNT_MKFS&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;(so that FAT FS rebuilt it after.that.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;It might also be possible to ask the windows PC to format it - YMMV..&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;- probably useful to enable &amp;#39;long file names&amp;#39;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_FS_FATFS_LFN&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;as the old 8.3 format is very nasty...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;I couldn&amp;#39;t find the KConfig flag however to enable &amp;#39;relative directory navigation&amp;#39; (FF_FS_RPATH &amp;gt;= 1, as per this page:&amp;nbsp;&lt;a href="http://elm-chan.org/fsw/ff/doc/filename.html#:~:text=In%20the%20generic%20FAT%20filesystems,characters%20%5Cx80%20to%20%5CxFF"&gt;http://elm-chan.org/fsw/ff/doc/filename.html#:~:text=In%20the%20generic%20FAT%20filesystems,characters%20%5Cx80%20to%20%5CxFF&lt;/a&gt;.) which would have been nice...&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&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: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/494384?ContentTypeID=1</link><pubDate>Wed, 17 Jul 2024 13:19:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:860a33bb-dcba-4d16-aabc-a712c9c495b9</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Good job figuring this out!&lt;br /&gt;And thanks a lot for summarizing, it will help future people for sure!&lt;/p&gt;
&lt;p&gt;Is it okay for you if I mark your last reply as Verified and close the ticket?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/494067?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2024 08:08:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c81839f8-8860-4f3b-8fed-24ba08f1090d</guid><dc:creator>BrianW</dc:creator><description>[quote userid="134465" url="~/f/nordic-q-a/113000/usb-mass-sample-and-partition-manager-build-issues/493980"]&lt;p&gt;2/ USB mass storage driver finds the flash partition using the KConfig line in prj.conf:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_MASS_STORAGE_DISK_NAME=&amp;quot;EXT_FAT_FS&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;as defined in the pm _static.yml extra_params section:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;disk_name: &amp;quot;EXT_FAT_FS&amp;quot;,&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;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;But I can&amp;#39;t now work out why I get the EIO error when mounting the FS?&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;Solved - turns out that although the USB mass driver can find the flash partition, ELM FAT FS requires that the partition &amp;#39;disk_name&amp;#39; must also be in its restricted list of volume names!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It would have been nice had this been documented somewhere, eg in comments in the &amp;#39;mass&amp;#39; sample code?&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Summary of what I&amp;#39;ve learned:&lt;/p&gt;
&lt;p&gt;for nrf5340, PartitionManager is (currently) required if using &amp;#39;multi-image&amp;#39; eg a networking stack. When using PM:&lt;/p&gt;
&lt;p&gt;- you can add add specific partitions using a &amp;#39;pm_static.yml&amp;#39; file in the root dir of the application&lt;/p&gt;
&lt;p&gt;- DTS partition definitions are not required (ignored?)&lt;/p&gt;
&lt;p&gt;For external flash type FAT FS ELM:&lt;/p&gt;
&lt;p&gt;- in pm_static.yml, ensure affiliation attribute is a list with &amp;#39;disk&amp;#39; eg&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;fatfs_storage:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; region: external_flash&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; affiliation: &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - disk&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; extra_params: {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_name: &amp;quot;NAND&amp;quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_cache_size: 4096,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_sector_size: 512,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_read_only: 0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; placement:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; after: [start]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; align: {start: 4096}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; # 2Mb size, external flash is 8Mb total&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; address: 0x0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; size: 0x200000&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;(note: I called the partition &amp;quot;fatfs_storage&amp;quot;, so in the code to find its partition id (which is in the generated file buiid/zephyr/include/generated/pm_config.h) the defines are:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#define STORAGE_PARTITION &amp;nbsp; &amp;nbsp; &amp;nbsp; fatfs_storage&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#define STORAGE_PARTITION_ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FIXED_PARTITION_ID(STORAGE_PARTITION)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;- in the DTS overlay, you need to map the flash driver with the chosen for the nordic,pm-ext-flash set to the correct driver node eg:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;/ {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;chosen {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nordic,pm-ext-flash = &amp;amp;mx25r64;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;- have fs_mount use&amp;nbsp;mount point &amp;quot;/NAND:&amp;quot;, KConfig has CONFIG_MASS_STORAGE_DISK_NAME=&amp;quot;NAND&amp;quot; and the pm_static.yml has disk_name=&amp;quot;NAND&amp;quot; or it won&amp;#39;t mount... (or one of the other volume name strings from list in fs.h)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493980?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 17:44:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db765ac7-9f9d-495f-a79a-3b639eb64e0e</guid><dc:creator>BrianW</dc:creator><description>&lt;p&gt;Some proress;&lt;/p&gt;
&lt;p&gt;1/ ELM FAT can only mount o certain volume names -&amp;gt; can&amp;#39; t use &amp;quot;/flash&amp;quot;&lt;/p&gt;
&lt;p&gt;Changed to &amp;quot;/NAND:&amp;quot;, now I get a EIO error&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;00:00:00.367,767] &amp;lt;inf&amp;gt; base: Flash USB mass storage opened : area 1 at 0x0 on mx25r6435f@0 for 2097152 bytes&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;[00:00:00.378,295] &amp;lt;err&amp;gt; fs: fs mount error (-5)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;[00:00:00.383,575] &amp;lt;err&amp;gt; base: Failed to mount filesystem on /NAND:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;2/ USB mass storage driver finds the flash partition using the KConfig line in prj.conf:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_MASS_STORAGE_DISK_NAME=&amp;quot;EXT_FAT_FS&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;as defined in the pm _static.yml extra_params section:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;disk_name: &amp;quot;EXT_FAT_FS&amp;quot;,&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;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;But I can&amp;#39;t now work out why I get the EIO error when mounting the FS?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493966?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 15:43:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b897037-9e5f-47aa-bd95-7f38473e1a57</guid><dc:creator>BrianW</dc:creator><description>[quote userid="106736" url="~/f/nordic-q-a/113000/usb-mass-sample-and-partition-manager-build-issues/493930"]This means that it works, right?[/quote]
&lt;p&gt;Ah, it compiles! Not quite the same thing....&lt;/p&gt;
&lt;p&gt;When run, I get this logs/error:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Area 1 at 0x0 on mx25r6435f@0 for 2097152 bytes&lt;/span&gt;&lt;br /&gt;[&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;00:00:00.359,222] &amp;lt;err&amp;gt; fs: fs mount error (-19)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;[00:00:00.364,624] &amp;lt;err&amp;gt; base: Failed to mount filesystem&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;which comes from this code (pretty much directly from the mass sample code)&lt;/p&gt;
&lt;div&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#define STORAGE_PARTITION &amp;nbsp; &amp;nbsp; &amp;nbsp; fatfs_storage&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#define STORAGE_PARTITION_ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FIXED_PARTITION_ID(STORAGE_PARTITION)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;static struct fs_mount_t fs_mnt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;static int _setup_flash(struct fs_mount_t *mnt)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; int rc = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#if CONFIG_DISK_DRIVER_FLASH&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; unsigned int id;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; const struct flash_area *pfa;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; mnt-&amp;gt;storage_dev = (void *)STORAGE_PARTITION_ID;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; id = STORAGE_PARTITION_ID;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; rc = flash_area_open(id, &amp;amp;pfa);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; printk(&amp;quot;Area %u at 0x%x on %s for %u bytes\n&amp;quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;id, (unsigned int)pfa-&amp;gt;fa_off, pfa-&amp;gt;fa_dev-&amp;gt;name,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(unsigned int)pfa-&amp;gt;fa_size);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; if (rc &amp;lt; 0 &amp;amp;&amp;amp; IS_ENABLED(CONFIG_APP_WIPE_STORAGE)) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printk(&amp;quot;Erasing flash area ... &amp;quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rc = flash_area_erase(pfa, 0, pfa-&amp;gt;fa_size);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printk(&amp;quot;%d\n&amp;quot;, rc);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; if (rc &amp;lt; 0) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; flash_area_close(pfa);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#endif&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; return rc;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;static int _mount_app_fs(struct fs_mount_t *mnt)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; int rc;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#if CONFIG_FAT_FILESYSTEM_ELM&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; static FATFS fat_fs;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; mnt-&amp;gt;type = FS_FATFS;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; mnt-&amp;gt;fs_data = &amp;amp;fat_fs;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; mnt-&amp;gt;mnt_point = &amp;quot;/flash:&amp;quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#else&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; log_warn(&amp;quot;no file system type defined in firmware build, no FS mount available.&amp;quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; return -1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#endif&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; rc = fs_mount(mnt);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; return rc;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;static void _setup_disk(void)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; struct fs_mount_t *mp = &amp;amp;fs_mnt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; struct fs_dir_t dir;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; struct fs_statvfs sbuf;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; int rc;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; fs_dir_t_init(&amp;amp;dir);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; if (IS_ENABLED(CONFIG_DISK_DRIVER_FLASH)) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rc = _setup_flash(mp);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (rc &amp;lt; 0) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LOG_ERR(&amp;quot;Failed to setup flash area&amp;quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; if (!IS_ENABLED(CONFIG_FAT_FILESYSTEM_ELM)) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LOG_INF(&amp;quot;No file system selected&amp;quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; rc = _mount_app_fs(mp);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; if (rc &amp;lt; 0) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LOG_ERR(&amp;quot;Failed to mount filesystem&amp;quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;.... etc&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;So it finds the partition, and the characteristics seem right. but the mount fails.&lt;/p&gt;
&lt;p&gt;The run continues, including:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;[00:00:00.370,727] &amp;lt;inf&amp;gt; base: USB mass storage mode enabled.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;and from the PC I see the USB mass storage as a new drive, and can create/read files on it...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So why does the FS mount fail?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I also don&amp;#39;t quite see how the USB mass driver &amp;quot;knows&amp;quot; which partition to expose to the USB? How is this link made? is it looking for a specific partition name or a label (the DTS config from &amp;#39;mass&amp;#39; had an overlay config for an msc_disk0 node liek this:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;msc_disk0 {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compatible = &amp;quot;zephyr,flash-disk&amp;quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; partition = &amp;lt;&amp;amp;storage_partition&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk-name = &amp;quot;NAND&amp;quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cache-size = &amp;lt;4096&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;amp;mx25r64 {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; partitions {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; compatible = &amp;quot;fixed-partitions&amp;quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #address-cells = &amp;lt;1&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #size-cells = &amp;lt;1&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; storage_partition: partition@0 {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label = &amp;quot;storage&amp;quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; reg = &amp;lt;0x00000000 0x00020000&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;But i have that commented out right now as the flashdisk.c code with PM enabled uses the PM config to find the disk partition...maybe the USB exposed file system is not actually on the fatfs_storage partition but actually using a different partition??&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Any pointers?&amp;nbsp;&lt;/span&gt;&lt;span&gt;thanks!&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;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493930?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 13:41:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:787ce101-c02e-4ab7-a37b-87d78829575e</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="BrianW"]and everything compiles as it should including the generated partition id for fatfs_storage.[/quote]
&lt;p&gt;This means that it works, right?&lt;br /&gt;If so, great news!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493906?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 12:56:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f16e8e1-5acd-49a6-bcd1-9a0e7260fea9</guid><dc:creator>BrianW</dc:creator><description>&lt;p&gt;I updated my yml file (called pm_ext_fs.yml) with the fix from that report (make affiliation a list)&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;f&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;atfs_storage&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; region: external_flash&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; affiliation: &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - disk&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; extra_params: {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_name: &amp;quot;NAND&amp;quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_cache_size: 4096,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_sector_size: 512,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_read_only: 0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; placement:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; after: [start]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; align: {start: 4096}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; # 2Mb size, external flash is 8Mb total&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; size: 0x200000&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To get PM to load it, I added to CMakeList.txt in root of application:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;if(CONFIG_PARTITION_MANAGER_ENABLED)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; ncs_add_partition_manager_config(pm_ext_fatfs.yml)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; message( INFO &amp;quot; Added pm_ext_fatfs.yml to partition manager...&amp;quot;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;endif()&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This passes and I get the log message, but the file contents seem to be ignored by PM : no effect on the generated pm_config.h / Pm.config or partitions.yml files -&amp;gt; still no success.&lt;/p&gt;
&lt;p&gt;Next, I tried&amp;nbsp;renaming it to&amp;nbsp;&lt;strong&gt;pm_static.yml&lt;/strong&gt; in root dir. (found this piece of magic in that bug report also)&lt;/p&gt;
&lt;p&gt;This time the compilation includes the log &amp;quot;-- Found partition manager static configuration: C:/work/dev/if-device-nrf53/cc1-med/pm_static.yml&amp;quot;.But it then bombs because it requires an &amp;#39;address&amp;#39; field....(I tried with the placement before: [end], same result)&lt;/p&gt;
&lt;p&gt;Adding&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; address&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;0x0&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;and everything compiles as it should including the generated partition id for fatfs_storage.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493867?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 10:53:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc49a145-d5da-4bce-b2f6-38eaa63eba37</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Reported and explained in:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/109170/bug-in-partition_manager_output-py-leading-to-incorrect-pm_foreach_affiliated_to_disk"&gt;Bug in partition_manager_output.py leading to incorrect PM_FOREACH_AFFILIATED_TO_disk&lt;/a&gt; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493843?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 09:46:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bbdda25-9dfd-4041-9810-ed6d3c1b8d5e</guid><dc:creator>BrianW</dc:creator><description>[quote userid="107683" url="~/f/nordic-q-a/113000/usb-mass-sample-and-partition-manager-build-issues/493833"]Instead, lets take a step back and check something that should be verified support for: Could you try to test with APP_MSCC_STORAGE_FLASH_LITTLEFS instead? This&amp;nbsp;[/quote]
&lt;p&gt;OK. the &amp;#39;mass&amp;#39; sample builds ok with&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;west build --build-dir mass/build mass --pristine -DCONFIG_APP_MSC_STORAGE_FLASH_LITTLEFS=y&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;also with&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;west build --build-dir mass/build mass --pristine -DCONFIG_APP_MSC_STORAGE_FLASH_FATFS=y&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;BUT&amp;nbsp;not with:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;west build --build-dir mass/build mass --pristine -DCONFIG_APP_MSC_STORAGE_FLASH_LITTLEFS=y -DCONFIG_PM_SINGLE_IMAGE=y&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;ie it does &lt;strong&gt;NOT&lt;/strong&gt; work if the partition manager is enabled (which is a must when building for nRF5340 and using bluetooth....)&lt;/p&gt;
&lt;p&gt;So its not a question of using FAT or LittleFS file systems. (btw, FATFS is &lt;em&gt;required&lt;/em&gt; as otherwise the PC attached to the USB will not be able to access the FS...)&lt;/p&gt;
&lt;p&gt;For me, the problem is because flashdisk.c in the core zephyr code needs to find a flash partition with the &amp;#39;disk&amp;#39; affiliation, and this means the PM requires a pm.yml file to define this, yes?&lt;/p&gt;
&lt;p&gt;SO: how do I get PM to pick up my pm.yml file? Putting it in the root dir doesn&amp;#39;t work. Putting it in &amp;#39;child_image&amp;#39; sub folder doesn&amp;#39;t work.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you try building the mass sample with PM enabled for a nrf5340DK, using the external flash for the USB mass storage and tell me what is required to get it to build?&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493833?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 09:11:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd76093b-375f-4277-bb28-fa566215bb15</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I understand that this is complex and there is quite a few configuration options to navigate through..&lt;/p&gt;
&lt;p&gt;A couple of thoughts here:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&amp;nbsp;&lt;a title="https://github.com/nrfconnect/sdk-zephyr/blob/20ab87f134cfd57a64747e101f4a5693b14c6a67/samples/subsys/usb/mass/kconfig#l25" href="https://github.com/nrfconnect/sdk-zephyr/blob/20ab87f134cfd57a64747e101f4a5693b14c6a67/samples/subsys/usb/mass/Kconfig#L25" rel="noopener noreferrer" target="_blank"&gt;APP_MSC_STORAGE_FLASH_FATFS&lt;/a&gt; != APP_MSC_STORAGE_FLASH_LITTLEFS, while our&amp;nbsp;&lt;a title="https://github.com/nrfconnect/sdk-nrf/blob/v2.7.0/subsys/partition_manager/pm.yml.file_system" href="https://github.com/nrfconnect/sdk-nrf/blob/v2.7.0/subsys/partition_manager/pm.yml.file_system" rel="noopener noreferrer" target="_blank"&gt;pm.yml.file_system&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&amp;nbsp;concerns littlefs&lt;/li&gt;
&lt;li&gt;Partition manager does not seem to have out of the box support for that specific FAT filesystem&lt;/li&gt;
&lt;li&gt;As you&amp;#39;ve stated you&amp;#39;re already attempting, you&amp;#39;ll have to use static partitioning&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Instead, lets take a step back and check something that should be verified support for: Could you try to test with APP_MSCC_STORAGE_FLASH_LITTLEFS instead? This&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493826?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 08:36:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3aafe60e-6c9e-4d9f-ab01-8552011879fe</guid><dc:creator>BrianW</dc:creator><description>[quote userid="134465" url="~/f/nordic-q-a/113000/usb-mass-sample-and-partition-manager-build-issues/493659"]The PM doc includes a snippet for defining a fat-fs partition - where do I put the pm.yml file? The doc says it is ignored if its in the root application dir (which seems to be true!).[/quote]
&lt;p&gt;More reading tells me that in a multi-image application on a nrf5340, the &amp;#39;app&amp;#39; is always the &amp;#39;root&amp;#39; application. The image for the cpu-net (Bluetooth HCI RPMsg from the sample/...) is a &amp;#39;child-image&amp;#39;, witha &amp;quot;child_image&amp;quot; subfolder and a hci_rpmsg.conf file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But since the app, which is the bit that needs the pm.yml, is the root, and the root&amp;#39;s pm.yml is ignored, how to build a nrf5340 bluetooth application with any partition configuration????&lt;/p&gt;
&lt;p&gt;This all seems excessively complex.... and the documentation is a maze of twisty litle configuration options....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493672?ContentTypeID=1</link><pubDate>Fri, 12 Jul 2024 14:38:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e88012b-a4ec-4040-a442-70f810e73786</guid><dc:creator>BrianW</dc:creator><description>[quote userid="134465" url="~/f/nordic-q-a/113000/usb-mass-sample-and-partition-manager-build-issues"]&lt;p&gt;I tried to build the &amp;#39;mass&amp;#39; sample standalone copied directly from the NCS; but it also fails to compile with this error:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CMake Error at CMakeLists.txt:10 (message):&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;No disk access settings detected.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Any ideas what I&amp;#39;m doing wrong?&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Ok, so this error is due to not giving the&amp;nbsp;&amp;nbsp;-DCONFIG_APP_MSC_STORAGE_FLASH_FATFS=y option on the build line (which only works if you build from the parent directory as&lt;/p&gt;
&lt;p&gt;west build --build-dir mass/build mass --pristine=auto -DCONFIG_APP_MSC_STORAGE_FLASH_FATFS=y&lt;/p&gt;
&lt;p&gt;as otherwise the -D... is taken as the application name).&lt;/p&gt;
&lt;p&gt;And this builds ok as the PM is NOT enabled - if I force the PM with&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_PM_SINGLE_IMAGE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;then it fails to compile also....&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493659?ContentTypeID=1</link><pubDate>Fri, 12 Jul 2024 14:06:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2ed0383-d210-4335-889e-0084f1708a2c</guid><dc:creator>BrianW</dc:creator><description>[quote userid="9456" url="~/f/nordic-q-a/113000/usb-mass-sample-and-partition-manager-build-issues/493601"]Yes, you guessed right. You need to use the Partition Manager because you are building a multi-image application. This is the case up to nRF Connect SDK (NCS) v2.6.1.[/quote]
&lt;p&gt;Ok. The partition manger doc (which I have read but haven&amp;#39;t managed to map onto my project...) says:&lt;/p&gt;
&lt;p class="admonition-title"&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When you build a multi-image application using the Partition Manager, the devicetree source flash partitions are ignored.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So why do the nrf5340 DTS board board files all include partition definitions in nrf5340_cpuapp_partition_conf.dtsi, and then in nrf5340_cpuapp_common.dtsi for &amp;amp;flash0? are these just ignored? the build/partitions.yml file doesn&amp;#39;t seem to include them...&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For the FAT-FS in external flash then:&lt;/p&gt;
&lt;p&gt;The PM doc includes a snippet for defining a fat-fs partition - where do I put the pm.yml file? The doc says it is ignored if its in the root application dir (which seems to be true!).&lt;/p&gt;
&lt;p&gt;here&amp;#39;s what I put in it:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;fatfs_storage:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; region: external_flash&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; affiliation: disk&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; extra_params: {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_name: &amp;quot;NAND&amp;quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_cache_size: 4096,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_sector_size: 512,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; disk_read_only: 0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; placement:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; after: [start]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; align: {start: 4096}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; # 2Mb size, external flash is 8Mb total&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; size: 0x200000&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;But no fastfs_storage partition is in build/partitions.yml, and the compilation of flashdisk.c fails in the same way.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;s&lt;/span&gt;&lt;span&gt;ince I put&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;nordic,pm-ext-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;mx25r64&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;span&gt;};&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;into my dts overlay, an &amp;quot;external-flash&amp;quot; region now appears in build/regions.yml, as well as a partition called &amp;#39;external-flash&amp;#39; in build/partitions.yml, which uses all the region...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;I feel its not far away but just stuck with the PM...&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&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;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB MASS sample and partition manager build issues</title><link>https://devzone.nordicsemi.com/thread/493601?ContentTypeID=1</link><pubDate>Fri, 12 Jul 2024 09:28:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2ee1101-15f5-4e99-977e-abd34d5ece9f</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi BrianW,&lt;/p&gt;
[quote user=""]&lt;p&gt;Looking at the flashdisk.c code it seems to be in the USE_PARTITION_MANAGER case, so I guess its not finding some PM config to define the flash disk parameters?&lt;/p&gt;
&lt;p&gt;Q: do I need to use the Partition Manager sub system? The DTS files appear to define the partitions required just fine...The mass example does not have a pm.yml either?&lt;/p&gt;
&lt;p&gt;If I have to use PM (my reading implies &amp;#39;yes&amp;#39;, because the nrf5340 requires a multi-image hex due to the 2 processors?),&lt;/p&gt;[/quote]
&lt;p&gt;Yes, you guessed right. You need to use the Partition Manager because you are building a multi-image application. This is the case up to nRF Connect SDK (NCS) v2.6.1. &lt;br /&gt;(From NCs v2.7.0, the build system changes quite a bit, and I honestly haven&amp;#39;t caught up on that, so I refrain from commenting about v2.7.0 here.)&lt;/p&gt;
&lt;p&gt;If I understand correctly, you are using FAT FS, right? This issue happens mostly with FAT FS.&lt;/p&gt;
[quote user=""]where, how to configure its partitions if not in the DTS?[/quote]
&lt;p&gt;The&amp;nbsp;Partition Manager dynamically resolve all partition requirement during compile time. You can add a requirement for the FAT FS partition.&lt;/p&gt;
&lt;p&gt;The format of the file and how to use it are&amp;nbsp;documented&amp;nbsp;here:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/scripts/partition_manager/partition_manager.html"&gt;https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/scripts/partition_manager/partition_manager.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I tested in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/101687/mass-storage-initialization-error-with-nsib-and-mcuboot/454800"&gt;the past&lt;/a&gt;&amp;nbsp;with NCS v2.5.0, and this&amp;nbsp;worked:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;app:
  address: 0x00000000
  end_address: 0x000f0000
  region: flash_primary
  size: 0x000f0000
storage:
  address: 0x000f0000
  end_address: 0x00100000
  region: flash_primary
  size: 0x00010000
  
  affiliation: 
    - disk
  extra_params: {
    disk_name: &amp;quot;SD&amp;quot;,
    disk_cache_size: 4096,
    disk_sector_size: 512,
    disk_read_only: 0
  }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Alternatively, you could also&amp;nbsp;provide a static configuration of the entire flash&amp;nbsp;memory partitioning. The details are also included in the document page I linked above.&lt;/p&gt;
&lt;p&gt;A quick way to get a starting point with static configurations is to copy the result of a dynamic Partition Manager run. It is located at:&amp;nbsp;&lt;span&gt;$&lt;/span&gt;&lt;em&gt;&lt;span&gt;BUILD_DIR&lt;/span&gt;&lt;/em&gt;&lt;span&gt;/partitions.yml.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hieu&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>