OpenWrt Forum Archive

Topic: Flashing ZyXEL NBG-419N

The content of this topic has been archived on 14 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I have followed the exact instructions available here http://wiki.openwrt.org/toh/zyxel/nbg419n but somehow it does not work for me. My board is same as mentioned in wiki ( zyxel NBG-419N V2 ) with chipset Rt3352, however, the wiki states "Ralink RT3052" as its chipset. Another difference is flash size, i have 8 mega flash compare to 4 mega mentioned on wiki.

1: Load system code to SDRAM via TFTP.
openwrt-ramips-rt305x-nbg-419n-initramfs-uImage.bin
This works fine.


2: Load system code then write to Flash via TFTP.
openwrt-ramips-rt305x-nbg-419n-squashfs-sysupgrade.bin

Above gives me an error :
[    0.480000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.500000] Please append a correct "root=" boot option; here are the available partitions:
[    0.510000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)


I can see similar issue here https://dev.openwrt.org/ticket/12187  and solution is to get the right size of flash.

Any thoughts how to specify the right flash size? Or is it has to do something with command line arguments.
ali


The original /proc/cmdline
console=ttyS1,57600n8 root=/dev/ram0


# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00800000 00010000 "ALL"
mtd1: 00030000 00010000 "Bootloader"
mtd2: 00010000 00010000 "Config"
mtd3: 00010000 00010000 "Factory"
mtd4: 007b0000 00010000 "Kernel"


Complete LOG:

## Booting image at bc050000 ...
raspi_read: from:50000 len:40
.   Image Name:   MIPS OpenWrt Linux-3.6.6
   Created:      2012-11-20   6:52:58 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    875089 Bytes = 854.6 kB
   Load Address: 80000000
   Entry Point:  80000000
raspi_read: from:50040 len:d5a51
..............   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 64

Starting kernel ...

[    0.000000] Linux version 3.6.6 (root@sawyrezhang-Precision-T1600) (gcc version 4.6.4 20121001 (prerelease) (Linaro GCC 4.6-2012.10) ) #9 Tue Nov 20 14:52:17 HKT 2012
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[    0.000000] Ralink RT3352 id:1 rev:6 running at 384.00 MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x03ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x03ffffff]
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line:  board=NBG-419N console=ttyS1,57600 mtdparts=physmap-flash.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),2880k(rootfs),2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] __ex_table already sorted, skipping sort
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 62236k/65536k available (1968k kernel code, 3300k reserved, 344k data, 176k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:48
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.010000] Calibrating delay loop... 255.59 BogoMIPS (lpj=1277952)
[    0.090000] pid_max: default: 32768 minimum: 301
[    0.100000] Mount-cache hash table entries: 512
[    0.110000] NET: Registered protocol family 16
[    0.120000] MIPS: machine is ZyXEL NBG-419N
[    0.150000] bio: create slab <bio-0> at 0
[    0.160000] Switching to clocksource MIPS
[    0.170000] NET: Registered protocol family 2
[    0.180000] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[    0.200000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.210000] TCP: Hash tables configured (established 2048 bind 2048)
[    0.220000] TCP: reno registered
[    0.230000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.240000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.250000] NET: Registered protocol family 1
[    0.300000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.310000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.330000] msgmni has been set to 121
[    0.340000] io scheduler noop registered
[    0.350000] io scheduler deadline registered (default)
[    0.360000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.370000] serial8250: ttyS0 at MMIO 0x10000500 (irq = 13) is a 16550A
[    0.380000] serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
[    0.400000] physmap platform flash device: 00800000 at bf000000
[    0.420000] physmap-flash physmap-flash.0: map_probe failed
[    0.440000] ramips-wdt ramips-wdt: timeout value must be 0 < timeout <= 33, using 33
[    0.460000] TCP: cubic registered
[    0.460000] NET: Registered protocol family 17
[    0.470000] 8021q: 802.1Q VLAN Support v1.8
[    0.480000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.500000] Please append a correct "root=" boot option; here are the available partitions:
[    0.510000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

You load firmware for nbg-419n (based on rt3052 chipset) but you really have nbg-419 v2 - another revision with 8MiB serial flash & rt3352 chipset. nbg-419n use parallel flash but fail to map it smile

[    0.400000] physmap platform flash device: 00800000 at bf000000
[    0.420000] physmap-flash physmap-flash.0: map_probe failed

Just for test you can try image for dir-615-h1 or I can make custom build for you. I'm intrested in wifi test on your board.

Hi,

Thanks for followup. I actually gave a  shot to dir-615-h1 and few others but that didn't work either. Can you provide some pointers how can make it work?

What sort of wifi testing you have in mind? Sure, I would be happy to assist.

//ali

ali_ wrote:

Thanks for followup. I actually gave a  shot to dir-615-h1 and few others but that didn't work either. Can you provide some pointers how can make it work?

Boot failure? Log needed.

What sort of wifi testing you have in mind? Sure, I would be happy to assist.

Simply does wifi & wifi LED work or doesn't. Wifi patches are confirmed to work on dir-615-h1 and dir-620-d1.

No, I think it was exactly the same problem. But, I can confirm that by tomorrow. In case it didn't work then what would you recommend? how and where should i modify the flash size parameters? I tried to look into menuconfig utility but no luck.

Sure, I actually want this openwrt to work on my rt3352 router. So i guess, I am gonna be real tester!

Without logs it's difficult to say what the problem. I think wrong flash type is the key. But dir-615-h1 use the same flash type. So only logs will show.

Hi,

The openwrt-ramips-rt305x-dir-615-h1-squashfs-sysupgrade.bin  build works great! Thanks for the tip.

Now, that i have it working so next step is to use wifi part.

ali

Since, i got it up and running. I wonder if i need these patches for wifi:

http://patchwork.openwrt.org/patch/2883/
http://patchwork.openwrt.org/patch/2901/

According to this http://wiki.openwrt.org/doc/uci/wireless  there should be /etc/config/wireless file and even doing "wifi detect > /etc/config/wireless" just creates an empty file. So, i guess wireless driver is not there. At the moment i have image with default settings. I am looking into wifi part. Any pointers will be very appreciated.

//ali

Yes, you need these patches. Note that these patches now included in trunk. So you can rebuild current version by yourself. Or may try my custom build
nbg-419nv2-sysupgrade.bin
(sorry, in russian smile) This firmware based on zyxel nbg-419n but flash type&size were changed for nbg-419n v2.
And logs, please...

Great and I consider its a chance for lovely Russian language! and I will  give a shot. So theoretically its in the trunk and should work out of the box. I wonder why it didn't show up with default settings? seems should have enabled it.

I am struggling to with its original source (ralink) as well and really doing quite a dirty work to *just* make it work. Will let you know how far that can go.

//ali

Russian site and instruction to load firmware (type digital capture and so on) smile
Patches for wifi were included just yesterday. No support for your version of board, only for nbg-149n in trunk.

Thats odd if its not in the trunk and you have a ready custom build:)

