AR-300M - boot_dev=on - I cant get it working

Hello all,

i recieved my AR-300M a few day ago and try to get the switch working for selection the NAND / NOR Firmware to boot from.

My UBoot seems to be newer than any other i could find here in the different threads.

I have U-Boot 1.1.4-g36de7573-dirty (Jun 1 2017 - 09:14:12)

and i executed the following commands

setenv boot_dev on
saveenv

After doing so i have the following output


ath> printenv
bootargs=board=CUS531-NAND console=ttyS0,115200 ubi.mtd=5,2048 root=/dev/mtdblock8 mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),128k(reserved),64k(art);spi0.1:2m(kernel)
,20m(rootfs),106m(data),22m@0x0(firmware) rootfstype=squashfs,jffs2 noinitrd
bootcmd=if nand bad; then nboot 0x81000000 0 || run blf; else run blf; fi
baudrate=115200
ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee
ipaddr=192.168.1.1
serverip=192.168.1.2
loadaddr=0x80800000
dir=
bootlimit=3
altbootcmd=run blf
blf=bootm 0x9f050000 || run lf; boot
dlf=if ping 192.168.1.2; then echo ok; elif ping 192.168.1.2; then echo ok; elif ping 192.168.1.2; then echo ok; elif echo ping 192.168.1.2; then echo ok; elif echo ping 19
2.168.1.2; then echo ok; else echo ping finally failed; fi; tftp 0x81000000 openwrt-gl-ar300m-ubi.img && nand erase && nand write $fileaddr 0 $filesize
wlf=if nand bad; then nand erase && nand write $web_fileaddr 0 $web_filesize; else erase 0x9f050000 +e30000 && cp.b $web_fileaddr 0x9f050000 $web_filesize; fi; erase 0x9f04
0000 +0x10000
rlf=if ping 192.168.1.2; then tftp 0x80060000 ${dir}openwrt-gl-ar300m.bin && erase 0x9f050000 +$filesize && cp.b $fileaddr 0x9f050000 $filesize; else echo ping 192.168.1.2
failed; fi
lu=tftp 0x80060000 ${dir}uboot-gl-ar300m.bin && erase 0x9f000000 +50000 && cp.b $fileaddr 0x9f000000 $filesize; reset
lf=if ping 192.168.1.2; then tftp 0x80060000 ${dir}openwrt-gl-ar300m.bin && erase 0x9f050000 +$filesize && cp.b $fileaddr 0x9f050000 $filesize; if nand bad; then run dlf; f
i; else echo ping 192.168.1.2 failed; fi
lc=if ping 192.168.1.2; then tftp 0x81000000 config.bin && cp.b 0x9fff0040 0x81000040 0xffc0 && cp.b 0x81000000 0x81001002 0x06 && erase 0x9fff0000 +0xffff && cp.b 0x810000
00 0x9fff0000 0xffff; else setenv bootcount 1 && saveenv && bootm 0x9fed0000; fi
ethact=eth0
bootdelay=5
boot_dev=on
stdin=serial
stdout=serial
stderr=serial
bootcount=3

Environment size: 1880/65532 bytes


But in each of the three settings of the Switch, always NAND is booting up.

Any Idea? In one Thread there was the suggestion to delete all env parameters but one guy seems to brick his device with this action.

 

Oh, and a second question. i cant get bootdelay to work as expected.

I need always a few trys to abort booting and a few seconds more would be great.

 

Thanks in advance

I realised that the Switch is fully working. Sorry for posting so fast but the UBOOT ALLWAYS startet with

Found ART,Checking calibration status...

Device have calibrated,Checking device test status...

Device have tested,Checking MAC address...

Device have MAC address,Checking device flash status...

Device have nor and nand flash,Booting standard firmware from <strong>nand</strong> flash...

But if i set bootcount >= 3 it starts with

 

Found ART,Checking calibration status...

Device have calibrated,Checking device test status...

Device have tested,Checking MAC address...

Device have MAC address,Checking device flash status...

Device have nor and nand flash,Booting standard firmware from <strong>nor</strong> flash...

 

I’ve only checked the output and not the result sorry for that…
but my other question still remains.
How can i increase the bootdelay?

@Flashaholic

What are you trying to achieve by increasing the boot delay?

If you power up with the reset button pressed for a few seconds, the uboot will stop in tftp mode.

I am not sure if bootdelay really works.

@bluewavenet

While playing arount with UART Connection it sometimes happen, that i’am not fast enough and miss the right moment to interupt the boot process.

Thats the only reason and because i always searching the problem in front of the display i was asking what i’am doing wrong. But if even alzhao isn’t sure, i’ll try to improve my “press the button at the right moment” skills :wink:

 

Thanks a lot.

Hello all,

after finishing my UART Tests and playing around for a while i put the pieces together again and close the Device.

Now i’am back on my first problem. The Router dosn’t allows me to boot from NOR with the Switch setting. But it works outside the case… so i do some research and if i’am not totally wrong, this is my problem.

 

The Switch has three positions

  • near USB (BTN 1 pressed)
  • middel (neutral not button pressed)
  • near the antenna (BTN 0 pressed)
Connected through serial interface i can see the Button Switches.

So my Problem is, that NOR is only booted if switch is in position 0 (near the antenna). Normally this ist OK but build into the case, this setting isn’t selectable because the Case limit it. Its only possible to put the Switch near USB or in the middel position.

Did i miss something or is there a bug in the UBOOT Code that’s asking for BTN0 pressed instead of no Button pressed for booting from NOR?

Is there a newer UBOOT Version out, that i can flash, that enables the selection even the case is closed?

Thanks in advance

Hallo alzhao

sorry for pushing up this Thread again but i have still the problem that i cant boot to NOR flash by using the switch.

Its only possible if i open the case and put the switch to the position near the antenna (this position is not possible it the case is closed).

Doo you have any sugestion? A new UBOOT or anything else?

 

Thank you

seems this is a physical problem. While in the case the switch cannot be moved to the correct position. Can you make the switch hole longer?

Hello alzhao,

yes and no (in my option).

First i think, that the case is build like it was designed and there is no Hardware bug in the Case. I read on severals sites, that the switch ifself has 3 positions but only 2 of them can be used.

I was thinking about drill a hole or enlarge the hole but throw this idea away really fast. I’am sure that i cant do it right and the the small pices wont fit and hold in the right position in the case any more.

If you look at the last Post from this thread 404 Page not found - GL.iNet

you can see, that i’am not alone with this problem.

 

Is it possible that UBOOT code looks like this

if btn0 = pressed then

boot NAND

if btn1 = pressed then

boot NOR

 

and it could be fixed with this

if btn0 = pressed

boot NAND

else

boot NOR

 

As you can see, i’am not a developer but even if the problem could be solved with a case modification, i think its much better to change the software side that will solve the problem on ALL devices at once (after flashing :wink: