AR-300m upgrade uboot to newer verions

@alzhao

Hi, with the new uboot the router starts every time from NOR…

I have tried:

  • setenv bootcount 0/3–> starts from Nor

  • setenv boot_dev on –> moved the switch left/right –> starts from Nor

Also, if the LAN and the tftp server is up, the uboot enter in infinite loop searching “openwrt-gl-ar300m.bin” file.

///////////////////////////////////////////////////

U-Boot 1.1.4-g36de7573 (Mar 15 2017 - 14:57:45)

DRAM: 128 MB

Nor Flash: 16 MB, sector count = 256

*** Warning *** : PCIe WLAN Module not found !!!

NAND Flash: 128 MB, page size = 0x800 block size = 0x20000 oob size = 0x80

Protect off 9F040000 … 9F04FFFF

Un-Protecting sectors 4…4 in bank 1

Un-Protected 1 sectors

Erasing Flash…Erasing flash…

First 0x4 last 0x4 sector size 0x10000

<0x08><0x08><0x08><0x08> 4

Erased 1 sectors

Writing to Flash… write addr: 9f040000

done

Protecting sectors 4…4 in bank 1

Protected 1 sectors

Un-Protect Flash Bank # 1

Hit any key to stop autoboot: 1 <0x08><0x08><0x08>-99

Device 0 bad blocks:

06000000

07fe0000

Found ART,Checking calibration status…

Device have calibrated,Checking device test status…

Device haven’t tested. Please test device in calibration firmware…

Trying eth0

eth0 link down

FAIL

Trying eth1

enet1 port0 up

dup 1 speed 1000

Using eth1 device

host 192.168.1.2 is alive

Trying eth0

eth0 link down

FAIL

Trying eth1

Using eth1 device

TFTP from server 192.168.1.2; our IP address is 192.168.1.1

Filename ‘openwrt-gl-ar300m.bin’.

Load address: 0x80010000

Loading: *<0x08>

Abort

Device 0 bad blocks:

06000000

07fe0000

Trying eth0

eth0 link down

FAIL

Trying eth1

Using eth1 device

TFTP from server 192.168.1.2; our IP address is 192.168.1.1

Filename ‘openwrt-gl-ar300m-ubi.img’.

Load address: 0x80010000

Loading: *<0x08>

Abort

Device 0 bad blocks:

06000000

07fe0000

Loading from device 0: ath-spi-nand (offset 0x0)

** Bad Magic Number 0xffffffff **

Booting image at 9f050000 …

Image Name: MIPS OpenWrt Linux-3.18.27

Created: 2016-09-12 10:05:32 UTC

Image Type: MIPS Linux Kernel Image (lzma compressed)

Data Size: 1181639 Bytes = 1.1 MB

Load Address: 80060000

Entry Point: 80060000

Verifying Checksum at 0x9f050040 …OK

Uncompressing Kernel Image … OK

No initrd

Transferring control to Linux (at address 80060000) …

Giving linux memsize in bytes, 134217728

Starting kernel …

[ 0.000000] Linux version 3.18.27 (alzhao@alzhao-ubuntu) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r47065) ) #1 Mon Sep 12 18:05:15 HKT 2016

[ 0.000000] bootconsole [early0] enabled

[ 0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)

[ 0.000000] SoC: Qualcomm Atheros QCA9533 ver 2 rev 0

[ 0.000000] Determined physical RAM map:

[ 0.000000] memory: 08000000 @ 00000000 (usable)

[ 0.000000] Initrd not found or empty - disabling initrd

//////////////////////////////////////////////////////

With the TFTP server active:

//////////////////////////////////////////

U-Boot 1.1.4-g36de7573 (Mar 15 2017 - 14:57:45)

DRAM: 128 MB

Nor Flash: 16 MB, sector count = 256

*** Warning *** : PCIe WLAN Module not found !!!

NAND Flash: 128 MB, page size = 0x800 block size = 0x20000 oob size = 0x80

Protect off 9F040000 … 9F04FFFF

Un-Protecting sectors 4…4 in bank 1

Un-Protected 1 sectors

Erasing Flash…Erasing flash…

First 0x4 last 0x4 sector size 0x10000

<0x08><0x08><0x08><0x08> 4

Erased 1 sectors

Writing to Flash… write addr: 9f040000

done

Protecting sectors 4…4 in bank 1

Protected 1 sectors

Un-Protect Flash Bank # 1

Hit any key to stop autoboot: 1 <0x08><0x08><0x08>-99

Device 0 bad blocks:

06000000

07fe0000

Found ART,Checking calibration status…

Device have calibrated,Checking device test status…

Device haven’t tested. Please test device in calibration firmware…

Trying eth0

eth0 link down

FAIL

Trying eth1

enet1 port0 up

dup 1 speed 1000

Using eth1 device

host 192.168.1.2 is alive

Trying eth0

eth0 link down

FAIL

Trying eth1

Using eth1 device

TFTP from server 192.168.1.2; our IP address is 192.168.1.1

Filename ‘openwrt-gl-ar300m.bin’.

Load address: 0x80010000

Loading: *<0x08>

TFTP error: ‘file /mnt/hdext/openwrt-gl-ar300m.bin not found’ (1)

Starting again

Trying eth0

eth0 link down

FAIL

Trying eth1

Using eth1 device

TFTP from server 192.168.1.2; our IP address is 192.168.1.1

Filename ‘openwrt-gl-ar300m.bin’.

Load address: 0x80010000

Loading: *<0x08>

TFTP error: ‘file /mnt/hdext/openwrt-gl-ar300m.bin not found’ (1)

Starting again