You can get&apply any patch from maillist, test and report result to developer by yourself smile

Great.

Let me know what log or LED information you need.

Usual boot log or at least output of dmesg will be enough. nbg-419n have two LEDs (power, wps) and two buttons (reset, wps). Its work on nbg-419nv2?

Are there more than these two patches?

Yes, I've added support for ngb-419nv2 simply replacing flash type with another in original source of nbg-419n. Also procedure of firmware bin-file build was corrected. Do you need this patch?

(Last edited by 123serge123 on 22 Nov 2012, 14:50)

Hi,

Thanks for followup and it works great with latest svn trunk. Here are few details that might serve as a reference:

Router : Flashing ZyXEL NBG-419N V2

Chipset : RT3352
Flash: 8 Mega byte
SDRAM : 64 Mega Byte

Openwrt - Trunk Revision: 34303
OpenWrt Settings: http://wiki.openwrt.org/toh/zyxel/nbg419n   
Final image to be used under "bin/ramips-uClibc/" : openwrt-ramips-rt305x-dir-615-h1-squashfs-sysupgrade.bin

I havn't tested the LEDs part yet and will let you know.

123serge123 wrote:

Great.

Usual boot log or at least output of dmesg will be enough. nbg-419n have two LEDs (power, wps) and two buttons (reset, wps). Its work on nbg-419nv2?


The LEDs seems working fine. The reset button is not responding and so is wps.  Not sure, how can i actually test wps but reset should be doing something I suppose.

Interestingly, the push button next to power connector does respond and is able to turn on/off the LEDs. The another push button on the other corner is not doing anything I think. On the manual it says that its for WLAN enable/disable.

