<?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>Question about partiton alignment</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107189/question-about-partiton-alignment</link><description>Hi, 
 I try to build up a project with Settings, LittleFS, and TFM PSA enabled, the partions looks like below. 
 
 There are a lot of EMPTY_ partitions inside the table. 
 And I realize that cause by almost all partions must align to SPU_FLASH_REGION_SIZE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Jan 2024 01:45:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107189/question-about-partiton-alignment" /><item><title>RE: Question about partiton alignment</title><link>https://devzone.nordicsemi.com/thread/463252?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2024 01:45:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bd4d6e1-64a9-456d-a900-ecc88ada79cb</guid><dc:creator>Tim Chao</dc:creator><description>&lt;p&gt;Got it, thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about partiton alignment</title><link>https://devzone.nordicsemi.com/thread/463201?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2024 16:01:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27a9ac31-9828-4642-a185-25663c2aacf4</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As you say, the SPU_FLASH_REGION_SIZE is 32kB on the nRF9160, which means that all boundries between secure and non-secure regions must be on a 32k boundary. Otherwise, when one domain tries to access something in the other domain, you get a fault, or you have to waste space (unless you increase the sizes of the partitions to fill the SPU region).&lt;/p&gt;
&lt;p&gt;However, you can have multiple partitions within the same SPU region as long as they belong to the same domain. That means that e.g. the tfm_storage partitions can be placed in the same SPU region, thus only taking 32kB of space, not 80. Below is a pm_static.yml I created for a different project where the tfm_storage partitions have been placed in the same SPU region. You might have to change some of the addresses for it to work in your project, but it should be a good starting point.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;tfm_its:
  address: 0xf8000
  size: 0x2000
tfm_otp_nv_counters:
  address: 0xfa000
  size: 0x2000
tfm_ps:
  address: 0xfc000
  size: 0x4000
tfm_storage:
  address: 0xf8000
  span:
  - tfm_ps
  - tfm_its
  - tfm_otp_nv_counters
  size: 0x8000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This also moves the tfm_storage partitions to the end of the flash, which should let you move the non-secure storage partitions after, which in turn will let you increase the mcuboot slots.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>