[NF5340] MCUBoot never launch my app after moving mcuboot_secondary to external flash

Hello,

I’m using the Thingy91X board (nRF5340). For my application, I need to run BLE and Wi-Fi simultaneously, so I have to increase the application size. To do this, I moved the secondary and secondary_1 slots to the external flash (I simply applied Nordic’s thingy91x_nrf5340_pm_static_ext_flash.yml in /nrf/boards/nordic/thingy91x).

According to common.dts, I enabled the external flash in my overlay:

/{
	chosen {
		zephyr,console = &rtt0; 
		zephyr,shell-uart = &rtt0;
		zephyr,uart-mcumgr = &rtt0;
		zephyr,bt-mon-uart = &rtt0;
		zephyr,bt-c2h-uart = &rtt0;
        nordic,pm-ext-flash = &flash_ext; //here
	};
};

&spi3 {
    status = "okay";

    flash_ext: GD25LE255E@0 {
        status = "okay";              
        reg = <0>;                    
        compatible = "jedec,spi-nor"; 
    };
};

I added the following Kconfig options to my prj.conf:

CONFIG_GPIO=y
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096

CONFIG_FLASH=y
CONFIG_FLASH_MAP=y

CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y

Following this tutorial: https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-9-bootloaders-and-dfu-fota/topic/exercise-3-dfu-with-external-flash/

mcuboot.conf

# Step 1.2 - Enable SPI driver for MCUboot
CONFIG_GPIO=y
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
# QSPI drivers are enabled by defualt for some chips.
# Disable it explicitly to be sure QSPI is disabled.
CONFIG_NORDIC_QSPI_NOR=n 

# required by SPI driver
CONFIG_MULTITHREADING=y

CONFIG_BOOT_MAX_IMG_SECTORS=512

mucboot.overlay

/ {
	chosen {
        nordic,pm-ext-flash = &flash_ext;
	};
};

&spi3 {
    status = "okay";
    pinctrl-0 = <&spi3_default>;
    pinctrl-1 = <&spi3_sleep>;
    pinctrl-names = "default", "sleep";


    flash_ext: GD25LE255E@0 {
        status = "okay";              
        reg = <0>;                    
        compatible = "jedec,spi-nor"; 
    };
};

Then, I created the sysbuild.conf and added the Kconfigs : 

SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
SB_CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y

My pm_static.yml is : 

b0:
  address: 0x0
  size: 0x8000
  region: flash_primary
b0_container:
  address: 0x0
  size: 0x8000
  region: flash_primary
  span: [b0]
s0:
  address: 0x8000
  size: 0x14000
  span: [mcuboot, s0_pad]
  region: flash_primary
s0_pad:
  address: 0x8000
  size: 0x200
  share_size: [mcuboot_pad]
  region: flash_primary
s0_image:
  address: 0x8200
  size: 0x13e00
  span: [mcuboot]
  region: flash_primary
mcuboot:
  address: 0x8200
  size: 0x13e00
  region: flash_primary
s1:
  address: 0x1c000
  size: 0x14000
  span: [s1_pad, s1_image]
  region: flash_primary
s1_pad:
  address: 0x1c000
  size: 0x200
  region: flash_primary
  share_size: [mcuboot_pad]
s1_image:
  address: 0x1c200
  size: 0x13e00
  share_size: [mcuboot]
  region: flash_primary
mcuboot_primary:
  address: 0x30000
  size: 0xcc000
  span: [mcuboot_pad, app]
  region: flash_primary
mcuboot_pad:
  address: 0x30000
  size: 0x200
  region: flash_primary
mcuboot_primary_app:
  address: 0x30200
  size: 0xcbe00
  span: [app]
  region: flash_primary
app_image:
  address: 0x30200
  size: 0xcbe00
  span: [app]
  region: flash_primary
app:
  address: 0x30200
  size: 0xcbe00
  region: flash_primary
settings_storage:
  address: 0xfc000
  size: 0x4000
  region: flash_primary

external_flash:
  device: DT_CHOSEN(nordic_pm_ext_flash)
  address: 0x0
  size: 0x2000000
  span: [mcuboot_secondary]
  region: external_flash
mcuboot_secondary:
  device: DT_CHOSEN(nordic_pm_ext_flash)
  address: 0x0
  size: 0xcc000
  share_size: [mcuboot_primary]
  region: external_flash
mcuboot_secondary_1:
  address: 0xcc000
  size: 0x40000
  device: DT_CHOSEN(nordic_pm_ext_flash)
  region: external_flash
pcd_sram:
  address: 0x20000000
  size: 0x2000
  region: sram_primary
sram_retained_mem:
  region: sram_primary
  address: 0x2007FC00
  size: 0x400

My main app just blink a led (it works without changing partition).

#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>

#define LED0_NODE DT_ALIAS(led0)

static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);

int main(void) {
  printk("BOOTING...\n");

  if (!gpio_is_ready_dt(&led)) {
    printk("1\n");
    return 0;        
  }

  int ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
  if (ret < 0)
  {
    printk("2\n");
    return 0;
  }

  while (1) {
    k_msleep(100);
    ret = gpio_pin_toggle_dt(&led);
    if( ret < 0)
    {
      printk("3\n");
      return 0;
    }
    printk("BOOTING...\n");
  }
}

I used J-Link GDB to check whether the code is the issue. When I load the .elf and set a breakpoint at main, the breakpoint is hit, but I see nothing on RTT and the LED does not toggle.

Do you have any ideas ?

