#18 Install attempt GL-Inet AR300M

Closed
opened 6 years ago by somenut · 21 comments
somenut commented 6 years ago

Although this router is not supported, I just wanted to document that I tried using the image as linked

https://librecmc.org/librecmc/downloads/snapshots/v1.4.1/ar71xx/generic/librecmc-ar71xx-generic-gl-ar300-squashfs-sysupgrade.bin

I tried flashing the NOR flash as recommended in this guide

http://gl-inet.com/docs/mini/ar300m/

it does not seem to boot.

GL ar300m have both nor (16MB) and and (128 MB) flash. As shipped from factory, the device uses Uboot to decide with one to boot.

I am just wondering who is building the image for this device because it does not seem to boot at all.

Although this router is not supported, I just wanted to document that I tried using the image as linked https://librecmc.org/librecmc/downloads/snapshots/v1.4.1/ar71xx/generic/librecmc-ar71xx-generic-gl-ar300-squashfs-sysupgrade.bin I tried flashing the NOR flash as recommended in this guide http://gl-inet.com/docs/mini/ar300m/ it does not seem to boot. GL ar300m have both nor (16MB) and and (128 MB) flash. As shipped from factory, the device uses Uboot to decide with one to boot. I am just wondering who is building the image for this device because it does not seem to boot at all.
RISCI_ATOM commented 6 years ago
Collaborator

I am aware of the issue. The image works on my 1st GL-AR300M, but not any newer generations. There is a bug in u-boot when flashing an image. GL.Inet still has not responded to my request for u-boot_mod sources they are using for the GL-AR300M.

I am aware of the issue. The image works on my 1st GL-AR300M, but not any newer generations. There is a bug in u-boot when flashing an image. GL.Inet still has not responded to my request for u-boot_mod sources they are using for the GL-AR300M.
alzhao commented 6 years ago

I think the above link is wrong. AR300 and AR300M is different and you must use the link of AR300M firmware.

AR300M's newest version changed Nand flash and I think that caused the firmware model not work.

I think the above link is wrong. AR300 and AR300M is different and you must use the link of AR300M firmware. AR300M's newest version changed Nand flash and I think that caused the firmware model not work.
RISCI_ATOM commented 6 years ago
Collaborator

You are right. There is a GL-AR300M image https://librecmc.org/librecmc/downloads/snapshots/v1.4.1/ar71xx/generic/librecmc-ar71xx-generic-gl-ar300m-squashfs-sysupgrade.bin But (again) I did not have any luck with it on newer revisions of the GL-AR300M. I did have it working on a first run of the GL-AR300M, but I think the flash layout changed or there is a bug in u-boot (maybe both).

You are right. There is a GL-AR300M image https://librecmc.org/librecmc/downloads/snapshots/v1.4.1/ar71xx/generic/librecmc-ar71xx-generic-gl-ar300m-squashfs-sysupgrade.bin But (again) I did not have any luck with it on newer revisions of the GL-AR300M. I did have it working on a first run of the GL-AR300M, but I think the flash layout changed or there is a bug in u-boot (maybe both).
somenut commented 6 years ago
Poster

sorry for the late reply, I did use the ar300m nor build.

I always mess up writing these issue reports.

sorry for the late reply, I did use the ar300m nor build. I always mess up writing these issue reports.
RISCI_ATOM commented 6 years ago
Collaborator

https://gl-inet.com/docs/mini/ar300m/

Looks like I was missing the fact that the default behavior was to boot from nand flash instead of nor flash :\ Depending on the revision of u-boot used, it will boot from nor flash on the 3rd failure or if newer u-boot firmware is installed and the switch is in the correct position during boot. libreCMC does not currently have nand flash images available, but I'll look at applying patches from the domino-team lede/openwrt repositories.

https://gl-inet.com/docs/mini/ar300m/ Looks like I was missing the fact that the default behavior was to boot from nand flash instead of nor flash :\ Depending on the revision of u-boot used, it will boot from nor flash on the 3rd failure or if newer u-boot firmware is installed and the switch is in the correct position during boot. libreCMC does not currently have nand flash images available, but I'll look at applying patches from the domino-team lede/openwrt repositories.
somenut commented 6 years ago
Poster

RISCI_Atom

I think I tried using the switch and I think I am booting from nor flash since I tried the stock NOR from gl-inet website and that image works

Nor flash bin does not seem to work from librecmc

here is my fw_printenv

root@GL-AR300M:~# fw_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
bootdelay=1
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 192.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 0x9f040000 +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; fi; 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 0x81000000 0x9fff0000 0xffff; else setenv bootcount 1 && saveenv && bootm 0x9fed0000; fi
ethact=eth0
boot_dev=on
stdin=serial
stdout=serial
stderr=serial
bootcount=0
RISCI_Atom I think I tried using the switch and I think I am booting from nor flash since I tried the stock NOR from gl-inet website and that image works Nor flash bin does not seem to work from librecmc here is my fw_printenv ``` root@GL-AR300M:~# fw_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 bootdelay=1 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 192.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 0x9f040000 +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; fi; 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 0x81000000 0x9fff0000 0xffff; else setenv bootcount 1 && saveenv && bootm 0x9fed0000; fi ethact=eth0 boot_dev=on stdin=serial stdout=serial stderr=serial bootcount=0 ```
RISCI_ATOM commented 6 years ago
Collaborator

