<?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>MCU boot with external Flash littles partition and Secondary image partition</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72543/mcu-boot-with-external-flash-littles-partition-and-secondary-image-partition</link><description>Hello ALL, 
 I am trying to use MCU boot with my application. I am using NRF916DK and it has external Flash similar to NR52840DK board. Now when I am creating a partition on external Flash and point LittleFs to that storage partition, after compiling</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 13 Apr 2021 13:30:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72543/mcu-boot-with-external-flash-littles-partition-and-secondary-image-partition" /><item><title>RE: MCU boot with external Flash littles partition and Secondary image partition</title><link>https://devzone.nordicsemi.com/thread/304571?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 13:30:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbbace2b-217b-4084-96f2-b48c68141cde</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your setup doesn&amp;#39;t seem to catch the littlefs partition.&lt;/p&gt;
&lt;p&gt;I took your former example, and edited it. It does seem to successfully register littlefs in pm, as well as the external flash region:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2021_5F00_04_5F00_13_5F00_app_5F00_program_5F00_nordic.zip"&gt;devzone.nordicsemi.com/.../2021_5F00_04_5F00_13_5F00_app_5F00_program_5F00_nordic.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU boot with external Flash littles partition and Secondary image partition</title><link>https://devzone.nordicsemi.com/thread/304539?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 12:39:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a86a5b2-ed46-4637-abec-ca62b790445e</guid><dc:creator>Waqas Qammar</dc:creator><description>&lt;p&gt;yes I did multiple times and I physically checked this file there is no ID. but I not down one thing while doing configuration. this log message is appeared.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Dropping partition &amp;#39;littlefs_storage&amp;#39; since it is statically defined.&lt;br /&gt;-- Configuring done&lt;br /&gt;-- Generating done&lt;br /&gt;-- Build files have been written to&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and I can see there is nothing in the build.pm.config&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;PM_MCUBOOT_ADDRESS=0x0
PM_MCUBOOT_SIZE=0xc000
PM_MCUBOOT_NAME=mcuboot
PM_MCUBOOT_ID=0
PM_mcuboot_ID=PM_MCUBOOT_ID
PM_0_LABEL=MCUBOOT
PM_EMPTY_0_ADDRESS=0xc000
PM_EMPTY_0_SIZE=0x4000
PM_EMPTY_0_NAME=EMPTY_0
PM_EMPTY_0_ID=1
PM_empty_0_ID=PM_EMPTY_0_ID
PM_1_LABEL=EMPTY_0
PM_MCUBOOT_PAD_ADDRESS=0x10000
PM_MCUBOOT_PAD_SIZE=0x200
PM_MCUBOOT_PAD_NAME=mcuboot_pad
PM_MCUBOOT_PAD_ID=2
PM_mcuboot_pad_ID=PM_MCUBOOT_PAD_ID
PM_2_LABEL=MCUBOOT_PAD
PM_MCUBOOT_PRIMARY_ADDRESS=0x10000
PM_MCUBOOT_PRIMARY_SIZE=0x78000
PM_MCUBOOT_PRIMARY_NAME=mcuboot_primary
PM_MCUBOOT_PRIMARY_ID=3
PM_mcuboot_primary_ID=PM_MCUBOOT_PRIMARY_ID
PM_3_LABEL=MCUBOOT_PRIMARY
PM_MCUBOOT_PRIMARY_SPAN=&amp;quot;mcuboot_pad app spm&amp;quot;
PM_MCUBOOT_PRIMARY_APP_ADDRESS=0x10200
PM_MCUBOOT_PRIMARY_APP_SIZE=0x77e00
PM_MCUBOOT_PRIMARY_APP_NAME=mcuboot_primary_app
PM_MCUBOOT_PRIMARY_APP_ID=4
PM_mcuboot_primary_app_ID=PM_MCUBOOT_PRIMARY_APP_ID
PM_4_LABEL=MCUBOOT_PRIMARY_APP
PM_MCUBOOT_PRIMARY_APP_SPAN=&amp;quot;app spm&amp;quot;
PM_SPM_ADDRESS=0x10200
PM_SPM_SIZE=0xc000
PM_SPM_NAME=spm
PM_SPM_ID=5
PM_spm_ID=PM_SPM_ID
PM_5_LABEL=SPM
PM_APP_ADDRESS=0x1c200
PM_APP_SIZE=0x6be00
PM_APP_NAME=app
PM_APP_ID=6
PM_app_ID=PM_APP_ID
PM_6_LABEL=APP
PM_MCUBOOT_SECONDARY_ADDRESS=0x88000
PM_MCUBOOT_SECONDARY_SIZE=0x78000
PM_MCUBOOT_SECONDARY_NAME=mcuboot_secondary
PM_MCUBOOT_SECONDARY_ID=7
PM_mcuboot_secondary_ID=PM_MCUBOOT_SECONDARY_ID
PM_7_LABEL=MCUBOOT_SECONDARY
PM_OTP_ADDRESS=0xff8108
PM_OTP_SIZE=0x2f4
PM_OTP_NAME=otp
PM_SPM_SRAM_ADDRESS=0x20000000
PM_SPM_SRAM_SIZE=0x10000
PM_SPM_SRAM_NAME=spm_sram
PM_SRAM_SECURE_ADDRESS=0x20000000
PM_SRAM_SECURE_SIZE=0x10000
PM_SRAM_SECURE_NAME=sram_secure
PM_SRAM_SECURE_SPAN=&amp;quot;spm_sram&amp;quot;
PM_SRAM_PRIMARY_ADDRESS=0x20010000
PM_SRAM_PRIMARY_SIZE=0x30000
PM_SRAM_PRIMARY_NAME=sram_primary
PM_NUM=8
PM_ALL_BY_SIZE=&amp;quot;mcuboot_pad otp EMPTY_0 mcuboot spm spm_sram sram_secure sram_primary app mcuboot_primary_app mcuboot_secondary mcuboot_primary&amp;quot;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU boot with external Flash littles partition and Secondary image partition</title><link>https://devzone.nordicsemi.com/thread/304481?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 10:49:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d64a6208-f9c4-4914-b37b-ea92a91219dc</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I cannot see anything wrong with your setup. The symbol you are failing on shall be defined in your-build-folder/pm.config (values might differ from your config, but the defines should be in this file):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ cat pm.config | grep little -i
PM_LITTLEFS_STORAGE_ADDRESS=0x0
PM_LITTLEFS_STORAGE_END_ADDRESS=0x6000
PM_LITTLEFS_STORAGE_SIZE=0x6000
PM_LITTLEFS_STORAGE_NAME=littlefs_storage
PM_LITTLEFS_STORAGE_ID=0
PM_littlefs_storage_ID=PM_LITTLEFS_STORAGE_ID
PM_littlefs_storage_IS_ENABLED=1
PM_0_LABEL=LITTLEFS_STORAGE
PM_ALL_BY_SIZE=&amp;quot;external_flash mcuboot_pad otp EMPTY_0 littlefs_storage mcuboot spm spm_sram sram_secure sram_primary sram_nonsecure mcuboot_secondary app mcuboot_primary_app mcuboot_primary&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When changing anything in the partition scheme, I would strongly recommend that you delete your build folder, then regenerate your project. Could you try this?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU boot with external Flash littles partition and Secondary image partition</title><link>https://devzone.nordicsemi.com/thread/304422?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 07:48:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ca2dd83-31f6-4a47-b94b-011cce7e3865</guid><dc:creator>Waqas Qammar</dc:creator><description>&lt;div class="author"&gt;
&lt;div class="avatar"&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/waqas_5f00_qammar"&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="content full threaded-reply-content user-defined-markup"&gt;
&lt;div class="content"&gt;
&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have did the changes that you suggest of adding&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;external_flash:&lt;br /&gt; address: 0x800000&lt;br /&gt; region: external_flash&lt;br /&gt; size: 0x0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;in the partition file but still I am getting build errors. here is the screen shot of error and my code&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/error-source.PNG" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This is my pm_static.yml&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;external_flash:
  address: 0x800000
  region: external_flash
  size: 0x0
  