Trying eth0

eth0 link down

FAIL

Trying eth1

Using eth1 device

TFTP from server 192.168.1.2; our IP address is 192.168.1.1

Filename ‘openwrt-gl-ar300m.bin’.

Load address: 0x80010000

Loading: *<0x08>

TFTP error: ‘file /mnt/hdext/openwrt-gl-ar300m.bin not found’ (1)

Starting again

////////////////////////////////////////////////

Thank you

Reflashed the old uboot and even with this the router now starts every time from nor…
I have tried to flash the nand firmware from uboot web page but the process exit with “error 3”:

////////////////////////
Data will be downloaded at 0x80800000 in RAM
Upgrade type: nand_firmware
Upload file size: 9699328 bytes
Loading: ####…####error 3
////////////////////////

@vigans,

Can you reflash the nand firmware from the uboot UI using a different browser or machine if necessary?

Please use the new uboot to do this.

@alzhao

Ok, reflashed all, uboot, nand firmware and nor firmware.
With the new uboot the flashing process is terminated without errors.
Now, the router starts with Nand, to start fron Nor I must set “fw_setenv bootcount 4”, the “fw_setenv boot_dev on” mode is not working… :frowning:

Thank you for your support and time

Guido

@vigans, you are right. boot_dev broken again during bug fix.

@vigans, I test again. boot_dev works. The only problem is position is reversed related to the docs. Now if it is left side, it will boot nor.

1. Left side (near the reset button) –> Nand flash 2. Right side –> Nor flash

Just fixed and here is the new uboot.

 

@alzhao,

This works perfectly, now the ar300m is the best mini router for my needs :slight_smile:

Thank you

@alzhao

I have installed the new uboot (U-Boot 1.1.4-g36de7573) but the switch (boot_dev on) isnt working.

Both sides, it wil always boot to nand. only with bootcount=4, it wil boot to nor.

The switch itself works, I can see that the value from gpoi-1 is changing from hi to low when I flip the switch.

@mkroes, can you please check the console output of uboot when using the switch? Maybe you can erase all the uboot env variables and recheck.

@mkroes,
have you tried without the case?
The switch has 3 positions, left<–center–>right but the case has only 2, left<–center, you must drill the case on the last position…

Vigans

@vigans, It works with only de left and centre position.

@alzhao, erasing all the uboot env variables did the trick. Now its working. Thanks!

Hi all, I am a recent owner of this great little router. I would like to update the uboot (in order to be able to use the switch as a NAND-NOR selector).

I tried to install the latest image in this thread through the 192.168.1.1/uboot.html u-boot web page however it complains about wrong filesize.

Is soldering the serial pins and using a UART adapter the only way to update the uboot? Can a web-upgrade compatible image be made available?

 

Thanks!

Bye,

 

I have the newer uboot on my AR300M but the switch is not forcing a boot to a specific flash after setting the boot_dev variable. How can I erase the uboot env variables to see if that will fix it for me also? Is there a specific one I could clear that might do it?

I don’t have a UART connector capability so would need to do this from either the NAND or NOR booted systems.

 

Thanks

I have this router purchased Nov 2017, flashed the latest 2.263 NAND firmware via the GUI, I then flashed the LEDE 14.01.4 NOR firmware via UBOOT web update. Now I want to be able to boot the NOR image by using the switch.

What is the current procedure? What is the latest tested working uboot image? I have no UART adapter at the moment, is it possible to flash new uboot via a web gui?

 

using uboot web interface I flashed LEDE to the NOR firmware, and then also using uboot web interface flashed the above linked new uboot: 404 Page not found - GL.iNet

Now my system boots only to NOR, which is actually very good for me because I wanted the LEDE firmware, however it apparently doesn’t boot to the NAND firmware anymore, regardless of which way I set the switch. Yes I have set boot_dev on

How can I now use the switch for selecting NOR vs NAND?

 

You have to use USB UART adapter and connect to the serial pins.

You can try flash the nand firmware again using the uboot console.

Just a little tip:

When you flash custom firmware and the routers doesn’t boot AND you don’t want to solder (I want to keep the case around the board). Just execute this little trick to trigger bootcount:

  • Insert power, wait until the first flash of the led (after 2 seconds), and disconnect the power cord (bootcount =1)
  • Repeat (bootcount=2)
  • Repeat (bootcount=3)
  • Now you can insert the power cord and keep it inserted, it now boots the NOR flash :slight_smile:

Easier than logging in and setting bootcount=4.

1 Like

Hi, I think i bricked my AR300M. I flashed the new Uboot via web console but the switch still did not work. So as alzhao described I cleaned all env parameters (all means all, i cleaned ipaddr, dlf, blf, everything).

Now even the Unbrick method via 192.168.1.1 doesn’t work anymore. The device still seems to be alive, though, the LEDs still blink at startup. But even via UART I only get unreadable letters, no matter what baud rate I choose.

Hi to all.

I also flashed the latest U-Boot from https://github.com/gl-inet/gl-uboot-source-for–ar300m to my AR300M (using prebuilt in bin / MD5 2d34d88fd33fa9128afc1d51269ee9c7).

U-Boot 1.1.4-g36de7573 (May 26 2017 - 14:42:18)

Then erased all environment vars using
erase 0x9f040000 +0x10000
reset

both
run bootcmd
and
run blf
boot correctly into NAND and NOR firmware respectively.

But during normal startup / reset I always get the following error:
Device 0 bad blocks:
07fc0000
07fe0000
Found ART,Checking calibration status...
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

Any help is appreciated!
Thanks Martin

Can you make sure the nand firmware is a valid firmware with .img in the file name?