nrfutil device program: external flash on nRF54H20 EXMIF loses last byte of every page program with MODE32BIT (MODE24BIT OK)

Hi,

On a custom nRF54H20 board, nrfutil device program with --x-ext-mem-config-file drops the last byte of every page-program command when address_mode is MODE32BIT. The same setup with MODE24BIT programs and verifies correctly.

Setup

  • nRF54H20, IronSide SE 23.8.0+33, LCS RoT
  • SEGGER Flasher Compact (J-Link DLL 9.78)
  • nrfutil-device 2.21.0 and 2.23.3, both behave the same
  • External flash: Macronix MX25U25672G (32 MB, 1.8 V) on EXMIF, single-line, the same pins as the nRF54H20 DK
  • The flash supply is held on in hardware during programming, so it doesn't depend on any GPIO through nrfutil's reset

Config (MODE32BIT, fails):

{
  "firmware_config": { "peripheral": "EXMIF", "compress": true },
  "pins": {
    "sck": 192, "csn": 195, "reset": 4294967295, "read_write_data_strobe": 4294967295,
    "io0": 199, "io1": 197, "io2": 4294967295, "io3": 4294967295,
    "io4": 4294967295, "io5": 4294967295, "io6": 4294967295, "io7": 4294967295
  },
  "flash_size": 33554432,
  "sck_frequency": 8000000,
  "address_mode": "MODE32BIT",
  "page_size": 4096,
  "io_pin_impedance": 63
}

The MODE24BIT config is identical except for "flash_size": 16777216 and "address_mode": "MODE24BIT".

Command (the hex is 16 KiB of random data at 0x60100000):

nrfutil device --x-ext-mem-config-file cfg.json program --firmware pattern.hex --core Application \
  --options chip_erase_mode=ERASE_NONE,ext_mem_erase_mode=ERASE_RANGES_TOUCHED_BY_FIRMWARE,verify=VERIFY_READ

Results (same board, same address 0x100000, board power-cycled before each run):

address_mode Result
MODE32BIT Verify fails: Mismatch in verification at address 0x601000ff, memory is 255 while segment is 29
MODE24BIT Programs and verifies OK. A full readback of all 16384 bytes matches

Which bytes are lost with MODE32BIT (full 16 KiB readback with nrfutil device read):

  • Exactly 68 bytes stay at 0xFF, and every other byte is correct.
  • 64 of them are byte 255 of every 256-byte page.
  • The other 4 are the last byte of each 4068-byte chunk that nrfutil sends its loader. The log shows Compressed data is larger than original, 4085 > 4068, and the lost offsets are 4067, 8135, 12203 and 16271.
  • So the last byte of every page-program command is lost. It looks like a transfer-length off-by-one on the 4-byte-address path.

Also tried with MODE32BIT, all with the identical loss:

  • sck_frequency 4 MHz
  • io2/io3 assigned (P6.10/P6.09)
  • offset 0x1674000 instead of 0x100000

The flash itself works in 4-byte mode. The Zephyr flash_mspi_nor driver (single I/O, use-4byte-addressing) writes across a page boundary and reads back correctly on the same board. Its reads also confirm that the bytes nrfutil lost were never written: they read 0xFF there too.

Questions:

  1. Can you reproduce this on nRF54H20 EXMIF with a flash larger than 16 MB in MODE32BIT?
  2. Is a fix planned, and is there a workaround to program above 16 MB with nrfutil in the meantime?

Trace logs for both runs (--log-level trace) and both configs are attached.

program-32lo.logprogram-24bit.log

{
  "firmware_config": {
    "peripheral": "EXMIF",
    "compress": true
  },
  "pins": {
    "sck": 192,
    "csn": 195,
    "reset": 4294967295,
    "read_write_data_strobe": 4294967295,
    "io0": 199,
    "io1": 197,
    "io2": 4294967295,
    "io3": 4294967295,
    "io4": 4294967295,
    "io5": 4294967295,
    "io6": 4294967295,
    "io7": 4294967295
  },
  "flash_size": 33554432,
  "sck_frequency": 8000000,
  "address_mode": "MODE32BIT",
  "page_size": 4096,
  "io_pin_impedance": 63
}
{
  "firmware_config": {
    "peripheral": "EXMIF",
    "compress": true
  },
  "pins": {
    "sck": 192,
    "csn": 195,
    "reset": 4294967295,
    "read_write_data_strobe": 4294967295,
    "io0": 199,
    "io1": 197,
    "io2": 4294967295,
    "io3": 4294967295,
    "io4": 4294967295,
    "io5": 4294967295,
    "io6": 4294967295,
    "io7": 4294967295
  },
  "flash_size": 16777216,
  "sck_frequency": 8000000,
  "address_mode": "MODE24BIT",
  "page_size": 4096,
  "io_pin_impedance": 63
}

Related