Updated u-boot for AR300M not booting OSes

Hi,
I tried to update u-boot in my GL-AR300M-Ext so I can use physical switch to boot nor firmware.
Someone here told me to use this one.
I flashed it (twice actually - once from OWRT, once from u-boot’s httpd) and it doesn’t allow me to boot any OS - tried OWRT official build and GL-iNet official builds for both memories, nor and nand.
It allows me to flash backup u-boot back through httpd, and then I again can boot both firmwares (by changing bootcount to 3) but I can’t use physical (even after setting boot_dev to on) switch to change booting firmware.

Can anyone supply working u-boot?

You probably need to mark your’s as tested for whatever reason like I did. If your device is just booting to the uboot prompt there will be an error at the bottom:

Device have calibrated,Checking device test status...
Device haven't tested. Please test device in calibration firmware...
Booting image at: 0x9Fed0000
## Booting image at 9fed0000 ...
Bad Magic Number

You can boot manually to nand by running run bootcmd or to nor with run altbootcmd

See the thread here to mark device as tested and get the switch to work:

Is it possible to set it from inside firmware?
I don’t have access to u-boot console.

So it does boot NAND by default? Then you don’t seem to need to mark it as tested.

The other problem is the switch has three positions as mentioned in the other thread. The code in this uboot got changed to make the switch position that is blocked when the case is on to select one of the firmwares. You have to file the case to allow the switch to slide to the other position. See the thread I listed for the details.

It doesn’t load any firmware, I just fallen back to backup u-boot and can change env from firmware after flashing new u-boot and before rebooting :wink:

There is no backup u-boot. Only one. There is no netconsole. You would need serial console to see if you are getting the error message about marking the device as tested and to run the commands.

Sorry to say. Get a CP21xx based UART with USB. It seems people have problems with FTDI based boards and this device.

When saying backup u-boot, I mean old, backed up u-boot, which I’ve flashed back.

@juniorjpdj please post the console output of uboot. Otherwise no way to tell what is the problem.

@nopro404 the “tested” flag is not in uboot, nor uboot env. It is in art mtd.

@alzhao thanks for that info - I’m unsure how mine would have been changed then for it required to be tested again after flashing the new u-boot.

Is there something preventing enabling netconsole in the u-boot compile for the ar300m?

We just didn’t test netconsole and didn’t put it in the development task.

Yes, I also had problem with “not tested device”.
I’ve bought TTL USB adapter as @alzhao told me to and fixed problem like in thread @nopro404 linked.

New u-boot still doesn’t permit me to boot nor firmware by moving switch. When I do this without case (toggling to 3rd position, not 2nd) it works good. I was sure you guys fixed it in new u-boot…

Then this seems a damaged switch button.

I just flashed original firmware to test if it is working.
It works good, It changes my wifi settings like a charm, but I still can’t use it to select from which memory to boot.

yeah the new uboot had the switch positions reversed as mentioned in another thread.

What does mean “switch positions reversed”?

The thread I linked to above had all of the information.

Here it is again:

It seems the Uboot code was updated and reversed the switch position - this is the code and binary that is on the Github page. @alzhao must have privately reversed the problem and recompiled it to work correctly, but not updated the github repo. So it is still reversed in the binary that is publicly available.

With the router case on the switch can be in positions 3 or 2 (middle) which only boot to NAND, position 1 will boot to NOR but that can only but attained by removing the case or filing the case down to allow the switch to get to the 1st position.

I’m on the same boat. Flashed the uboot bin from github repo and now switch only boots from nor when in right position, which is not possible if the board is inside the case.

Does anyone have a copy of the fixed uboot? There seems to be no file attachment in the linked post of @alzhao. Maybe @nopro404?

There is progress going here: AR-300m upgrade uboot to newer verions - #47 by alzhao

Yep, got in contact with GL-iNet 2 weeks ago and they released a fixed uboot today.
Just flash and set fw_setenv boot_dev on, now it works.