Depending on the revision of u-boot used, it will boot from nor flash on the 3rd failure

On older versions u-boot, the switch does not work. I set bootcmd to run blf : fw_setenv bootcmd run blf after manually flashing libreCMC with mtd. Don't do this unless you have a serial cable and spi flasher ready to go or are able to debug other failures.

If you can wait a few days, nand flash support should be ready.

> Depending on the revision of u-boot used, it will boot from nor flash on the 3rd failure On older versions u-boot, the switch does not work. I set bootcmd to `run blf` : `fw_setenv bootcmd run blf` after manually flashing libreCMC with mtd. Don't do this unless you have a serial cable and spi flasher ready to go or are able to debug other failures. If you can wait a few days, nand flash support should be ready.
somenut commented 6 years ago
Poster

Yikes, that sounds bad.

Don't do this unless you have a serial cable and spi flasher ready to go or are able to debug other failure

I don't have a serial cable and api flasher so I probably won't. thanks

Yikes, that sounds bad. > Don't do this unless you have a serial cable and spi flasher ready to go or are able to debug other failure I don't have a serial cable and api flasher so I probably won't. thanks
somenut commented 6 years ago
Poster

Accidentally clicked closed issue button.

Accidentally clicked closed issue button.
somenut commented 6 years ago
Poster

I just realize that I am a fool

 cat /proc/cpuinfo 
system type		: Qualcomm Atheros QCA9533 ver 2 rev 0
machine			: GL-AR300M
processor		: 0
cpu model		: MIPS 24Kc V7.4
BogoMIPS		: 432.53
wait instruction	: yes
microsecond timers	: yes
tlb_entries		: 16
extra interrupt vector	: yes
hardware watchpoint	: yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa			: mips1 mips2 mips32r1 mips32r2
ASEs implemented	: mips16
shadow register sets	: 1
kscratch registers	: 0
package			: 0
core			: 0
VCED exceptions		: not available
VCEI exceptions		: not available

I realize there is another revision of ar300M

https://store.gl-inet.com/collections/travel-routers/products/gl-ar300m-mini-smart-router?variant=3097496944667

I wonder if this change makes any different. I apologize if it did.

I just realize that I am a fool ``` cat /proc/cpuinfo system type : Qualcomm Atheros QCA9533 ver 2 rev 0 machine : GL-AR300M processor : 0 cpu model : MIPS 24Kc V7.4 BogoMIPS : 432.53 wait instruction : yes microsecond timers : yes tlb_entries : 16 extra interrupt vector : yes hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb] isa : mips1 mips2 mips32r1 mips32r2 ASEs implemented : mips16 shadow register sets : 1 kscratch registers : 0 package : 0 core : 0 VCED exceptions : not available VCEI exceptions : not available ``` I realize there is another revision of ar300M https://store.gl-inet.com/collections/travel-routers/products/gl-ar300m-mini-smart-router?variant=3097496944667 I wonder if this change makes any different. I apologize if it did.
somenut commented 6 years ago
Poster

All it says it that it appears to be identical to the QCA9531

https://wikidevi.com/wiki/Qualcomm_Atheros

All it says it that it appears to be identical to the QCA9531 https://wikidevi.com/wiki/Qualcomm_Atheros
somenut commented 6 years ago
Poster

https://gogs.librecmc.org/libreCMC/libreCMC/releases

can you clarify the 1.4.2 release bulletin

*GL-AR300M (2nd gen/ new nand flash) support.

librecmc-ar71xx-generic-gl-ar300m-squashfs-sysupgrade.bin

do I apply this flash to nor or nand?

Edit: the reason why I ask is because the manufacturer has a naming convention.

.img is nand and .bin is nor

https://gogs.librecmc.org/libreCMC/libreCMC/releases can you clarify the 1.4.2 release bulletin *GL-AR300M (2nd gen/ new nand flash) support. librecmc-ar71xx-generic-gl-ar300m-squashfs-sysupgrade.bin do I apply this flash to nor or nand? Edit: the reason why I ask is because the manufacturer has a naming convention. .img is nand and .bin is nor
RISCI_ATOM commented 6 years ago
Collaborator

nand images have not yet been built for the most recent release of libreCMC. It is a nor flash image.

nand images have not yet been built for the most recent release of libreCMC. It is a nor flash image.
pi31415 commented 6 years ago

I was planning on building a NAND image as soon as my GL-AR300M units arrived, and trying it out on my unit, if that is helpful. My IRC nick is christopher74837.