Parents
  • Hello,

    Your partition file looks fine to me, so I don’t think the issue is related to the partitioning. Could you enable the logs from MCUboot and check if they provide any additional information about the issue?

    Also, please check the generated zephyr.dts under build/mcuboot. This will show if MCUboot is having trouble reading the external flash.

    I would also recommend running the JESD216 (SFDP) sample to verify that the connection and device tree basics are correct.

    Kind Regards,

    Abhijith

Reply
  • Hello,

    Your partition file looks fine to me, so I don’t think the issue is related to the partitioning. Could you enable the logs from MCUboot and check if they provide any additional information about the issue?

    Also, please check the generated zephyr.dts under build/mcuboot. This will show if MCUboot is having trouble reading the external flash.

    I would also recommend running the JESD216 (SFDP) sample to verify that the connection and device tree basics are correct.

    Kind Regards,

    Abhijith

Children
  • Hello,

    I tried to enable MCUboot logs, but I think I did it wrong because I see nothing in the J-Link RTT Viewer interface. I added the following to the mcuboot prj.conf

    CONFIG_LOG=y
    CONFIG_LOG_MODE_IMMEDIATE=n
    CONFIG_LOG_MODE_DEFERRED=y
    CONFIG_LOG_BUFFER_SIZE=10240
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_RTT_CONSOLE=y

    The generated zephyr.dts is : 

    /dts-v1/;
    
    / {
        #address-cells = < 0x1 >;
        #size-cells = < 0x1 >;
        model = "Nordic Thingy:91 X NRF5340 Application";
        compatible = "nordic,thingy91x-nrf5340-cpuapp";
        chosen {
            zephyr,entropy = &cryptocell;
            zephyr,flash-controller = &flash_controller;
            zephyr,console = &rtt0;
            zephyr,shell-uart = &rtt0;
            zephyr,uart-mcumgr = &rtt0;
            zephyr,bt-mon-uart = &rtt0;
            zephyr,bt-c2h-uart = &rtt0;
            zephyr,bt-hci-ipc = &ipc0;
            nordic,802154-spinel-ipc = &ipc0;
            zephyr,ieee802154 = &ieee802154;
            zephyr,boot-mode = &boot_mode0;
            zephyr,ipc_shm = &sram0_shared;
            zephyr,sram = &sram0_image;
            zephyr,flash = &flash0;
            zephyr,code-partition = &slot0_partition;
            zephyr,sram-secure-partition = &sram0_s;
            zephyr,sram-non-secure-partition = &sram0_ns;
            zephyr,bt-hci = &bt_hci_ipc0;
            nordic,pm-ext-flash = &flash_ext;
        };
        aliases {
            led0 = &led0;
            led1 = &led1;
            led2 = &led2;
            sw0 = &button0;
            bootloader-led0 = &led0;
            mcuboot-button0 = &button0;
            mcuboot-led0 = &led0;
            watchdog0 = &wdt0;
        };
        soc {
            #address-cells = < 0x1 >;
            #size-cells = < 0x1 >;
            compatible = "nordic,nrf5340-cpuapp-qkaa", "nordic,nrf5340-cpuapp", "nordic,nrf53", "simple-bus";
            interrupt-parent = < &nvic >;
            ranges;
            nvic: interrupt-controller@e000e100 {
                #address-cells = < 0x1 >;
                compatible = "arm,v8m-nvic";
                reg = < 0xe000e100 0xc00 >;
                interrupt-controller;
                #interrupt-cells = < 0x2 >;
                arm,num-irq-priority-bits = < 0x3 >;
                phandle = < 0x1 >;
            };
            systick: timer@e000e010 {
                compatible = "arm,armv8m-systick";
                reg = < 0xe000e010 0x10 >;
                status = "disabled";
            };
            ficr: ficr@ff0000 {
                compatible = "nordic,nrf-ficr";
                reg = < 0xff0000 0x1000 >;
                #nordic,ficr-cells = < 0x1 >;
                status = "okay";
            };
            uicr: uicr@ff8000 {
                compatible = "nordic,nrf-uicr";
                reg = < 0xff8000 0x1000 >;
                status = "okay";
            };
            sram0: memory@20000000 {
                compatible = "mmio-sram";
                reg = < 0x20000000 0x80000 >;
            };
            peripheral@50000000 {
                #address-cells = < 0x1 >;
                #size-cells = < 0x1 >;
                ranges = < 0x0 0x50000000 0x10000000 >;
                dcnf: dcnf@0 {
                    compatible = "nordic,nrf-dcnf";
                    reg = < 0x0 0x1000 >;
                    status = "okay";
                };
                oscillators: oscillator@4000 {
                    compatible = "nordic,nrf-oscillators";
                    reg = < 0x4000 0x1000 >;
                    status = "okay";
                };
                regulators: regulator@4000 {
                    compatible = "nordic,nrf53x-regulators";
                    reg = < 0x4000 0x1000 >;
                    status = "okay";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x1 >;
                    vregmain: regulator@4704 {
                        compatible = "nordic,nrf5x-regulator";
                        reg = < 0x4704 0x1 >;
                        status = "okay";
                        regulator-name = "VREGMAIN";
                        regulator-initial-mode = < 0x0 >;
                    };
                    vregradio: regulator@4904 {
                        compatible = "nordic,nrf5x-regulator";
                        reg = < 0x4904 0x1 >;
                        status = "okay";
                        regulator-name = "VREGRADIO";
                        regulator-initial-mode = < 0x0 >;
                    };
                    vregh: regulator@4b00 {
                        compatible = "nordic,nrf53x-regulator-hv";
                        reg = < 0x4b00 0x44 >;
                        status = "disabled";
                        regulator-name = "VREGH";
                    };
                };
                clock: clock@5000 {
                    compatible = "nordic,nrf-clock";
                    reg = < 0x5000 0x1000 >;
                    interrupts = < 0x5 0x1 >;
                    status = "okay";
                };
                power: power@5000 {
                    compatible = "nordic,nrf-power";
                    reg = < 0x5000 0x1000 >;
                    ranges = < 0x0 0x5000 0x1000 >;
                    interrupts = < 0x5 0x1 >;
                    status = "okay";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x1 >;
                    gpregret1: gpregret1@51c {
                        #address-cells = < 0x1 >;
                        #size-cells = < 0x1 >;
                        compatible = "nordic,nrf-gpregret";
                        reg = < 0x51c 0x1 >;
                        status = "okay";
                    };
                    gpregret2: gpregret2@520 {
                        #address-cells = < 0x1 >;
                        #size-cells = < 0x1 >;
                        compatible = "nordic,nrf-gpregret";
                        reg = < 0x520 0x1 >;
                        status = "okay";
                    };
                };
                reset: reset-controller@5000 {
                    compatible = "nordic,nrf-reset";
                    reg = < 0x5000 0x1000 >;
                    status = "okay";
                };
                ctrlap: ctrlap@6000 {
                    compatible = "nordic,nrf-ctrlapperi";
                    reg = < 0x6000 0x1000 >;
                    status = "okay";
                };
                i2c0: i2c@8000 {
                    compatible = "nordic,nrf-twim";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0x8000 0x1000 >;
                    interrupts = < 0x8 0x1 >;
                    easydma-maxcnt-bits = < 0x10 >;
                    status = "disabled";
                    zephyr,pm-device-runtime-auto;
                };
                spi0: spi@8000 {
                    compatible = "nordic,nrf-spim";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0x8000 0x1000 >;
                    interrupts = < 0x8 0x1 >;
                    max-frequency = < 0x7a1200 >;
                    easydma-maxcnt-bits = < 0x10 >;
                    status = "disabled";
                };
                uart0: uart@8000 {
                    compatible = "nordic,nrf-uarte";
                    reg = < 0x8000 0x1000 >;
                    interrupts = < 0x8 0x1 >;
                    status = "okay";
                    current-speed = < 0x1c200 >;
                    pinctrl-0 = < &uart0_default >;
                    pinctrl-1 = < &uart0_sleep >;
                    pinctrl-names = "default", "sleep";
                };
                i2c1: i2c@9000 {
                    compatible = "nordic,nrf-twim";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0x9000 0x1000 >;
                    interrupts = < 0x9 0x1 >;
                    easydma-maxcnt-bits = < 0x10 >;
                    status = "disabled";
                    zephyr,pm-device-runtime-auto;
                };
                spi1: spi@9000 {
                    compatible = "nordic,nrf-spim";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0x9000 0x1000 >;
                    interrupts = < 0x9 0x1 >;
                    max-frequency = < 0x7a1200 >;
                    easydma-maxcnt-bits = < 0x10 >;
                    status = "disabled";
                };
                uart1: uart@9000 {
                    compatible = "nordic,nrf-uarte";
                    reg = < 0x9000 0x1000 >;
                    interrupts = < 0x9 0x1 >;
                    status = "okay";
                    current-speed = < 0x1c200 >;
                    pinctrl-0 = < &uart1_default >;
                    pinctrl-1 = < &uart1_sleep >;
                    pinctrl-names = "default", "sleep";
                };
                spi4: spi@a000 {
                    compatible = "nordic,nrf-spim";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0xa000 0x1000 >;
                    interrupts = < 0xa 0x1 >;
                    max-frequency = < 0x1e84800 >;
                    easydma-maxcnt-bits = < 0x10 >;
                    rx-delay-supported;
                    rx-delay = < 0x2 >;
                    status = "disabled";
                };
                i2c2: i2c@b000 {
                    compatible = "nordic,nrf-twim";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0xb000 0x1000 >;
                    interrupts = < 0xb 0x1 >;
                    easydma-maxcnt-bits = < 0x10 >;
                    status = "disabled";
                    zephyr,pm-device-runtime-auto;
                    clock-frequency = < 0x186a0 >;
                    pinctrl-0 = < &i2c2_default >;
                    pinctrl-1 = < &i2c2_sleep >;
                    pinctrl-names = "default", "sleep";
                    bme680: bme680@76 {
                        status = "disabled";
                        compatible = "bosch,bme680";
                        reg = < 0x76 >;
                    };
                    pmic_main: npm1300@6b {
                        compatible = "nordic,npm1300";
                        status = "disabled";
                        pmic-int-pin = < 0x3 >;
                        reg = < 0x6b >;
                        gpios_pmic: npm1300_gpios {
                            compatible = "nordic,npm1300-gpio";
                            status = "disabled";
                            gpio-controller;
                            #gpio-cells = < 0x2 >;
                            ngpios = < 0x5 >;
                            phandle = < 0x8 >;
                            npm13_button: GPIO0 {
                                gpio-hog;
                                gpios = < 0x0 0x0 >;
                            };
                            ldsw_rf_fe_sr_en: GPIO1 {
                                gpio-hog;
                                output-low;
                                gpios = < 0x1 0x17 >;
                            };
                            power_switch: GPIO2 {
                                gpio-hog;
                                gpios = < 0x2 0x0 >;
                            };
                            npm6001_ready: GPIO4 {
                                gpio-hog;
                                gpios = < 0x4 0x0 >;
                            };
                        };
                        regulators {
                            compatible = "nordic,npm1300-regulator";
                            status = "disabled";
                            reg_3v3: BUCK2 {
                                regulator-min-microvolt = < 0x325aa0 >;
                                regulator-max-microvolt = < 0x325aa0 >;
                                enable-gpios = < &gpios_pmic 0x2 0x0 >;
                            };
                            ldsw_nPM6001_en: LDO1 {
                                regulator-initial-mode = < 0x3 >;
                                regulator-allowed-modes = < 0x3 >;
                                regulator-boot-off;
                            };
                            ldsw_sensors: LDO2 {
                                regulator-initial-mode = < 0x3 >;
                                regulator-allowed-modes = < 0x3 >;
                                regulator-boot-on;
                            };
                        };
                        npm1300_charger: charger {
                            compatible = "nordic,npm1300-charger";
                            status = "disabled";
                            vbus-limit-microamp = < 0x7a120 >;
                            term-microvolt = < 0x401640 >;
                            current-microamp = < 0xa4cb8 >;
                            dischg-limit-microamp = < 0x147260 >;
                            thermistor-cold-millidegrees = < 0x0 >;
                            thermistor-cool-millidegrees = < 0x0 >;
                            thermistor-warm-millidegrees = < 0xafc8 >;
                            thermistor-hot-millidegrees = < 0xafc8 >;
                            thermistor-ohms = < 0x2710 >;
                            thermistor-beta = < 0xd6b >;
                            charging-enable;
                        };
                    };
                    pmic_wifi: npm6001@70 {
                        status = "disabled";
                        compatible = "nordic,npm6001";
                        reg = < 0x70 >;
                        regulators {
                            compatible = "nordic,npm6001-regulator";
                            status = "disabled";
                            pmic_wifi_buck0: BUCK0 {
                                regulator-boot-off;
                            };
                            pmic_wifi_buck1: BUCK1 {
                                regulator-boot-off;
                            };
                            pmic_wifi_buck2: BUCK2 {
                                regulator-boot-off;
                            };
                            reg_wifi: BUCK3 {
                                regulator-min-microvolt = < 0x325aa0 >;
                                regulator-max-microvolt = < 0x325aa0 >;
                                regulator-initial-mode = < 0x0 >;
                                regulator-boot-on;
                            };
                        };
                    };
                    accel: accelerometer_lp: adxl367@1d {
                        status = "disabled";
                        compatible = "adi,adxl367";
                        odr = < 0x3 >;
                        reg = < 0x1d >;
                        int1-gpios = < &gpio0 0x1c 0x0 >;
                    };
                    magnetometer: bmm350@14 {
                        status = "disabled";
                        compatible = "bosch,bmm350";
                        reg = < 0x14 >;
                        drdy-gpios = < &gpio1 0xd 0x1 >;
                    };
                };
                spi2: spi@b000 {
                    compatible = "nordic,nrf-spim";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0xb000 0x1000 >;
                    interrupts = < 0xb 0x1 >;
                    max-frequency = < 0x7a1200 >;
                    easydma-maxcnt-bits = < 0x10 >;
                    status = "disabled";
                };
                uart2: uart@b000 {
                    compatible = "nordic,nrf-uarte";
                    reg = < 0xb000 0x1000 >;
                    interrupts = < 0xb 0x1 >;
                    status = "disabled";
                };
                i2c3: i2c@c000 {
                    compatible = "nordic,nrf-twim";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0xc000 0x1000 >;
                    interrupts = < 0xc 0x1 >;
                    easydma-maxcnt-bits = < 0x10 >;
                    status = "disabled";
                    zephyr,pm-device-runtime-auto;
                };
                spi3: spi@c000 {
                    compatible = "nordic,nrf-spim";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0xc000 0x1000 >;
                    interrupts = < 0xc 0x1 >;
                    max-frequency = < 0x7a1200 >;
                    easydma-maxcnt-bits = < 0x10 >;
                    status = "okay";
                    pinctrl-0 = < &spi3_default >;
                    pinctrl-1 = < &spi3_sleep >;
                    pinctrl-names = "default", "sleep";
                    cs-gpios = < &gpio0 0x2 0x1 >, < &gpio0 0xb 0x1 >, < &gpio1 0xb 0x1 >;
                    flash_ext: GD25LE255E@0 {
                        compatible = "jedec,spi-nor";
                        status = "okay";
                        reg = < 0x0 >;
                        spi-max-frequency = < 0x7a1200 >;
                        size = < 0x10000000 >;
                        has-dpd;
                        t-enter-dpd = < 0xbb8 >;
                        t-exit-dpd = < 0x4e20 >;
                        sfdp-bfp = [ E5 20 F3 FF FF FF FF 0F 44 EB 08 6B 08 3B 42 BB FE FF FF FF FF FF 00 FF FF FF 42 EB 0C 20 0F 52 10 D8 00 FF D4 31 A5 FE 84 DF 14 4F EC 62 16 33 7A 75 7A 75 04 B3 D5 5C 19 06 14 00 08 50 00 01 ];
                        jedec-id = [ C8 60 19 ];
                    };
                    nrf70: wifi@1 {
                        compatible = "nordic,nrf7002-spi";
                        status = "disabled";
                        reg = < 0x1 >;
                        spi-max-frequency = < 0x7a1200 >;
                        iovdd-ctrl-gpios = < &gpio0 0x4 0x20 >;
                        bucken-gpios = < &gpio0 0x7 0x20 >;
                        host-irq-gpios = < &gpio0 0x5 0x0 >;
                        wifi-max-tx-pwr-2g-dsss = < 0x15 >;
                        wifi-max-tx-pwr-2g-mcs0 = < 0x10 >;
                        wifi-max-tx-pwr-2g-mcs7 = < 0x10 >;
                        wifi-max-tx-pwr-5g-low-mcs0 = < 0x9 >;
                        wifi-max-tx-pwr-5g-low-mcs7 = < 0x9 >;
                        wifi-max-tx-pwr-5g-mid-mcs0 = < 0xb >;
                        wifi-max-tx-pwr-5g-mid-mcs7 = < 0xb >;
                        wifi-max-tx-pwr-5g-high-mcs0 = < 0xd >;
                        wifi-max-tx-pwr-5g-high-mcs7 = < 0xd >;
                        nordic_wlan0: wlan0 {
                            compatible = "nordic,wlan";
                        };
                    };
                    accelerometer_hp: bmi270@2 {
                        compatible = "bosch,bmi270";
                        status = "disabled";
                        reg = < 0x2 >;
                        spi-max-frequency = < 0x989680 >;
                        irq-gpios = < &gpio0 0x11 0x1 >;
                    };
                };
                uart3: uart@c000 {
                    compatible = "nordic,nrf-uarte";
                    reg = < 0xc000 0x1000 >;
                    interrupts = < 0xc 0x1 >;
                    status = "disabled";
                };
                adc: adc@e000 {
                    compatible = "nordic,nrf-saadc";
                    reg = < 0xe000 0x1000 >;
                    interrupts = < 0xe 0x1 >;
                    status = "okay";
                    #io-channel-cells = < 0x1 >;
                };
                timer0: timer@f000 {
                    compatible = "nordic,nrf-timer";
                    status = "disabled";
                    reg = < 0xf000 0x1000 >;
                    cc-num = < 0x6 >;
                    max-bit-width = < 0x20 >;
                    interrupts = < 0xf 0x1 >;
                    prescaler = < 0x0 >;
                };
                timer1: timer@10000 {
                    compatible = "nordic,nrf-timer";
                    status = "disabled";
                    reg = < 0x10000 0x1000 >;
                    cc-num = < 0x6 >;
                    max-bit-width = < 0x20 >;
                    interrupts = < 0x10 0x1 >;
                    prescaler = < 0x0 >;
                    phandle = < 0xe >;
                };
                timer2: timer@11000 {
                    compatible = "nordic,nrf-timer";
                    status = "disabled";
                    reg = < 0x11000 0x1000 >;
                    cc-num = < 0x6 >;
                    max-bit-width = < 0x20 >;
                    interrupts = < 0x11 0x1 >;
                    prescaler = < 0x0 >;
                };
                rtc0: rtc@14000 {
                    compatible = "nordic,nrf-rtc";
                    reg = < 0x14000 0x1000 >;
                    cc-num = < 0x4 >;
                    interrupts = < 0x14 0x1 >;
                    status = "disabled";
                    clock-frequency = < 0x8000 >;
                    prescaler = < 0x1 >;
                };
                rtc1: rtc@15000 {
                    compatible = "nordic,nrf-rtc";
                    reg = < 0x15000 0x1000 >;
                    cc-num = < 0x4 >;
                    interrupts = < 0x15 0x1 >;
                    status = "disabled";
                    clock-frequency = < 0x8000 >;
                    prescaler = < 0x1 >;
                };
                dppic0: dppic: dppic@17000 {
                    compatible = "nordic,nrf-dppic";
                    reg = < 0x17000 0x1000 >;
                    status = "okay";
                };
                wdt: wdt0: watchdog@18000 {
                    compatible = "nordic,nrf-wdt";
                    reg = < 0x18000 0x1000 >;
                    interrupts = < 0x18 0x1 >;
                    status = "okay";
                };
                wdt1: watchdog@19000 {
                    compatible = "nordic,nrf-wdt";
                    reg = < 0x19000 0x1000 >;
                    interrupts = < 0x19 0x1 >;
                    status = "disabled";
                };
                comp: comparator@1a000 {
                    compatible = "nordic,nrf-comp";
                    reg = < 0x1a000 0x1000 >;
                    interrupts = < 0x1a 0x1 >;
                    status = "disabled";
                };
                egu0: egu@1b000 {
                    compatible = "nordic,nrf-egu";
                    reg = < 0x1b000 0x1000 >;
                    interrupts = < 0x1b 0x1 >;
                    status = "okay";
                };
                egu1: egu@1c000 {
                    compatible = "nordic,nrf-egu";
                    reg = < 0x1c000 0x1000 >;
                    interrupts = < 0x1c 0x1 >;
                    status = "okay";
                };
                egu2: egu@1d000 {
                    compatible = "nordic,nrf-egu";
                    reg = < 0x1d000 0x1000 >;
                    interrupts = < 0x1d 0x1 >;
                    status = "okay";
                };
                egu3: egu@1e000 {
                    compatible = "nordic,nrf-egu";
                    reg = < 0x1e000 0x1000 >;
                    interrupts = < 0x1e 0x1 >;
                    status = "okay";
                };
                egu4: egu@1f000 {
                    compatible = "nordic,nrf-egu";
                    reg = < 0x1f000 0x1000 >;
                    interrupts = < 0x1f 0x1 >;
                    status = "okay";
                };
                egu5: egu@20000 {
                    compatible = "nordic,nrf-egu";
                    reg = < 0x20000 0x1000 >;
                    interrupts = < 0x20 0x1 >;
                    status = "okay";
                };
                pwm0: pwm@21000 {
                    compatible = "nordic,nrf-pwm";
                    reg = < 0x21000 0x1000 >;
                    interrupts = < 0x21 0x1 >;
                    status = "disabled";
                    #pwm-cells = < 0x3 >;
                };
                pwm1: pwm@22000 {
                    compatible = "nordic,nrf-pwm";
                    reg = < 0x22000 0x1000 >;
                    interrupts = < 0x22 0x1 >;
                    status = "disabled";
                    #pwm-cells = < 0x3 >;
                };
                pwm2: pwm@23000 {
                    compatible = "nordic,nrf-pwm";
                    reg = < 0x23000 0x1000 >;
                    interrupts = < 0x23 0x1 >;
                    status = "disabled";
                    #pwm-cells = < 0x3 >;
                };
                pwm3: pwm@24000 {
                    compatible = "nordic,nrf-pwm";
                    reg = < 0x24000 0x1000 >;
                    interrupts = < 0x24 0x1 >;
                    status = "disabled";
                    #pwm-cells = < 0x3 >;
                };
                pdm0: pdm@26000 {
                    compatible = "nordic,nrf-pdm";
                    reg = < 0x26000 0x1000 >;
                    interrupts = < 0x26 0x1 >;
                    status = "disabled";
                };
                i2s0: i2s@28000 {
                    compatible = "nordic,nrf-i2s";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0x28000 0x1000 >;
                    interrupts = < 0x28 0x1 >;
                    status = "disabled";
                };
                mbox: ipc: mbox@2a000 {
                    compatible = "nordic,mbox-nrf-ipc", "nordic,nrf-ipc";
                    reg = < 0x2a000 0x1000 >;
                    tx-mask = < 0xffff >;
                    rx-mask = < 0xffff >;
                    interrupts = < 0x2a 0x1 >;
                    #mbox-cells = < 0x1 >;
                    status = "okay";
                    phandle = < 0x10 >;
                };
                qspi: qspi@2b000 {
                    compatible = "nordic,nrf-qspi";
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x0 >;
                    reg = < 0x2b000 0x1000 >, < 0x10000000 0x10000000 >;
                    reg-names = "qspi", "qspi_mm";
                    interrupts = < 0x2b 0x1 >;
                    status = "disabled";
                };
                nfct: nfct@2d000 {
                    compatible = "nordic,nrf-nfct";
                    reg = < 0x2d000 0x1000 >;
                    interrupts = < 0x2d 0x1 >;
                    status = "disabled";
                };
                mutex: mutex@30000 {
                    compatible = "nordic,nrf-mutex";
                    reg = < 0x30000 0x1000 >;
                    status = "okay";
                };
                qdec0: qdec@33000 {
                    compatible = "nordic,nrf-qdec";
                    reg = < 0x33000 0x1000 >;
                    interrupts = < 0x33 0x1 >;
                    status = "disabled";
                };
                qdec1: qdec@34000 {
                    compatible = "nordic,nrf-qdec";
                    reg = < 0x34000 0x1000 >;
                    interrupts = < 0x34 0x1 >;
                    status = "disabled";
                };
                usbd: zephyr_udc0: usbd@36000 {
                    compatible = "nordic,nrf-usbd";
                    reg = < 0x36000 0x1000 >;
                    interrupts = < 0x36 0x1 >;
                    num-bidir-endpoints = < 0x1 >;
                    num-in-endpoints = < 0x7 >;
                    num-out-endpoints = < 0x7 >;
                    num-isoin-endpoints = < 0x1 >;
                    num-isoout-endpoints = < 0x1 >;
                    status = "okay";
                    cdc_acm_uart0: cdc_acm_uart0 {
                        compatible = "zephyr,cdc-acm-uart";
                    };
                    cdc_acm_uart1: cdc_acm_uart1 {
                        compatible = "zephyr,cdc-acm-uart";
                    };
                };
                usbreg: regulator@37000 {
                    compatible = "nordic,nrf-usbreg";
                    reg = < 0x37000 0x1000 >;
                    interrupts = < 0x37 0x1 >;
                    status = "okay";
                };
                flash_controller: flash-controller@39000 {
                    compatible = "nordic,nrf53-flash-controller";
                    reg = < 0x39000 0x1000 >;
                    partial-erase;
                    #address-cells = < 0x1 >;
                    #size-cells = < 0x1 >;
                    flash0: flash@0 {
                        compatible = "soc-nv-flash";
                        erase-block-size = < 0x1000 >;
                        write-block-size = < 0x4 >;
                        reg = < 0x0 0x100000 >;
                        partitions {
                            compatible = "fixed-partitions";
                            #address-cells = < 0x1 >;
                            #size-cells = < 0x1 >;
                            boot_partition: partition@0 {
                                label = "mcuboot";
                                reg = < 0x0 0x10000 >;
                            };
                            slot0_partition: partition@10000 {
                                label = "image-0";
                                reg = < 0x10000 0x40000 >;
                            };
                            slot0_ns_partition: partition@50000 {
                                label = "image-0-nonsecure";
                                reg = < 0x50000 0x30000 >;
                            };
                            slot1_partition: partition@80000 {
                                label = "image-1";
                                reg = < 0x80000 0x40000 >;
                            };
                            slot1_ns_partition: partition@c0000 {
                                label = "image-1-nonsecure";
                                reg = < 0xc0000 0x30000 >;
                            };
                            storage_partition: partition@f8000 {
                                label = "storage";
                                reg = < 0xf8000 0x8000 >;
                            };
                        };
                    };
                };
                kmu: kmu@39000 {
                    compatible = "nordic,nrf-kmu";
                    reg = < 0x39000 0x1000 >;
                    interrupts = < 0x39 0x1 >;
                    status = "okay";
                };
                vmc: vmc@81000 {
                    compatible = "nordic,nrf-vmc";
                    reg = < 0x81000 0x1000 >;
                    status = "okay";
                };
                gpio0: gpio@842500 {
                    compatible = "nordic,nrf-gpio";
                    gpio-controller;
                    reg = < 0x842500 0x300 >;
                    #gpio-cells = < 0x2 >;
                    status = "okay";
                    port = < 0x0 >;
                    gpiote-instance = < &gpiote >;
                    phandle = < 0x9 >;
                };
                gpio1: gpio@842800 {
                    compatible = "nordic,nrf-gpio";
                    gpio-controller;
                    reg = < 0x842800 0x300 >;
                    #gpio-cells = < 0x2 >;
                    ngpios = < 0x10 >;
                    status = "okay";
                    port = < 0x1 >;
                    gpiote-instance = < &gpiote >;
                    phandle = < 0xa >;
                };
                ieee802154: ieee802154 {
                    compatible = "nordic,nrf-ieee802154";
                    status = "okay";
                };
            };
            spu: spu@50003000 {
                compatible = "nordic,nrf-spu";
                reg = < 0x50003000 0x1000 >;
                interrupts = < 0x3 0x1 >;
                status = "okay";
            };
            gpiote: gpiote0: gpiote@5000d000 {
                compatible = "nordic,nrf-gpiote";
                reg = < 0x5000d000 0x1000 >;
                interrupts = < 0xd 0x5 >;
                status = "okay";
                instance = < 0x0 >;
                phandle = < 0xd >;
            };
            gpiote1: gpiote@4002f000 {
                compatible = "nordic,nrf-gpiote";
                reg = < 0x4002f000 0x1000 >;
                interrupts = < 0x2f 0x5 >;
                status = "disabled";
                instance = < 0x1 >;
            };
            cryptocell: crypto@50844000 {
                compatible = "nordic,cryptocell", "arm,cryptocell-312";
                reg = < 0x50844000 0x1000 >, < 0x50845000 0x1000 >;
                reg-names = "wrapper", "core";
                interrupts = < 0x44 0x1 >;
                status = "okay";
            };
        };
        pinctrl: pin-controller {
            compatible = "nordic,nrf-pinctrl";
            uart0_default: uart0_default {
                phandle = < 0x2 >;
                group1 {
                    psels = < 0x1d >;
                };
                group2 {
                    psels = < 0x1000024 >;
                    bias-pull-up;
                };
            };
            uart0_sleep: uart0_sleep {
                phandle = < 0x3 >;
                group1 {
                    psels = < 0x1d >, < 0x1000024 >;
                    low-power-enable;
                };
            };
            uart1_default: uart1_default {
                phandle = < 0x4 >;
                group1 {
                    psels = < 0x28 >;
                };
                group2 {
                    psels = < 0x1000026 >;
                    bias-pull-up;
                };
            };
            uart1_sleep: uart1_sleep {
                phandle = < 0x5 >;
                group1 {
                    psels = < 0x28 >, < 0x1000026 >;
                    low-power-enable;
                };
            };
            i2c2_default: i2c2_default {
                phandle = < 0x6 >;
                group1 {
                    psels = < 0xc000023 >, < 0xb000022 >;
                };
            };
            i2c2_sleep: i2c2_sleep {
                phandle = < 0x7 >;
                group1 {
                    psels = < 0xc000023 >, < 0xb000022 >;
                    low-power-enable;
                };
            };
            spi3_default: spi3_default {
                phandle = < 0xb >;
                group1 {
                    psels = < 0x4000008 >, < 0x5000009 >, < 0x600000a >;
                };
            };
            spi3_sleep: spi3_sleep {
                phandle = < 0xc >;
                group1 {
                    psels = < 0x4000008 >, < 0x5000009 >, < 0x600000a >;
                    low-power-enable;
                };
            };
        };
        rng_hci: entropy_bt_hci {
            compatible = "zephyr,bt-hci-entropy";
            status = "okay";
        };
        sw_pwm: sw-pwm {
            compatible = "nordic,nrf-sw-pwm";
            status = "disabled";
            generator = < &timer1 >;
            clock-prescaler = < 0x0 >;
            #pwm-cells = < 0x3 >;
        };
        cpus {
            #address-cells = < 0x1 >;
            #size-cells = < 0x0 >;
            cpu0: cpu@0 {
                device_type = "cpu";
                compatible = "arm,cortex-m33f";
                reg = < 0x0 >;
                #address-cells = < 0x1 >;
                #size-cells = < 0x1 >;
                itm: itm@e0000000 {
                    compatible = "arm,armv8m-itm";
                    reg = < 0xe0000000 0x1000 >;
                    swo-ref-frequency = < 0x3d09000 >;
                };
                mpu: mpu@e000ed90 {
                    compatible = "arm,armv8m-mpu";
                    reg = < 0xe000ed90 0x40 >;
                };
            };
        };
        ipc {
            ipc0: ipc0 {
                compatible = "zephyr,ipc-openamp-static-vrings";
                memory-region = < &sram0_shared >;
                mboxes = < &mbox 0x0 >, < &mbox 0x1 >;
                mbox-names = "tx", "rx";
                role = "host";
                status = "okay";
                bt_hci_ipc0: bt_hci_ipc0 {
                    compatible = "zephyr,bt-hci-ipc";
                    status = "okay";
                };
            };
        };
        leds {
            compatible = "gpio-leds";
            led0: led_0 {
                gpios = < &gpio0 0xe 0x0 >;
                label = "Red LED";
            };
            led1: led_1 {
                gpios = < &gpio0 0x1a 0x0 >;
                label = "Green LED";
            };
            led2: led_2 {
                gpios = < &gpio0 0xf 0x0 >;
                label = "Blue LED";
            };
        };
        buttons {
            compatible = "gpio-keys";
            button0: button_0 {
                gpios = < &gpio0 0x18 0x11 >;
                label = "Button 2";
            };
        };
        zephyr,user {
            button1-gpios = < &gpio1 0xf 0x16 >;
            short-range-rf-fe-enable-gpios = < &gpio0 0x12 0x1 >;
            reset-gpios = < &gpio1 0x7 0x0 >;
        };
        gpio_fwd: nrf-gpio-forwarder {
            compatible = "nordic,nrf-gpio-forwarder";
            status = "okay";
            uart {
                gpios = < &gpio0 0x16 0x0 >, < &gpio0 0x17 0x0 >, < &gpio0 0x14 0x0 >, < &gpio0 0x6 0x0 >;
            };
        };
        reserved-memory {
            #address-cells = < 0x1 >;
            #size-cells = < 0x1 >;
            ranges;
            sram0_image: image@20000000 {
                reg = < 0x20000000 0x70000 >;
            };
            sram0_s: image_s@20000000 {
                reg = < 0x20000000 0x40000 >;
            };
            sram0_ns: image_ns@20040000 {
                reg = < 0x20040000 0x30000 >;
            };
            sram0_shared: memory@20070000 {
                reg = < 0x20070000 0x10000 >;
                phandle = < 0xf >;
            };
        };
        sram0_ns@2007fc00 {
            compatible = "zephyr,memory-region", "mmio-sram";
            reg = < 0x2007fc00 0x400 >;
            zephyr,memory-region = "RetainedMem";
            status = "okay";
            retainedmem {
                compatible = "zephyr,retained-ram";
                status = "okay";
                #address-cells = < 0x1 >;
                #size-cells = < 0x1 >;
                boot_mode0: boot_mode@0 {
                    compatible = "zephyr,retention";
                    status = "okay";
                    reg = < 0x0 0x100 >;
                    prefix = [ 08 04 ];
                    checksum = < 0x1 >;
                };
            };
        };
        rtt0: rtt_chan0 {
            compatible = "segger,rtt-uart";
            status = "okay";
        };
        dp0 {
            compatible = "zephyr,swdp-gpio";
            status = "okay";
            clk-gpios = < &gpio0 0x19 0x0 >;
            dio-gpios = < &gpio0 0x1b 0x0 >;
            reset-gpios = < &gpio1 0x7 0x0 >;
            port-write-cycles = < 0xc >;
        };
        ramdisk0 {
            compatible = "zephyr,ram-disk";
            disk-name = "RAM";
            sector-size = < 0x200 >;
            sector-count = < 0x80 >;
        };
    };
    
    

    Do you see the same behavior, or does it work on your side?

    When I try to build your sample, i've got the following error : 

    -- Zephyr version: 3.7.99 (/free/zephyr), build: v3.7.99-ncs2-2
    [11/129] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
    FAILED: zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj 
    ccache //root/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DPICOLIBC_LONG_LONG_PRINTF_SCANF -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/free/zephyr/kernel/include -I/free/zephyr/arch/arm/include -I/free/zephyr/samples/drivers/jesd216/build/jesd216/zephyr/include/generated/zephyr -I/free/zephyr/include -I/free/zephyr/samples/drivers/jesd216/build/jesd216/zephyr/include/generated -I/free/zephyr/soc/silabs -I/free/zephyr/soc/silabs/common/. -I/free/zephyr/soc/silabs/silabs_s1/efr32mg12p -I/free/nrf/include -I/free/nrf/tests/include -I/free/modules/hal/cmsis/CMSIS/Core/Include -I/free/zephyr/modules/cmsis/. -isystem /free/zephyr/lib/libc/common/include -Os -DNDEBUG -fno-strict-aliasing -Os -imacros /free/zephyr/samples/drivers/jesd216/build/jesd216/zephyr/include/generated/zephyr/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=//root/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi -imacros /free/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/free/zephyr/samples/drivers/jesd216=CMAKE_SOURCE_DIR -fmacro-prefix-map=/free/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/free=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -fno-lto -MD -MT zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj -MF zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj.d -o zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj -c /free/zephyr/arch/arm/core/offsets/offsets.c
    In file included from /free/zephyr/modules/cmsis/./cmsis_core_m.h:24,
                     from /free/zephyr/modules/cmsis/./cmsis_core.h:10,
                     from /free/zephyr/include/zephyr/arch/arm/asm_inline_gcc.h:24,
                     from /free/zephyr/include/zephyr/arch/arm/asm_inline.h:18,
                     from /free/zephyr/include/zephyr/arch/arm/arch.h:30,
                     from /free/zephyr/include/zephyr/arch/cpu.h:19,
                     from /free/zephyr/include/zephyr/kernel_includes.h:36,
                     from /free/zephyr/include/zephyr/kernel.h:17,
                     from /free/zephyr/arch/arm/core/offsets/offsets_aarch32.c:28,
                     from /free/zephyr/arch/arm/core/offsets/offsets.c:9:
    /free/zephyr/soc/silabs/silabs_s1/efr32mg12p/soc.h:20:10: fatal error: em_common.h: No such file or directory
       20 | #include <em_common.h>
          |          ^~~~~~~~~~~~~
    compilation terminated.
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/jesd216-prefix/src/jesd216-stamp/jesd216-build /free/zephyr/samples/drivers/jesd216/build/_sysbuild/sysbuild/images/jesd216-prefix/src/jesd216-stamp/jesd216-build 
    cd /free/zephyr/samples/drivers/jesd216/build/jesd216 && /usr/bin/cmake --build .
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /free/zephyr/samples/drivers/jesd216/build

    Best regards, 

    Mathieu

  • Hello  ,

    I retried with the basic pm.yml file (without the external flash) and with exactly the same code (prj.conf, DTS, etc.). The app works perfectly.

    Are you sure there is no problem in partition.yml?

    Can the nRF5340 run if the Secondary_mucboot image is moved to external flash (if not how can I increase the app size)?

    Have you ever tried this?

    Bests regards,

Related