AR300M-EXT booting to NOR only - due to broken NAND?


I have just bought an used AR300M-EXT (with white antennas) on ebay. The seller mentioned something about a bad buy and that it is basically unused. Good for me! :grinning:

Though it boots only into the NOR flash. Neither “bootcount 3” nor “boot_dev on” plus the switch show any effect.

The device came to me with the NOR firmware 2.261 which I updated to 2.264 and in the meantime to 2.27-testing without problems. For NOR it works from within the firmware and via uboot. For the NAND image via uboot something does not work though. The WLAN LED switches off, then the LAN LED blinks once and that’s it. Both LED’s are dead.

Two more issues are perplexing me:

  1. In Luci’s kernel log (under 2.77) I can see:

[ 0.896864] nand: device found, Manufacturer ID: 0xa1, Chip ID: 0xe1
[ 0.903437] nand: FW Device PN256GO1 1G 3.3V 8-bit
[ 0.908484] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
[ 0.916408] nand: WARNING: spi0.1: the ECC used on your system is too weak compared to the one required by the NAND chip
[ 0.927642] Scanning device for bad blocks
[ 2.871841] Bad eraseblock 1022 at 0x000007fc0000
** [ 2.878537] Bad eraseblock 1023 at 0x000007fe0000**

So first of all the NAND is there. But what about the “Bad eraseblock”? Is the NAND damanged?

  1. On the cli under the NOR the output of fw_printenv shows:

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
altbootcmd=run blf
blf=bootm 0x9f050000 || run lf; boot
dlf=if ping; then echo ok; elif ping; then echo ok; elif ping; then echo ok; elif echo ping; then echo ok; elif echo ping; then echo ok; else echo ping finally failed; fi; tftp 0x81000000 openwrt-ar71xx-nand-gl-ar300m-ubi.img && nand erase && nand write $fileaddr 0 $filesize
rlf=if ping; then tftp 0x80060000 ${dir}openwrt-gl-ar300m.bin && erase 0x9f050000 +$filesize && cp.b $fileaddr 0x9f050000 $filesize; else echo ping failed; fi
lu=tftp 0x80060000 ${dir}uboot_for_gl-ar300m.bin && erase 0x9f000000 +50000 && cp.b $fileaddr 0x9f000000 $filesize; reset
lf=if ping; 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 failed; fi
lc=if ping; 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 0x9fe80000; fi
wlf=if=nand bad

What about “wlf=if=nand bad”. That command looks incomplete. What does it cause? What would be the correct command?

Is there any way to figure out more about what is going on the the NAND flash than using a USB UART adapter which I do not have?


do you mean that the Nand firmware doesn’t boot?

Nand may have some bad blocks but it can deal with that.

I don’t know wlf though

Yes, it always boots the NOR flash. Whatever I do, the NAND flash is never used.

In the meantime I managed to connect my AR300M over UART with my raspberry pi 3 on /dev/ttyAMA0. I still get some random garbage until
[ 0.762872] console [ttyS0] enabled
is reached in the boot process. (Using the kermit config from Connection UART serial. Any hint about a possible cause would be much appreciated. )
But the output is very well readable. EDIT: After reading Ar150 Serial Boot and since I needed just read access to the uboot console, the garbage is no problem for me … so far. :wink:

Anyway, the console output show that uboot cannot see the NAND flash! Actually I get the same output for u-boot and printenv which @alpha1974 from the thread AR-300M broken? No nand flash gets. Btw his output also shows the wlf environment variable, but with a full command. I found that thread only after I raised my one. So sorry for this duplicate.

Not surprisingly the console also shows that flashing the NAND from the web UI fails because
Executing: nand erase; nand write 0x80800000 0 0xAA0000
no devices available

Could a newer u-boot version help? Could you kindly send me one? For @sportfreund from the same thread with the same problem a version from “May 16 2017 - 14:46:13” did not help. I found some remarks about attached u-boot versions in a few other threads but I cannot see these files.

Interestingly I readouted the NAND flash from the booted NOR via dd if=/dev/mtd7 of=my_file and the beginning matches the firmware\nand\clean\1.0\openwrt-gl-ar300m-ubi-clean.img. But that is probably only another issue I assume. Because the NOR was originally flashed with version 2.261 and my board revision is v1.4.0 with the PN26G01AWSIUG NAND chip.

Hi @alzhao,

Do you have any idea how to check why my uboot ( U-Boot 1.1.4-g36de7573 (Mar 17 2017 - 14:08:04) ) does not recognize my NAND flash when booting?

U-Boot 1.1.4-g36de7573 (Mar 17 2017 - 14:08:04)

DRAM:  128 MB
Nor Flash:  16 MB, sector count = 256
*** Warning *** : PCIe WLAN Module not found !!!
Here should be something like:
NAND Flash: 128 MB, page size = 0x800 block size = 0x20000 oob size = 0x80
as found in other threads in this forum.
Protect off 9F040000 ... 9F04FFFF
Un-Protecting sectors 4..4 in bank 1
Un-Protected 1 sectors

After all that missing detection of the NAND flash is the problem! Where there any changes made in newer uboot version about the topic NAND flash. Is there may an uboot version available with (more) debugging output.

I’d rather suggest you return this device and get an replacement. If you bought from Amazon, can you contact us there? Hope you can put a sticker stating the problem on the case and that will help us to investigate.