root@OpenWrt:/# dmesg
[    0.000000] Linux version 3.6.7 (ali@T1600) (gcc version 4.6.4 20121106 (prerelease) (Linaro GCC 4.6-2012.11) ) #1 Fri Nov 23 10:20:08
[    0.000000] prom: fw_arg0=00000001, fw_arg1=83f4efb0, fw_arg2=83f4f3b0, fw_arg3=00000000
[    0.000000] env[0]: memsize=64
[    0.000000] env[1]: initrd_start=0x00000000
[    0.000000] env[2]: initrd_size=0x0
[    0.000000] env[3]: flash_start=0x00000000
[    0.000000] env[4]: flash_size=0x800000
[    0.000000] env[0]: memsize=64
[    0.000000] env[1]: initrd_start=0x00000000
[    0.000000] env[2]: initrd_size=0x0
[    0.000000] env[3]: flash_start=0x00000000
[    0.000000] env[4]: flash_size=0x800000
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[    0.000000] Ralink RT3352 id:1 rev:6 running at 384.00 MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x03ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x03ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 80241ce0, node_mem_map 81000000
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16256 pages, LIFO batch:3
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line:  board=DIR-615-H1 console=ttyS1,57600 mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),2880k(rootfs),3776k@02
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] __ex_table already sorted, skipping sort
[    0.000000] Writing ErrCtl register=00050d10
[    0.000000] Readback ErrCtl register=00050d10
[    0.000000] Memory: 62236k/65536k available (1968k kernel code, 3300k reserved, 344k data, 176k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:48
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.010000] Calibrating delay loop... 255.59 BogoMIPS (lpj=1277952)
[    0.090000] pid_max: default: 32768 minimum: 301
[    0.100000] Mount-cache hash table entries: 512
[    0.110000] NET: Registered protocol family 16
[    0.120000] MIPS: machine is D-Link DIR-615 H1
[    0.150000] bio: create slab <bio-0> at 0
[    0.160000] Switching to clocksource MIPS
[    0.170000] NET: Registered protocol family 2
[    0.180000] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[    0.200000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.210000] TCP: Hash tables configured (established 2048 bind 2048)
[    0.220000] TCP: reno registered
[    0.230000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.240000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.250000] NET: Registered protocol family 1
[    0.300000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.310000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.330000] msgmni has been set to 121
[    0.340000] io scheduler noop registered
[    0.350000] io scheduler deadline registered (default)
[    0.360000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.370000] serial8250: ttyS0 at MMIO 0x10000500 (irq = 13) is a 16550A
[    0.380000] serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
[    0.400000] ramips-spi ramips-spi.0: master is unqueued, this is deprecated
[    0.420000] m25p80 spi0.0: found mx25l6405d, expected mx25l3205d
[    0.430000] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    0.440000] 6 cmdlinepart partitions found on MTD device spi0.0
[    0.450000] Creating 6 MTD partitions on "spi0.0":
[    0.460000] 0x000000000000-0x000000030000 : "u-boot"
[    0.470000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.490000] 0x000000040000-0x000000050000 : "factory"
[    0.500000] 0x000000050000-0x000000130000 : "kernel"
[    0.520000] 0x000000130000-0x000000400000 : "rootfs"
[    0.530000] mtd: partition "rootfs" set to be root filesystem
[    0.540000] mtd: partition "rootfs_data" created automatically, ofs=290000, len=170000
[    0.560000] 0x000000290000-0x000000400000 : "rootfs_data"
[    0.570000] 0x000000050000-0x000000400000 : "firmware"
[    0.590000] ramips-wdt ramips-wdt: timeout value must be 0 < timeout <= 33, using 33
[    0.610000] TCP: cubic registered
[    0.620000] NET: Registered protocol family 17
[    0.630000] 8021q: 802.1Q VLAN Support v1.8
[    0.660000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    0.670000] Freeing unused kernel memory: 176k freed
[    4.260000] input: gpio-keys-polled as /devices/platform/gpio-keys-polled/input/input0
[    4.450000] Button Hotplug driver version 0.4.1
[    4.740000] Registered led device: d-link:amber:status
[    4.740000] Registered led device: d-link:green:status
[    4.740000] Registered led device: d-link:amber:wan
[    4.740000] Registered led device: d-link:green:wan
[    4.740000] Registered led device: d-link:blue:wps
[    8.340000] jffs2: notice: (358) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 10 of xref (0 dead, 4 orphan) fo.
[   10.640000] Compat-drivers backport release: compat-drivers-2012-09-04-2-gddac993
[   10.660000] Backport based on wireless-testing.git master-2012-09-07
[   10.670000] compat.git: wireless-testing.git
[   10.710000] cfg80211: Calling CRDA to update world regulatory domain
[   10.730000] cfg80211: World regulatory domain updated:
[   10.740000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   10.750000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.770000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   10.780000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   10.800000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.820000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.480000] usbcore: registered new interface driver usbfs
[   11.500000] usbcore: registered new interface driver hub
[   11.510000] usbcore: registered new device driver usb
[   12.300000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   12.300000] Registered led device: rt2800pci-phy0::radio
[   12.300000] Registered led device: rt2800pci-phy0::assoc
[   12.300000] Registered led device: rt2800pci-phy0::quality
[   12.360000] PPP generic driver version 2.4.2
[   12.560000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   12.800000] NET: Registered protocol family 24
[   12.840000] nf_conntrack version 0.5.0 (975 buckets, 3900 max)
[   13.240000] dwc_otg: version 2.72a 24-JUN-2008
[   16.620000] device eth0 entered promiscuous mode
[   16.630000] br-lan: port 1(eth0) entered forwarding state
[   16.640000] br-lan: port 1(eth0) entered forwarding state
[   17.550000] ramips-wdt: timeout value 60 must be 0 < timeout <= 33, using 33
[   18.640000] br-lan: port 1(eth0) entered forwarding state
[   23.920000] device wlan0 entered promiscuous mode
[   28.060000] br-lan: port 2(wlan0) entered forwarding state
[   28.070000] br-lan: port 2(wlan0) entered forwarding state
[   30.070000] br-lan: port 2(wlan0) entered forwarding state

The discussion might have continued from here.