littlefs_storage:
  address: 0x0
  device: mx25r6435f
  region: external_flash
  size: 0x800000&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is mcuboot.conf&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Nordic specific external flash stuff
CONFIG_PM_EXTERNAL_FLASH=y
CONFIG_PM_EXTERNAL_FLASH_DEV_NAME=&amp;quot;MX25R6435F&amp;quot;
CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
CONFIG_PM_EXTERNAL_FLASH_SIZE=0x2000000
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is main file and the source of the error is line 27 which is&amp;nbsp; that pm_littlefs_storage_ID not found.&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2012-2014 Wind River Systems, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;logging/log.h&amp;gt;
#include &amp;lt;drivers/uart.h&amp;gt;

#include &amp;lt;fs/fs.h&amp;gt;
#include &amp;lt;fs/littlefs.h&amp;gt;
#include &amp;lt;storage/flash_map.h&amp;gt;
#include &amp;quot;wmbus.h&amp;quot;

LOG_MODULE_REGISTER(app);


/* Matches LFS_NAME_MAX */
#define MAX_PATH_LEN 255

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),
		.storage_dev = (void *)FLASH_AREA_ID(storage),
		//.storage_dev = (void *)FLASH_AREA_ID,
		.mnt_point = &amp;quot;/lfs&amp;quot;,
};
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is the spm.conf&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Configuration copied from the nRF Secure Partition Manager (SPM) sample:
CONFIG_IS_SPM=y
CONFIG_FW_INFO=y
CONFIG_GPIO=n

