I have an OpenWRT One and it has been running fine for months. Then a couple of days ago it failed to reboot. It was giving the error 'BL2: Failed to load image id 5 (-2)'.
So I have been trying to re-flash it. I won't bother you all with the failures (I've gone through several USB sticks to find one that works, figured out how to run a TFTP server, run mtk_uartboot and learned a bunch in the process). I believe I have flashed 25.12.4 to both the NOR and NAND storage, and I've done multiple resets so there's no data on the device to worry about.
But it still fails to boot. This time the error is similar but slightly different:
ERROR: io_dev_init failed for FIP image id 0 (-22)
ERROR: Image id 3 open failed with -22
ERROR: BL2: Failed to load image id 3 (-22)
The full console when booting NAND is:
NOTICE: BL2: v2.13.0(release):OpenWrt v2025.07.11~78a0dfd9-1 (mt7981-spim-nand-ubi-ddr4)
NOTICE: BL2: Built : 22:42:09, May 13 2026
NOTICE: WDT: Cold boot
NOTICE: WDT: disabled
NOTICE: EMI: Using DDR4 settings
NOTICE: EMI: Detected DRAM size: 1024MB
NOTICE: EMI: complex R/W mem test passed
NOTICE: CPU: MT7981 (1300MHz)
NOTICE: SPI_NAND parses attributes from parameter page.
NOTICE: SPI_NAND Detected ID 0xef
NOTICE: Page size 2048, Block size 131072, size 268435456
NOTICE: UBI: scanning [0x100000 - 0x10000000] ...
NOTICE: UBI: EOF marker found in block 173
NOTICE: UBI: scanning is finished
NOTICE: UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
NOTICE: UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
ERROR: io_dev_init failed for FIP image id 0 (-22)
ERROR: Image id 3 open failed with -22
ERROR: BL2: Failed to load image id 3 (-22)
I don't know what the error means or how to fix it.
One thing that may be important: bad blocks when flashing. Here's the full log of flashing NAND from USB:
on
starting USB...
xhci-mtk xhci@11200000: hcd: 0x0000000011200000, ippc: 0x0000000011203e00
xhci-mtk xhci@11200000: ports disabled mask: u3p-0x1, u2p-0x0
xhci-mtk xhci@11200000: u2p:1, u3p:1
Register 200010f NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus xhci@11200000: 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
238440 bytes read in 16 ms (14.2 MiB/s)
Erasing 0x00000000 ... 0x000fffff (8 eraseblock(s))
Writing 262144 byte(s) (128 page(s)) at offset 0x00000000
Writing 262144 byte(s) (128 page(s)) at offset 0x00040000
Writing 262144 byte(s) (128 page(s)) at offset 0x00080000
23330816 bytes read in 912 ms (24.4 MiB/s)
Erasing 0x00000000 ... 0x0fefffff (2040 eraseblock(s))
Skipping bad block at 0x04340000
Skipping bad block at 0x04360000
Skipping bad block at 0x0c440000
Skipping bad block at 0x0ddc0000
Skipping bad block at 0x0e5e0000
Writing 23330816 byte(s) (11392 page(s)) at offset 0x00000000
done
I have tried erasing the NAND storage using dontskipbad, and here is the result:
OpenWrt One> mtd erase.dontskipbad spi-nand0
Erasing 0x00000000 ... 0x0fffffff (2048 eraseblock(s))
nand: attempt to erase a bad/reserved block @4440000
nand: attempt to erase a bad/reserved block @4460000
nand: attempt to erase a bad/reserved block @c540000
nand: attempt to erase a bad/reserved block @dec0000
nand: attempt to erase a bad/reserved block @e6e0000
So, while I've learned some things I don't think I really understand the problem or how to fix it. Are the bad blocks interfering with the flash and boot process? Is the hardware failing? Is there more diagnosis I can do? Or something else to try? Have I done something wrong with the flashing somehow?