Zyxel NWA55AXE '/etc/fw_env.config': No such file or directory

Hello,

after updating my Zyxel NWA55AXE to OpenWrt 25.12 it was not reachable anymore.

Now, I was using serial with `firstboot && reboot` and I got the following error:
```
[ 0.000000] MIPS: machine is Zyxel NWA55AXE
Cannot parse config file '/etc/fw_env.config': No such file or directory
Failed to find NVMEM device
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
Please press Enter to activate this console.
```

Could somebody help me to fix that problem? Thank you!

Can you post the output of

cat /proc/mtd
ubinfo -a

Thank you. Yes, sure.

cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00020000 "u-boot"
mtd1: 00080000 00020000 "u-boot-env"
mtd2: 00080000 00020000 "factory"
mtd3: 02800000 00020000 "firmware"
mtd4: 00800000 00020000 "kernel"
mtd5: 02000000 00020000 "ubi"
mtd6: 02800000 00020000 "zy_firmware_1"
mtd7: 01400000 00020000 "zy_rootfs_data"
mtd8: 00d00000 00020000 "zy_logs"
mtd9: 00480000 00020000 "myzyxel"
mtd10: 00080000 00020000 "bootconfig"
mtd11: 00080000 00020000 "mrd"
ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:256
Present UBI devices:            ubi0