# Make watchdog timers non-secure (so they can be used in the non-secure image).
# CONFIG_SPM_NRF_WDT_NS=y
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is the cmakelist.txt&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.13.1)
if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/spm.conf&amp;quot;)
  set(spm_CONF_FILE
    prj.conf
    ${CMAKE_CURRENT_LIST_DIR}/spm.conf
  )
endif()

if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;)
    list(APPEND mcuboot_OVERLAY_CONFIG
      &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;
      )
endif()

if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/boards/nrf9160dk_nrf9160ns.overlay&amp;quot;)
  set(mcuboot_DTC_OVERLAY_FILE &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/boards/nrf9160dk_nrf9160ns.overlay&amp;quot;)
  set(spm_DTC_OVERLAY_FILE &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/boards/nrf9160dk_nrf9160ns.overlay&amp;quot;)
endif()
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/pm_static.yml)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(NB_IOT_MBUS_GW)

zephyr_include_directories(include)


target_sources(app PRIVATE src/main.c src/wmbus.c)

add_subdirectory(drivers)&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is the overlay file&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
	chosen {
		zephyr,bt-uart=&amp;amp;uart0;
	};
};

&amp;amp;i2c2 {
    compatible = &amp;quot;nordic,nrf-twim&amp;quot;;
    status = &amp;quot;okay&amp;quot;;
    sda-pin = &amp;lt;26&amp;gt;;
    scl-pin = &amp;lt;27&amp;gt;;

    pcf85263a@51 {
        compatible = &amp;quot;nxp,pcf85263a&amp;quot;;
        label = &amp;quot;PCF85063A&amp;quot;;
        reg = &amp;lt;0x51&amp;gt;;
    };

};

&amp;amp;uart1 {
	status = &amp;quot;okay&amp;quot;;
	current-speed = &amp;lt;9600&amp;gt;;
	tx-pin = &amp;lt;06&amp;gt;;
	rx-pin = &amp;lt;07&amp;gt;;
};