I was planning on building a NAND image as soon as my GL-AR300M units arrived, and trying it out on my unit, if that is helpful. My IRC nick is christopher74837.
pi31415 commented 6 years ago

My units won't arrive for a week, but I could build the image tomorrow morning I think if I don't get too busy.

My units won't arrive for a week, but I could build the image tomorrow morning I think if I don't get too busy.
RISCI_ATOM commented 6 years ago
Collaborator

Nand images for the GL-AR300M are now available :

v1.4.2-main

v1.4.2-core

The GL-AR300M is still not officially supported by the libreCMC project and incorrectly flashing can result in a soft brick. To do the initial install, it must be from u-boot.

nand image : librecmc-ar71xx-nand-gl-ar300m-ubi-factory.img from u-boot

nor image : librecmc-ar71xx-generic-gl-ar300m-squashfs-sysupgrade.bin

Keep in mind that u-boot can boot from both nand or nor flash. After 3 failed boots, it will (by default) boot from nor flash. If there are any problem, please file issues against this open issue.

# Nand images for the GL-AR300M are now available : [v1.4.2-main](https://librecmc.org/librecmc/downloads/snapshots/v1.4.2/ar71xx/nand/) [v1.4.2-core](https://librecmc.org/librecmc/downloads/snapshots/v1.4.2-core/ar71xx/nand/) The GL-AR300M is still not officially supported by the libreCMC project and incorrectly flashing can result in a soft brick. To do the initial install, it must be from u-boot. nand image : librecmc-ar71xx-nand-gl-ar300m-ubi-factory.img from u-boot nor image : librecmc-ar71xx-generic-gl-ar300m-squashfs-sysupgrade.bin Keep in mind that u-boot can boot from both nand or nor flash. After 3 failed boots, it will (by default) boot from nor flash. If there are any problem, please file issues against this open issue.
somenut commented 6 years ago
Poster

thanks. I apologize that I would probably will not be to test it anytime soon. Too busy with whatever I am doing.

thanks. I apologize that I would probably will not be to test it anytime soon. Too busy with whatever I am doing.
pi31415 commented 6 years ago

I built my own librecmc-ar71xx-nand-gl-ar300m-ubi-factory.img from v1.4.2 source, and loaded it onto recently purchased gl-ar300m, using u-boot web interface. LuCi comes up fine, and I see 125052 kb MemTotal after I log in via ssh.

I have not yet tried rebuilding or replacing u-boot.

One oddity: After I press button to update nand firmware, Web interface gets stuck perpetually on message "UPDATE IN PR" and will not reboot on its own. But if you wait for a few minutes, and then try to go to http://192.168.1.1 again, then system will reboot into new firmware. Actually, the first time I tried this, it rebooted back into old firmware, but the second time I gave it more time and it run the librecmc firmware.

I built my own librecmc-ar71xx-nand-gl-ar300m-ubi-factory.img from v1.4.2 source, and loaded it onto recently purchased gl-ar300m, using u-boot web interface. LuCi comes up fine, and I see 125052 kb MemTotal after I log in via ssh. I have not yet tried rebuilding or replacing u-boot. One oddity: After I press button to update nand firmware, Web interface gets stuck perpetually on message "UPDATE IN PR" and will not reboot on its own. But if you wait for a few minutes, and then try to go to http://192.168.1.1 again, then system will reboot into new firmware. Actually, the first time I tried this, it rebooted back into old firmware, but the second time I gave it more time and it run the librecmc firmware.
RISCI_ATOM commented 6 years ago
Collaborator

Keep in mind that if it fails to boot from nand flash, it will fall back to booting from nor flash (after 3 failed boot attempts). Using a serial cable helps debug what is happening. Did you also flash the nor image in this case?

Keep in mind that if it fails to boot from nand flash, it will fall back to booting from nor flash (after 3 failed boot attempts). Using a serial cable helps debug what is happening. Did you also flash the nor image in this case?
pi31415 commented 6 years ago

Negative, I only flashed the NAND image. It occurred to me that maybe the first time system fell back to a openwrt NOR image, but I didn't think at the time to check the RAM amount or anything.

Negative, I only flashed the NAND image. It occurred to me that maybe the first time system fell back to a openwrt NOR image, but I didn't think at the time to check the RAM amount or anything.
somenut commented 6 years ago
Poster

this image works

librecmc-ar71xx-nand-gl-ar300m-ubi-factory.img

I am closing bug report

thank you for all of you efforts @RISCI_ATOM

I hope this images handles multiple streams of browsing and video streaming better than the original image.

this image works librecmc-ar71xx-nand-gl-ar300m-ubi-factory.img I am closing bug report thank you for all of you efforts @RISCI_ATOM I hope this images handles multiple streams of browsing and video streaming better than the original image.
Sign in to join this conversation.
Loading...
Cancel
Save
There is no content yet.