Trying to do DFU on nRF5340 development kit with external flash MX66L1G

Build environment is the nRF SDK Connect for VS Code extension with ncs 2.3.0.

I am trying to accomplish DFU over UART with mcumgr serial console in which primary slot will in internal flash of the development kit and secondary slot is in external flash MX66L1G. I am using static configuration for partition region using partition manager. The sample on which I am working is ncs\v2.3.0\zephyr\samples\subsys\mgmt\mcumgr\smp_svr 

Here is my pm_static.yml file and prj.conf 

EMPTY_0:
  address: 0xf000
  end_address: 0x11000
  placement:
    before:
    - mcuboot_pad
  region: flash_primary
  size: 0x2000
app:
  address: 0x11200
  end_address: 0x101000
  region: flash_primary
  size: 0xefe00
mcuboot:
  address: 0x0
  end_address: 0xf000
  placement:
    before:
    - mcuboot_primary
  region: flash_primary
  size: 0xf000
mcuboot_pad:
  address: 0x11000
  end_address: 0x11200
  placement:
    align:
      start: 0x8000
    before:
    - mcuboot_primary_app
  region: flash_primary
  size: 0x200
mcuboot_primary_app:
  address: 0x11200
  end_address: 0x101000
  orig_span: &id002
  - app
  region: flash_primary
  size: 0xefe00
  span: *id002
mcuboot_primary:
  address: 0x11000
  end_address: 0x101000
  orig_span: &id001
  - app
  - mcuboot_pad
  region: flash_primary
  size: 0xf0000
  span: *id001
mcuboot_secondary:
  address: 0x0
  device: DT_CHOSEN(nordic_pm_ext_flash)
  end_address: 0xf0000
  region: external_flash
  share_size:
  - mcuboot_primary
  size: 0xf0000
mcuboot_secondary_app:
  address: 0x0
  end_address: 0xefe00
  orig_span: &id003
  - app
  region: external_flash
  size: 0xefe00
  span: *id003
EMPTY_1:
  address: 0xf0000
  end_address: 0x8000000
  region: external_flash
  size: 0x7f10000
sram_primary:
  address: 0x20000000
  end_address: 0x20020000
  region: sram_primary
  size: 0x20000
# Enable the shell mcumgr transport.
CONFIG_SHELL=y
CONFIG_SHELL_BACKEND_SERIAL=y
CONFIG_MCUMGR_SMP_SHELL=y

# mcumgr-cli application doesn't accepts log in the channel it uses
CONFIG_SHELL_LOG_BACKEND=n

# Enable shell commands.
CONFIG_MCUMGR_CMD_SHELL_MGMT=y

#Enable MCUboot
CONFIG_BOOTLOADER_MCUBOOT=y

# Enable mcumgr.
CONFIG_MCUMGR=y

#Enable flash operations.
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_FPROTECT=y

# Enable most core commands.
CONFIG_MCUMGR_CMD_IMG_MGMT=y

# Enable logging
CONFIG_LOG=y
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_DBG=y

# Disable debug logging
CONFIG_LOG_MAX_LEVEL=4

# DRivers enabled 
CONFIG_SPI=y

#Place MCUboot secondary in external flash
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y

CONFIG_NORDIC_QSPI_NOR=y

# Ensure an MCUboot-compatible binary is generated.
CONFIG_IMG_ERASE_PROGRESSIVELY=y

CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

I have also created mcuboot.conf and mcuboot.overlay

/* Step 3.5 - Configure button and LED for Serial Recovery */

/{
  aliases {
		mcuboot-button0 = &button1;
		mcuboot-led0 = &led1;
    };
};

These are the errors which I am facing while flashing the mcuboot

I am taking reference for DFU over UART from this link of Dev Academy Exercise 1 - DFU over UART - Nordic Developer Academy (nordicsemi.com)

Overlay file for the hardware nrf5340dk_nrf5340dk_cpuapp.overlay

 

Please help me figure out what is missing in this whole configuration and why am I getting these errors and warnings.

  • Hi Abhijith,

    I have checked the physical connections with the help of logic analyzer they are correct as per my understanding. And now I have also verified the sfdp-bfp values. But now before the boot when the kernel does the entry level device initialization it is getting failed for this serial flash.

    I am getting an error [00:00:00.253,173] <err> qspi_nor: JEDEC id [00 00 00] expect [c2 20 1b]

    These are the logs:

    init clock@5000: 0
    init gpio@842500: 0
    init gpio@842800: 0
    init uart@8000: 0
    z_device_is_ready: uart@8000
    z_device_is_ready: initialized=1, init_res=0
    init mbox@2a000: 0
    Initializing QSPI NOR flash
    dev: 0xa084
    Sending RDID command
    res: 195887104
    Received JEDEC ID: [00 00 00]
    [00:00:00.252,929] <err> qspi_nor: JEDEC id [00 00 00] expect [c2 20 1b]
    qspi_init: -19
    init mx66l1g45g@0: 19
    init flash-controller@39000: 0
    z_device_is_ready: gpio@842800
    z_device_is_ready: initialized=1, init_res=0
    init spi@a000: 0
    *** Booting nRF Connect SDK 3758bcbfa5cd ***
    z_device_is_ready: mx66l1g45g@0
    z_device_is_ready: initialized=1, init_res=19
    mx66l1g45g@0: device not ready.

    Thanks
    Radhika

  • Hello Radhika,

    The error message (-19, "No such device") and the log referencing JEDEC ID 0, which suggests that the QSPI device may not be connected or powered correctly. Could you please provide details on how the device is powered and specify the exact pins being used for QSPI? Although the overlay references default and qspi_sleep, it would be helpful to confirm the exact pins in use. Additionally, if you have access to a logic analyzer, probing the SPI pins might offer further insights into the issue.

    Kind Regards,

    Abhijith

Related