&amp;amp;spi3 {
	compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;13&amp;gt;;
	mosi-pin = &amp;lt;11&amp;gt;;
	miso-pin = &amp;lt;12&amp;gt;;
	cs-gpios = &amp;lt;&amp;amp;gpio0 25 GPIO_ACTIVE_LOW&amp;gt;;
	mx25r6435f: mx25r6435f@0 {
		compatible = &amp;quot;jedec,spi-nor&amp;quot;;
		label = &amp;quot;MX25R6435F&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		spi-max-frequency = &amp;lt;40000000&amp;gt;;
		wp-gpios = &amp;lt;&amp;amp;gpio0 8 GPIO_ACTIVE_LOW&amp;gt;;
		hold-gpios = &amp;lt;&amp;amp;gpio0 10 GPIO_ACTIVE_LOW&amp;gt;;
		jedec-id = [c2 28 17];
		size = &amp;lt;67108864&amp;gt;;
		has-dpd;
		t-enter-dpd = &amp;lt;10000&amp;gt;;
		t-exit-dpd = &amp;lt;35000&amp;gt;;
	};
};&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU boot with external Flash littles partition and Secondary image partition</title><link>https://devzone.nordicsemi.com/thread/303015?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 07:21:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62664a9b-bd0e-47ae-8c26-4c92c4d60cd8</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You need to define the &amp;quot;external_flash&amp;quot; region. Try adding this to the top of your pm_static.yml:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;external_flash:
  address: 0x800000
  region: external_flash
  size: 0x0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In addition, you should add the similar configuration&amp;nbsp;to your prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_PM_EXTERNAL_FLASH=y
CONFIG_PM_EXTERNAL_FLASH_DEV_NAME=&amp;quot;MX25R6435F&amp;quot;
CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
CONFIG_PM_EXTERNAL_FLASH_SIZE=0x0800000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The project still didn&amp;#39;t compile at my end, I needed to add the &amp;quot;include&amp;quot; folder to the project. This is done by adding this line to your CMakeLists.txt:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;zephyr_include_directories(include)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU boot with external Flash littles partition and Secondary image partition</title><link>https://devzone.nordicsemi.com/thread/302847?ContentTypeID=1</link><pubDate>Thu, 01 Apr 2021 12:19:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cfd9677-8561-4443-bbe3-f4dd52213143</guid><dc:creator>Waqas Qammar</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;H&amp;aring;kon&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;I have applied the above-suggested techniques but I was getting this error.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Firmware/ncs/bootloader/mcuboot/boot/zephyr/flash_map_extended.c: In function &amp;#39;flash_area_id_from_multi_image_slot&amp;#39;:&lt;br /&gt;Firmware/ncs/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: error: &amp;#39;PM_MCUBOOT_SECONDARY_ID&amp;#39; undeclared (first use in this function); did you mean &amp;#39;PM_MCUBOOT_PRIMARY_ID&amp;#39;?&lt;br /&gt; #define FLASH_AREA_IMAGE_SECONDARY(x) PM_MCUBOOT_SECONDARY_ID&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Firmware/ncs/bootloader/mcuboot/boot/zephyr/flash_map_extended.c: In function &amp;#39;flash_area_id_to_multi_image_slot&amp;#39;:&lt;br /&gt;Firmware/ncs/bootloader/mcuboot/boot/zephyr/include/sysflash/sysflash.h:15:40: error: &amp;#39;PM_MCUBOOT_SECONDARY_ID&amp;#39; undeclared (first use in this function); did you mean &amp;#39;PM_MCUBOOT_PRIMARY_ID&amp;#39;?&lt;br /&gt; #define FLASH_AREA_IMAGE_SECONDARY(x) PM_MCUBOOT_SECONDARY_ID&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Firmware/ncs/nrf/include/flash_map_pm.h:32:22: error: &amp;#39;PM_external_flash_ID&amp;#39; undeclared here (not in a function)&lt;br /&gt; #define PM_ID(label) PM_##label##_ID&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have used this method of defining littlefs storage and all are giving errors.&lt;/p&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;#include &amp;lt;fs/fs.h&amp;gt;
#include &amp;lt;fs/littlefs.h&amp;gt;
#include &amp;lt;storage/flash_map.h&amp;gt;