ubi0
Volumes count:                           2
Logical eraseblock size:                 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks:     256 (32505856 bytes, 31.0 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  19
Current maximum erase counter value:     5
Minimum input/output unit size:          2048 bytes
Character device major/minor:            250:0
Present volumes:                         0, 1

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        38 LEBs (4825088 bytes, 4.6 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 250:1
-----------------------------------
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        195 LEBs (24760320 bytes, 23.6 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 250:2

Seeing this, I think the content of your /etc/fw_env.config should be

# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd1			0			0x80000		0x20000			4

But I'm not sure. Your uboot-env is huge, so maybe it's not completely used. Maybe 'Env. size' is 0x20000, and in that case 'Number of sectors' is 1.
You can check that by running fw_printenv when you created the file. If it doesn't complain about a wrong CRC, and prints out the u-boot env, the file is OK.

I created the file and I got:

fw_printenv
Warning: Bad CRC, using default environment
bootcmd=run distro_bootcmd
bootdelay=2
baudrate=115200
loadaddr=0x0
mtdids=
mtdparts=
bootm_size=0x10000000
eth6addr=02:00:11:22:33:47
ethaddr=02:00:11:22:33:44
fdt_addr_r=0xc00000
ipaddr=192.0.2.1
ipaddr2=192.0.2.3
ipaddr3=192.0.2.4
ipaddr5=192.0.2.6
ipaddr6=192.0.2.7
ipaddr7=192.0.2.8
kernel_addr_r=0x1000000
pxefile_addr_r=0x2000
ramdisk_addr_r=0x2000000
scriptaddr=0x1000
stderr=serial,vidconsole
stdin=serial
stdout=serial,vidconsole

Is the file OK?

Yes and no. fw_printenv reads the right environment, and it shows the MAC address, so possibly it solves your problem. But there is a CRC error, so the specified size/number of sectors is wrong.

Yes, this is annoying and shows up on a number of devices where '/etc/fw_env.config' doesn't exist. Or doesn't necessarily exist at the point this is running.

I believe the issue was introduced by

which added support for loading some OpenWrt defaults from the enviroment. The problem is that it calls fw_loadenv without any conditions or error silencing. And fw_loadenv runs fw_printenv, again without any conditions or stderr redirection:

let fp = fs.popen('fw_printenv');

So if '/etc/fw_env.config' doesn't exist, which is perfectly normal on lots of OpenWrt devices, you end up with those error messages being printed on the console.

Someone could create a patch to fix this. But it feels like doing the dirty dishes after someone elses party....

Thank you both so much so far!

What do I need to do now?
Can I do a workaround or do I need to wait for a fix?

Have you already rebooted to see if your problem is gone?

If I attach with serial, does it change something permanent?

Unless you are in 'failsafe', yes. It's just another way to get a shell on the router. In that case it's no different from an ssh shell.

I see, I just tried and have exactly the same error.

Cannot parse config file '/etc/fw_env.config': No such file or directory
Failed to find NVMEM device
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level

The file exist now:

cat /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size      Number of sectors
/dev/mtd1                       0                       0x80000         0x200004

I see. In that case @bmork was right:

Apparently the script is executed before the overlay, containing this file, is added to the rootfs. So you'd either wait for a fix, or create a firmware with this file included, using imagebuilder.

I understand. Thank you!

Is there a Github issue open already (nobody will fix it if nobody is aware of that)?

Note that this “error” is harmless and does not need fixing.
Your device should boot just fine.

you simply cannot use fw_printenv to read the bootloader config partition, as this is not configured in the image.
As you do not want or need to adjust the bootloader env typically, this does not have any drawback.

If you would prepare this and use `fw_setenv` the device would misconfigure its bootloader and fail to boot afterwards: https://github.com/openwrt/openwrt/pull/23183#issuecomment-4362227921
So, just ignore this :slight_smile:

I don’t understand, why is it harmless and how can ignore it?

I can only connect via serial to my Zyxel… anything on LAN doesnt work at all. It is completely useless atm.

This may be related to your actual error - the kernel not finding the actual firmware - but your stripped your boot log, so there's no telling. Post a full boot log.

@phqzgunsfjror if your device does not boot, it would be good to share the whole `dmesg` or `logread` output. These few lines do not mean that something is wrong - well working NWA55AXE have the same message.

Post a full boot log.

Ah Okay. I see.

U-Boot SPL 2018.09 (Jan 22 2021 - 07:42:43 +0000)
Trying to boot from NAND

Initializing NMBM ...
Signature found at block 1023 [0x07fe0000]
First info table with writecount 0 found in block 960
Second info table with writecount 0 found in block 963
NMBM has been successfully attached


U-Boot 2018.09 (Jan 22 2021 - 07:42:43 +0000)

CPU:   MediaTek MT7621AT ver 1, eco 3
Clocks: CPU: 880MHz, DDR: 600MHz (1200MT/s), Bus: 220MHz, XTAL: 40MHz
Model: MediaTek MT7621 reference board (NAND)
DRAM:  256 MiB
NAND:  128 MiB

Initializing NMBM ...
Signature found at block 1023 [0x07fe0000]
First info table with writecount 0 found in block 960
Second info table with writecount 0 found in block 963
NMBM has been successfully attached

Loading Environment from NMBM... OK
In:    uartlite0@1e000c00
Out:   uartlite0@1e000c00
Err:   uartlite0@1e000c00
Net:   
Warning: eth@1e100000 (eth0) using random MAC address - <escaped>
eth0: eth@1e100000
Reading from 0x7700000, size 0x20000
Succeeded
Zyxel version:V1.03
gpio: pin 6 (gpio 6) value is 1
gpio: pin 24 (gpio 24) value is 0
gpio: pin 24 (gpio 24) value is 1
Hit any key to stop autoboot:  0 
Loading FIT image at offset 0x180000 to memory 0x83000000, size 0x32a478 ...
Automatic boot of image at addr 0x83000000 ...
## Loading kernel from FIT Image at 83000000 ...
   Using 'config-1' configuration
   Trying 'kernel-1' kernel subimage
     Description:  MIPS OpenWrt Linux-6.12.74
     Type:         Kernel Image
     Compression:  lzma compressed
     Data Start:   0x830000e4
     Data Size:    3304632 Bytes = 3.2 MiB
     Architecture: MIPS
     OS:           Linux
     Load Address: 0x80001000
     Entry Point:  0x80001000
     Hash algo:    crc32
     Hash value:   34570db2
     Hash algo:    sha1
     Hash value:   aad027f3f42f1596cad1c5e7013b42153366cd2e
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading fdt from FIT Image at 83000000 ...
   Using 'config-1' configuration
   Trying 'fdt-1' fdt subimage
     Description:  MIPS OpenWrt zyxel_nwa55axe device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x83326edc
     Data Size:    12888 Bytes = 12.6 KiB
     Architecture: MIPS
     Hash algo:    crc32
     Hash value:   3de2bc02
     Hash algo:    sha1
     Hash value:   068b01ff8882f79b47d85e82df27e52bf000664a
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x83326edc
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 8fe67000, end 8fe6d257 ... OK
[    0.000000] Linux version 6.12.74 (builder@buildhost) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 14.3.0 r32802-f505120278) 14.3.0, GNU ld (GNU Binutils) 2.44) #0 SMP Wed Mar 25 20:09:53 2026
[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[    0.000000] printk: legacy bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    0.000000] MIPS: machine is Zyxel NWA55AXE
Cannot parse config file '/etc/fw_env.config': No such file or directory
Failed to find NVMEM device
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level

And then the console just hangs, pressing enter on the attached serial does nothing?

Can you please describe the behavior you are seeing more.

You told us in the inital report, that you did throw away the config with “firstboot”. So it should be a completely fresh device now?

What is the failure state?

Can you run “uci show network”?