<?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>Mass USB Storage on External QSPI Flash in Non-secure build with TFM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96468/mass-usb-storage-on-external-qspi-flash-in-non-secure-build-with-tfm</link><description>Hi, I have been experimenting with an NRF5340dk for the past few days around the application of emulating a Mass USB storage device when connected to a PC. 
 I came across the Mass Storage Sample outlined here: https://developer.nordicsemi.com/nRF_Connect_SDK</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Feb 2023 06:50:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96468/mass-usb-storage-on-external-qspi-flash-in-non-secure-build-with-tfm" /><item><title>RE: Mass USB Storage on External QSPI Flash in Non-secure build with TFM</title><link>https://devzone.nordicsemi.com/thread/409981?ContentTypeID=1</link><pubDate>Wed, 15 Feb 2023 06:50:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ac885b5-0e7f-4164-8a20-97928311102f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Liam&lt;/p&gt;
&lt;p&gt;Took another look at the partition file, and just came to think that having the same name for the partition &amp;quot;ext_flash&amp;quot; and the region &amp;quot;ext_flash&amp;quot; might not be the best idea, so can you try giving these different names so we&amp;#39;re sure there is no conflict during build time with using the addresses for partitions and regions that end up as negative values in the partitions.yml file?&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: Mass USB Storage on External QSPI Flash in Non-secure build with TFM</title><link>https://devzone.nordicsemi.com/thread/409511?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 09:01:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52404a4c-3fac-48a9-942c-41e5d23f9f63</guid><dc:creator>LChesterID</dc:creator><description>&lt;p&gt;Hi, thanks for your reply, and for looking into it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I looked at the partitions.yaml file you attached and it doesn&amp;#39;t contain the external flash region (which had the negative size) and nonsecure_storage region. Here is the partitions.yaml file that was generated when I build the project.&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t had the chance yet to look into the links you have provided for setting up static partitions. I hope to get onto it in the coming couple of days.&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/partitions.zip"&gt;devzone.nordicsemi.com/.../partitions.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Liam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mass USB Storage on External QSPI Flash in Non-secure build with TFM</title><link>https://devzone.nordicsemi.com/thread/409490?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 07:50:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d23103e-4088-47f4-a621-aa017062b795</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;So I opened, reviewed and tried building and flashing the mass(builds) folder you uploaded. On my end the partitions.yml file didn&amp;#39;t&amp;nbsp;build with negative values as you&amp;#39;re describing here. can you upload the partitions.yml file you have in your build folder?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/partitions.7z"&gt;devzone.nordicsemi.com/.../partitions.7z&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mass USB Storage on External QSPI Flash in Non-secure build with TFM</title><link>https://devzone.nordicsemi.com/thread/409332?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2023 11:52:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c33da17-28f7-4772-9ac1-649858261a71</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again Liam&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry, but I have not had time to review your project&amp;#39;s partitioning files yet. I will do so by Monday if you don&amp;#39;t figure it out. pm_static.yml seems more complicated than it actually is, and you basically only need to fill in the right partitions at the right addresses so the partitions align correctly with one another and don&amp;#39;t overlap or go outside the Flash range of the SoC.&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t have a dedicated tutorial for this, but &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;the basics are covered in the DevAcademy&lt;/a&gt; and I find the &amp;quot;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/scripts/partition_manager/partition_manager.html#configuring-static-partitions"&gt;Configuring static partitions&lt;/a&gt;&amp;quot; and &amp;quot;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/scripts/partition_manager/partition_manager.html#ug-pm-static-add"&gt;Adding a static partition&lt;/a&gt;&amp;quot; sections in the documentation helpful.&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: Mass USB Storage on External QSPI Flash in Non-secure build with TFM</title><link>https://devzone.nordicsemi.com/thread/409248?ContentTypeID=1</link><pubDate>Thu, 09 Feb 2023 23:39:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d39a28b-be66-42dc-8c13-6fa7c8e8b91d</guid><dc:creator>LChesterID</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Thanks for your quick response to my question.&lt;/p&gt;
&lt;p&gt;I understand that the initial error was appearing in the flash_map_pm.h file but this was not the root cause of the issue as I understand it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you say I think the way forward is to use a pm_static.yml file to layout the flash partitions including the external flash.&lt;/p&gt;
&lt;p&gt;I am aware that the issue most likely lies in my pm_static.yml file (which is contained in the zip files attached) but I am not sure what is causing the issue. I have not put any &amp;quot;-&amp;quot; signs in pm_static.yml and partition.yml is left unchanged after it is generated by the build process.&lt;/p&gt;
&lt;p&gt;I have looked at this page to try and figure out how to correctly map out the flash but there is very little information. The example on the page does not provide any details on how to properly set start address, size etc&amp;nbsp;&lt;a id="" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/scripts/partition_manager/partition_manager.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/scripts/partition_manager/partition_manager.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&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/pastedimage1675984813979v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If there is an example or tutorial explaining how to set up the following in a pm_static.yml that would be fantastic:&lt;/p&gt;
&lt;p&gt;1. Set up the start address of the external flash region. There is mention of the CONFIG_PM_EXTERNAL_FLASH_BASE which defaults to 0x0. I would have thought that this would conflict with the internal flash starting at 0x0. Not sure if this is required or how to assign addresses relative to internal flash correctly&lt;/p&gt;
&lt;p&gt;2. Set up the addresses and sizes of partitions on external flash and how they are positioned relative to the internal flash or external flash start address specifically using the _ns board&lt;/p&gt;
&lt;p&gt;Thanks for your assistance with this.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Liam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mass USB Storage on External QSPI Flash in Non-secure build with TFM</title><link>https://devzone.nordicsemi.com/thread/409072?ContentTypeID=1</link><pubDate>Thu, 09 Feb 2023 09:01:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38aabd1f-1d72-4b06-97b7-62c9cd86e517</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Liam&lt;/p&gt;
&lt;p&gt;Regarding your first error, the storage partition should be defined&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/include/flash_map_pm.h"&gt; here in flash_map_pm.h&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Using the pm_static.yml seems like the right thing to do, however the errors you&amp;#39;re seeing here points to various issues in the pm_static.yml file:&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2063.pastedimage1675852578381v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve never heard of the partitions having negative starting addresses/sizes, have you perhaps by mistake added a &amp;quot;-&amp;quot; or something in&amp;nbsp;either partition.yml or pm_static.yml. Does your project build with just and not the pm_static.yml for example?&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></channel></rss>