#if (CONFIG_SPI_NOR - 0) || DT_NODE_HAS_STATUS(DT_INST(0, jedec_spi_nor), okay)
#define FLASH_DEVICE DT_LABEL(DT_INST(0, jedec_spi_nor))
#define FLASH_NAME &amp;quot;JEDEC SPI-NOR&amp;quot;
#elif (CONFIG_NORDIC_QSPI_NOR - 0) || DT_NODE_HAS_STATUS(DT_INST(0, nordic_qspi_nor), okay)
#define FLASH_DEVICE DT_LABEL(DT_INST(0, nordic_qspi_nor))
#define FLASH_NAME &amp;quot;JEDEC QSPI-NOR&amp;quot;
#else
#error Unsupported flash driver
#endif

LOG_MODULE_REGISTER(app);

/* Matches LFS_NAME_MAX */
#define MAX_PATH_LEN 255

FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(lfsstorage);
static struct fs_mount_t lfs_storage_mnt = {
		.type = FS_LITTLEFS,
		.fs_data = &amp;amp;lfsstorage,
		//.storage_dev = (void *)DT_FLASH_AREA_STORAGE_ID,
		//.storage_dev = (void *)FLASH_AREA_ID(storage),
		.storage_dev = (void *)FLASH_AREA_ID(external_flash),
		.mnt_point = &amp;quot;/lfs&amp;quot;,
};
&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;when I don&amp;#39;t use pm_static.yml. and simple pm.yml and spm.conf These errors don&amp;#39;t appear but I am stuck at a different location. While the program executes, I am unable to call the&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;err = uart_callback_set(uart, uart_callback, (void *)uart);
	__ASSERT(err == 0, &amp;quot;Failed to set callback&amp;quot;);&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;and the program restarts. I think this is due to SPM attachment and some secure and non-secure regions. The program restarts every time. If you can help it would be highly appreciated.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;I have attached the complete program for you&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;a href="https://drive.google.com/file/d/18pFJTa8KF97A2tyPrmdLfvTdLs9ienw2/view?usp=sharing"&gt;Complete program&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="left:75px;position:absolute;top:616px;" id="gtx-trans"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU boot with external Flash littles partition and Secondary image partition</title><link>https://devzone.nordicsemi.com/thread/298945?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 10:02:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff6ab6f3-4db7-4fe4-bcf4-a16ae0636d85</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="waqas_qammar"]&lt;p&gt;&lt;span&gt;littlefs_storage:&lt;br /&gt; address: 0xfa000&lt;br /&gt; placement:&lt;br /&gt; before:&lt;br /&gt; - end&lt;br /&gt; region: flash_primary&lt;br /&gt; size: 0x6000&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;so clearly old storage_partition is not being deleted and littlefs is not poiting to the new storage_parttion that I have created in the external_flash in the overlay file above.&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;There&amp;#39;s no logic that tells the &amp;quot;storage&amp;quot; to point to your external flash.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you do not specify the storage of different partitions, you will end up with the default setup, which is that there&amp;#39;s a external_flash partition, which is not populated and freely available to the application, not mcuboot or other partitions. If this is what you want, that is fine; but it seems you want to point mcuboot and lfs to your flash device? If that is so, you have to specify this using pm_static.yml.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="waqas_qammar"]2. HOw to create the partition in the same way as I have made for sotrage_parttion for secondary Image. I mean whats is the name of old partitions that I have to delete and what name should I made for new partitions such that it starts working with the new partition and both secondary image and&amp;nbsp;LittleFs storage would point to new external flash partitions.[/quote]
