GL.iNet ar300m fails sysupgrade from initramfs

I am trying to move this router to generic OpenWrt.

I tried using the GL.iNet Luci upgrade. No change in the loaded firmware. (NCLF)

I tried using owut. NCLF

I tried replacing u-boot. NCLF

I tried tried scp'ing the upgrade file to /tmp/ and then sysupgrade. NCLF

I tried scp'ing the initramfs-kernel.bin to /tmp/ and then sysupgrade. This time it changed the running system to System running in recovery (initramfs) mode.

I again tried all the above (except u-boot) but still NCLF

What can I do to get the ar300m to take new software?

Thankyou for any help.

Did you try using a bootloader after updating it?

Yes, the only file that "seems" to go into the bootloader is the xxx-initramfs-kernel.bin. Since this gives the same result, I really can't tell if it's actually loading or not. I have a serial port connected and all other attempts end like this:

val is 2

** Device 0 not available
## Booting image at 9f050000 ...
Bad Magic Number

** Device 0 not available

dhcpd start
dhcpd timeout
HTTP server is starting at IP: 192.168.1.1
HTTP server is ready!
I really don't know what to do with it now except e-cycle it.

That is probably what bricked it.

The best way to install OpenWrt is to use the Uboot-WebUI... But you overwrote it by the sounds of it.

No, it's not that dead yet. I can still get the uboot screen asking for an image to load. It's just that no image except the afore mentioned xxx-initramfs-kernel.bin will load (if it even does). With that file loaded the router works, but does not store any settings. Every reboot is a fresh system awaiting configuration. But I must be able to do something, as when I tried loading the xxx-factory.img, I got a boot loop. Now I'm back to the initramfs-kernel.bin.

Did you update your u-boot with the binary from this page?

That's the file I try to put in, but it does not change the router. That u-boot file acts like all the other upgrade or whatever files I try to load. it simply does not go into the router. I have tried it several times now.

Did you use the correct web page to update the u-boot - http://192.168.1.1/uboot.html ?

Yes. But since I see no change, perhaps I'm just writing over the u-boot file time after time???

Here is the version info in the update file:

U-Boot 1.1.4-gf8f77125-dirty (Feb 15 2021 - 15:22:37)

Do you see anything like this on your router's bootloader screen?

"Bad Magic Number" usually tells about firmware mismatch. Make sure you use the right NOR or NAND binary.
From the wiki:

One can now use the hardware switch to change between booting NAND (position next to reset button) or NOR (away from reset button) after issuing the command

Missed this initially, but that situation is actually documented in the wiki:

You will notice that the router is running in safemode. In order to leave it, one must now flash a regular image factory or sysupgrade (e.g. glinet_gl-ar300m-nand-squashfs-factory.img) from shell or luci. After this second flash, the router will boot normally.

With the initramfs-kernel.img running the router, when I try to upgrade from the u-boot screen (which did confirm the u-boot "dirty" file with a slightly later date), I end up with a screen like this:

     #######################################
     #######################################
     ###############

open file: /flashing.html
stop eth interface!!
HTTP upload is done! Upgrading...


  • FIRMWARE UPGRADING *
  • DO NOT POWER OFF DEVICE! *

Executing: nand erase; nand write 0x80800000 0 0x8A0000

no devices available

no devices available

Error: HTTP ugrade failed!

HTTP server is starting at IP: 192.168.1.1
HTTP server is ready!

I'm particularly concerned about the "no devices available" which I've seen a lot.

... you don't need to use u-boot to upgrade, wiki says "shell or luci".

I have tried luci many times. What I do is load the initramfs file with u-boot, then run: apk luci to get a GUI, then try to upgrade using: openwrt-ath79-nand-glinet_gl-ar300m-nand-squashfs-sysupgrade.bin This fails.

I have tried by scp'ing this file: openwrt-25.12.0-ath79-nand-glinet_gl-ar300m-nand-squashfs-factory.img to /tmp/ and then running sysupgrade -n (and sometimes -F) that_file_name this also fails. I just don't seem to be able to write to the router.

Sometimes I see (on the serial terminal) and indication that the upgrade is going into the NOR flash rather than the NAND flash. I don't seem to be able to choose which one.

This is not the proper uboot screen, it looks like a generic terminal based uboot.

The built in Uboot-WebUI will look something like this:

It will vary slightly depending on ar300m version and age.

Do you know there are numerous versions of the ar300m?

Simplified:

  1. A dual boot nand/nor version (original and not been available for some years.
  2. A nor only version, still available

Which one is it? (Hint: Read the model number on the label on the bottom).
This is important, as the firmware will be different.

However, I think my first guess may have been correct - you overwrote the uboot and bricked it.
A bit like trashing the bios on a PC....

Initram is a special volatile firmware that brings up a very basic OpenWrt, all from effectively a ram-disk. It is intended for debugging purposes mostly and allows, in general, for the sysupgrade utility to be run.

If you are running initram, you are not running uboot, they are two completely different things.

This kind of implies you have some kind of uboot designed for flashing nand, but no nand devices are available.

You need to read that label on the back.....

The image I posted is what uboot should look like. It is not Luci.
The proper uboot for this device gives a WEB PAGE to allow reflashing.

If you do have the dual boot nand/nor version, the nand firmware is:
glinet_gl-ar300m-nand-squashfs-sysupgrade.bin

and the nor firmware is:
glinet_gl-ar300m-nor-squashfs-sysupgrade.bin

Yes, you have to use the uboot-webui to flash it twice.

Please read that label! because if it is the nor only version, the firmware is:
glinet_gl-ar300m16-squashfs-sysupgrade.bin

Unless it only has one ethernet port (rare) in which case there is yet another firmware to use...

Yes, I was using the wrong images. I bought an ar300M but the label on the
back says ar300M16 and that software works. I'm currently in the process of
configuring the router and it's all working after an upgrade to 25.12.4.

I was doing all the right things with the wrong image files

I'd mark this solved if I knew how.

Thank you so much for all your time.

Peter

I'm pretty sure the ar300m16 is the only version still available (in internal or external antenna options). The "16" refers to the size of the NOR flash ie 16MB.