nRF54L15 + MCUboot + mx25r64 with SQSPI : Failed to open flash area on mx25r64.

Hello

I  tried to test OTA function with smp_svr example.

I want to use the external flash mx25r64 on nrf54l15-dk(v0.9.3) to store update Firmware over BLE.  SDK version 3.2.0 was used.

The driver and dts for mcuboot was configured with "sysbuild\mcuboot.conf", "sysbuild\mcuboot.overlay".

partitions manager was used with "pm_static.yml".

Before mcuboot start, mspi and flash driver was loaded correctly. 

Then mcuboot to read seconed image slot on external flash failed. could you give some advice for this issue?

The source code is attached below.

2046.smp_svr.zip

Parents
  • Hello,

    Please try adding SB_CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y to the sysbuild.conf file. This should enable the bootloader to access the secondary slot using the MSPI NOR driver without the -ENOENT error. 

    Best regards,

    Vidar

  • Hello,

    Thanks for quick help.

    This configuration has indeed taken the program one step forward, but the image check reports a new "slot sectors" error.

    Are there any other configuration items related to partition?

    partition manager file was attached below.

    pm_static.yaml

    app:
      address: 0x20800
      end_address: 0x163000
      region: flash_primary
      size: 0x142800
    bootconf:
      address: 0xffd080
      end_address: 0xffd084
      region: bootconf
      size: 0x4
    littlefs_storage:
      address: 0x143000
      device: DT_CHOSEN(nordic_pm_ext_flash)
      end_address: 0x800000
      placement:
        before:
        - end
      region: external_flash
      size: 0x6bd000
    settings_storage:
      address: 0x163000
      end_address: 0x165000
      placement:
        align:
          start: 0x1000
      region: flash_primary
      size: 0x2000
    mcuboot:
      address: 0x0
      end_address: 0x20000
      placement:
        align:
          end: 0x1000
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0x20000
    mcuboot_pad:
      address: 0x20000
      end_address: 0x20800
      placement:
        align:
          start: 0x1000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x800
    mcuboot_primary:
      address: 0x20000
      end_address: 0x163000
      orig_span: &id001
      - mcuboot_pad
      - app
      region: flash_primary
      size: 0x143000
      span: *id001
    mcuboot_primary_app:
      address: 0x20800
      end_address: 0x163000
      orig_span: &id002
      - app
      region: flash_primary
      size: 0x142800
      span: *id002
    mcuboot_secondary:
      address: 0x000000
      device: DT_CHOSEN(nordic_pm_ext_flash)
      end_address: 0x143000
      placement:
        align:
          start: 0x4
      region: external_flash
      share_size:
      - mcuboot_primary
      size: 0x143000
    otp:
      address: 0xffd500
      end_address: 0xffd9fc
      region: otp
      size: 0x4fc
    sram_primary:
      address: 0x20000000
      end_address: 0x2003c000
      region: sram_primary
      size: 0x3c000
    

  • Hello,

    Please also add CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE=4096 to your mcuboot and application project configuration to ensure the sector size matches the sector size used in internal memory.

Reply Children
  • Thanks for your help.

    when CONFIG_FLASH_MSPI_NOR_LAYOUT_PAGE_SIZE=4096 was added to mcuboot and app configuration, mcuboot stop at "I: Jumping to the first image slot".


    Does it means image in slot-0 is invalid when image magic is bad checked by mcuboot.

    Is there any other configuration for image need to be set?

  • Hi,

    I was able to reproduce the same here and it turns it was the same problem reported in this thread: nRF54L15 + MCUboot + External flash with SQSPI: VPR problems causing the application code to hang on startup. However, patching the sqspi driver as suggested in that thread did not work for me. Instead I had to modify the bootloader code to reset VPR before branching to the app:

    diff --git a/boot/zephyr/nrf_cleanup.c b/boot/zephyr/nrf_cleanup.c
    index c1e5a178..e7f49289 100644
    --- a/boot/zephyr/nrf_cleanup.c
    +++ b/boot/zephyr/nrf_cleanup.c
    @@ -22,6 +22,11 @@
     #if defined(NRF_DPPIC)
         #include <hal/nrf_dppi.h>
     #endif
    +#if defined(CONFIG_MSPI_NRF_SQSPI)
    +    #include <hal/nrf_vpr.h>
    +    #include <../../nrfxlib/softperipheral/include/softperipheral_regif.h>
    +#endif
    +
     
     #include <string.h>
     
    @@ -111,6 +116,24 @@ static void nrf_cleanup_clock(void)
     }
     #endif
     
    +#if defined(CONFIG_MSPI_NRF_SQSPI)
    +static void nrf_cleanup_sqspi(void) 
    +{
    +    nrf_vpr_cpurun_set(NRF_VPR, false);
    +
    +    // Reset VPR.
    +    nrf_vpr_debugif_dmcontrol_mask_set(NRF_VPR,
    +                                       (VPR_DEBUGIF_DMCONTROL_NDMRESET_Active
    +                                        << VPR_DEBUGIF_DMCONTROL_NDMRESET_Pos |
    +                                        VPR_DEBUGIF_DMCONTROL_DMACTIVE_Enabled
    +                                        << VPR_DEBUGIF_DMCONTROL_DMACTIVE_Pos));
    +    nrf_vpr_debugif_dmcontrol_mask_set(NRF_VPR,
    +                                       (VPR_DEBUGIF_DMCONTROL_NDMRESET_Inactive
    +                                        << VPR_DEBUGIF_DMCONTROL_NDMRESET_Pos |
    +                                        VPR_DEBUGIF_DMCONTROL_DMACTIVE_Disabled
    +                                        << VPR_DEBUGIF_DMCONTROL_DMACTIVE_Pos));
    +}
    +#endif
     void nrf_cleanup_peripheral(void)
     {
     #if defined(NRF_RTC0)
    @@ -123,6 +146,10 @@ void nrf_cleanup_peripheral(void)
         nrf_cleanup_rtc(NRF_RTC2);
     #endif
     
    +#if defined(CONFIG_MSPI_NRF_SQSPI)
    +    nrf_cleanup_sqspi();
    +#endif 
    +
     #if defined(CONFIG_NRF_GRTC_TIMER)
         nrf_cleanup_grtc();
     #endif
    
     

    Could you please try applying the the same change on your end?

  • Thanks for confirming that it worked. I have reported the issues found here internally so we can improve the sQSPI support in the bootloader.

Related