&lt;p&gt;&amp;nbsp;You specify both lfs and mcuboot_secondary to point to your &amp;quot;external_flash&amp;quot; region in pm_static.yml, as described in my first post. They shall not overlap in terms of addresses.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="waqas_qammar"]As far as the pm_static.yml is concerned, I don&amp;#39;t want to statically allocate at this time. I wanted to use an overlay file to create partitions region initially. the default partitions in the internal flash have also created this way as I saw the files of SDK and I have also seen examples online which use this method. but unfortunately, I am not successful in implementing that.[/quote]
&lt;p&gt;&amp;nbsp;As mentioned, you need to specify this. the partition manager will not assign a flash to given partitions unless you explicitly tell it to.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU boot with external Flash littles partition and Secondary image partition</title><link>https://devzone.nordicsemi.com/thread/298911?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 08:20:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:228af215-9e5d-4ec9-b5f3-df23cc0f7428</guid><dc:creator>Waqas Qammar</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for reaching out.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I was already including &lt;strong&gt;spm.conf&lt;/strong&gt; file and was adding &lt;strong&gt;overlay&lt;/strong&gt; and &lt;strong&gt;spm.conf&lt;/strong&gt; in my cMakelists.txt but now I changed that and make the If conditions as you have mentioned above. I have tried the above solution of creating a&lt;strong&gt; mcuboot.conf&lt;/strong&gt; file and copying the configurations (CONFIG_PM_EXTERNAL...) to that file, after doing that and compiling, to my surprise the external flash was totally not included in the build/partition.yml. When I copied those&amp;nbsp;configurations (CONFIG_PM_EXTERNAL...) back from &lt;strong&gt;mcuboot.conf&lt;/strong&gt; to &lt;strong&gt;prj.conf&lt;/strong&gt;, the external flash section start appearing again in the build/partition.yml as you can see in my initial attachment. There are two problems.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. The &lt;strong&gt;liilefs&lt;/strong&gt; storage is pointing to the internal memory and to the same partition that I have deleted the node in &lt;strong&gt;overlay&lt;/strong&gt; file and it is not pointing to external flash. so the external flash partition is not recognizing. Here is my overlay file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;

/ {
	chosen {
		zephyr,bt-uart=&amp;amp;uart0;
	};
};

/delete-node/ &amp;amp;storage_partition;

&amp;amp;i2c2 {
    compatible = &amp;quot;nordic,nrf-twim&amp;quot;;
    status = &amp;quot;okay&amp;quot;;
    sda-pin = &amp;lt;26&amp;gt;;
    scl-pin = &amp;lt;27&amp;gt;;

    pcf85263a@51 {
        compatible = &amp;quot;nxp,pcf85263a&amp;quot;;
        label = &amp;quot;PCF85063A&amp;quot;;
        reg = &amp;lt;0x51&amp;gt;;
    };

};

&amp;amp;uart1 {
	status = &amp;quot;okay&amp;quot;;
	current-speed = &amp;lt;9600&amp;gt;;
	tx-pin = &amp;lt;06&amp;gt;;
	rx-pin = &amp;lt;07&amp;gt;;
};


&amp;amp;spi3 {
	compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;13&amp;gt;;
	mosi-pin = &amp;lt;11&amp;gt;;
	miso-pin = &amp;lt;12&amp;gt;;
	cs-gpios = &amp;lt;&amp;amp;gpio0 25 GPIO_ACTIVE_LOW&amp;gt;;
	mx25r6435f: mx25r6435f@0 {
		compatible = &amp;quot;jedec,spi-nor&amp;quot;;
		label = &amp;quot;MX25R6435F&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		spi-max-frequency = &amp;lt;40000000&amp;gt;;
		wp-gpios = &amp;lt;&amp;amp;gpio0 8 GPIO_ACTIVE_LOW&amp;gt;;
		hold-gpios = &amp;lt;&amp;amp;gpio0 10 GPIO_ACTIVE_LOW&amp;gt;;
		jedec-id = [c2 28 14];
  		size = &amp;lt;0x0800000&amp;gt;; /* flash capacity in bits */
  		has-be32k;
  		has-dpd;
  		t-enter-dpd = &amp;lt;10000&amp;gt;;
  		t-exit-dpd = &amp;lt;35000&amp;gt;;
	};
};


&amp;amp;mx25r6435f {
 	partitions {
  		compatible = &amp;quot;fixed-partitions&amp;quot;;
  		#address-cells = &amp;lt;1&amp;gt;;
  		#size-cells = &amp;lt;1&amp;gt;;
		storage_partition: partition@40000 {
   			label = &amp;quot;storage&amp;quot;;
   			reg = &amp;lt;0x00040000 0x00020000&amp;gt;;
  		};
 	};
};
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is the build/partition.yml section&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;littlefs_storage:&lt;br /&gt; address: 0xfa000&lt;br /&gt; placement:&lt;br /&gt; before:&lt;br /&gt; - end&lt;br /&gt; region: flash_primary&lt;br /&gt; size: 0x6000&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;so clearly old storage_partition is not being deleted and littlefs is not poiting to the new storage_parttion that I have created in the external_flash in the overlay file above.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. HOw to create the partition in the same way as I have made for sotrage_parttion for secondary Image. I mean whats is the name of old partitions that I have to delete and what name should I made for new partitions such that it starts working with the new partition and both secondary image and&amp;nbsp;LittleFs storage would point to new external flash partitions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. As far as the pm_static.yml is concerned, I don&amp;#39;t want to statically allocate at this time. I wanted to use an overlay file to create partitions region initially. the default partitions in the internal flash have also created this way as I saw the files of SDK and I have also seen examples online which use this method. but unfortunately, I am not successful in implementing that.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU boot with external Flash littles partition and Secondary image partition</title><link>https://devzone.nordicsemi.com/thread/298780?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 15:20:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aeb07be8-d45e-48ea-ac58-19c92d08edae</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you want the mcuboot_secondary partition to be on your external flash?&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know how you have configured mcuboot, but this will also need to have a specific configuration that tells it that there&amp;#39;s a external storage available.&lt;/p&gt;
&lt;p&gt;First you need to alter your CMakeLists.txt file, to allow adding mcuboot specific configurations and overlay.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can overload the configuration by adding this to the top of your CMakeLists.txt (just&amp;nbsp;&lt;/span&gt;&lt;strong&gt;below the cmake_minimum_required()&lt;/strong&gt;&lt;span&gt;):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/spm.conf&amp;quot;)
  set(spm_CONF_FILE
    prj.conf
    ${CMAKE_CURRENT_LIST_DIR}/spm.conf
  )
endif()

if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;)
    list(APPEND mcuboot_OVERLAY_CONFIG
      &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;
      )
endif()

if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/${BOARD}.overlay&amp;quot;)
  set(mcuboot_DTC_OVERLAY_FILE &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/${BOARD}.overlay&amp;quot;)
  set(spm_DTC_OVERLAY_FILE &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/${BOARD}.overlay&amp;quot;)
endif()&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now, you can create my_application/mcuboot.conf, which holds flash specific configurations (taken from your current configuration):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_PM_EXTERNAL_FLASH=y
CONFIG_PM_EXTERNAL_FLASH_DEV_NAME=&amp;quot;MX25R6435F&amp;quot;
CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
CONFIG_PM_EXTERNAL_FLASH_SIZE=0x0800000&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The above is similar to how it is setup in the documentation:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#pm-external-flash"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#pm-external-flash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you want to specify the mcuboot secondary slot to external flash, you need to adjust your my_application/build/partitions.yml and place this in the application folder as &amp;quot;pm_static.yml&amp;quot; (my_application/pm_static.yml).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is covered more in detail in the documentation:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#static-configuration"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#static-configuration&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here&amp;#39;s an example on the secondary slot, pointed to your flash device:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;mcuboot_secondary:
  address: 0x0
  device: mx25r6435f
  region: external_flash
  size: 0x800000&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Håkon&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>