OpenWrt Forum Archive

Topic: MZK-W04NU with 10.03

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

I am getting the following error after flashing the image I build openwrt-ar71xx-mzk-w04nu-jffs2-factory.bin

ar7100> bootm 0xbf050000
## Booting image at bf050000 ...
Bad Magic Number

openwrt-ar71xx-mzk-w04nu-jffs2.bin works ok I see there is a size difference. Can some please help me on this.

any one please.

hur wrote:

I am getting the following error after flashing the image I build openwrt-ar71xx-mzk-w04nu-jffs2-factory.bin

ar7100> bootm 0xbf050000
## Booting image at bf050000 ...
Bad Magic Number

openwrt-ar71xx-mzk-w04nu-jffs2.bin works ok I see there is a size difference. Can some please help me on this.

Hi Hru,
I think that if you want flash from U-Boot, you should be remove header information from image.
For me, I always use "GHex" to remove it from offset 0x00 to offset 0x21.
The image bytes data will start with 0x27 0x05 0x19 0x56 ...

OpenWrt / Planex (PCI) MZK-W04NU Atheros AP81 platform router with USB

Either install Backfire 10.03-rc3 -squashfs.bin and upgrade to Backfire 10.03.1-rc4 and later or directly install and modify -factory.bin online.

ar7100> setenv serverip 192.168.1.254; setenv ipaddr 192.168.1.1
ar7100> tftp 0x80800000 openwrt-ar71xx-mzk-w04nu-squashfs-factory.bin
ar7100> cp.b 0x80800000 0x807fffde 0x780000
ar7100> iminfo 0x80800000
ar7100> crc32 0x80800000 0x780000
ar7100> erase 0xbf050000 +0x780000
ar7100> cp.b 0x80800000 0xbf050000 0x780000
ar7100> iminfo 0xbf050000
ar7100> crc32 0xbf050000 0x780000

If iminfo shows "Bad Magic Number", "Bad Header Checksum" or "Bad Data CRC", stop and check the network cable or dowloand -factory.bin again or upgrade tftp server.

Here's another experimental procedure which utilizes "${filesize}".

ar7100> setenv serverip 192.168.1.254; setenv ipaddr 192.168.1.1
ar7100> tftp 0x80800000 openwrt-ar71xx-mzk-w04nu-squashfs-factory.bin
ar7100> printenv filesize

Stop here. Continue if ${filesize} equals to one of 0x770000, 0x780000 or 0x790000.

ar7100> cp.b 0x80800000 0x807fffde ${filesize}
ar7100> iminfo 0x80800000
ar7100> crc32 0x80800000 ${filesize}
ar7100> erase 0xbf050000 +${filesize}
ar7100> cp.b 0x80800000 0xbf050000 ${filesize}
ar7100> iminfo 0xbf050000
ar7100> crc32 0xbf050000 ${filesize}

14.2.16. Why is my Ethernet operation not reliable? < DULG < DENX

(Last edited by fyi on 29 Nov 2010, 10:38)

====check reset button function====
### main_loop entered: bootdelay=4

### main_loop: bootcmd="bootm 0xbf050000"
Hit any key to stop autoboot:  0 
ar7100> tftp 0xa0800000 openwrt-ar71xx-mzk-w04nu-squashfs-factory.bin
Using eth0 device
TFTP from server 192.168.1.254; our IP address is 192.168.1.1
Filename 'openwrt-ar71xx-mzk-w04nu-squashfs-factory.bin'.
Load address: 0xa0800000
Loading: checksum bad
checksum bad
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##########################################
done
Bytes transferred = 7864320 (780000 hex)
ar7100> cp.b 0xa0800022 0xa0800000 0x77ffde
ar7100> iminfo 0xa0800000

## Checking Image at a0800000 ...
   Image Name:   MIPS OpenWrt Linux-2.6.32.25
   Created:      2010-11-20   4:30:32 UTC
   Image Type:   MIPS Linux Kernel Image (gzip compressed)
   Data Size:    1235039 Bytes =  1.2 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
ar7100> crc32 0xa0800000 0x780000
CRC32 for a0800000 ... a0f7ffff ==> 19c8a102
ar7100> erase 0xbf050000 +0x780000
Erase Flash from 0xbf050000 to 0xbf7cffff in Bank # 1 
First 0x5 last 0x7c sector size 0x10000
 124
Erased 120 sectors
ar7100> cp.b 0xa0800000 0xbf050000 0x780000
Copy to Flash... write addr: bf050000
done
ar7100> iminfo 0xbf050000

## Checking Image at bf050000 ...
   Image Name:   MIPS OpenWrt Linux-2.6.32.25
   Created:      2010-11-20   4:30:32 UTC
   Image Type:   MIPS Linux Kernel Image (gzip compressed)
   Data Size:    1235039 Bytes =  1.2 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
ar7100> crc32 0xbf050000 0x780000
CRC32 for bf050000 ... bf7cffff ==> 19c8a102
ar7100> reset

Resetting...

U-Boot 1.1.4 (Oct 25 2007 - 15:28:59)

AP81 (ar7100) U-boot
DRAM:  
sri
32 MB
Top of RAM usable for U-Boot at: 82000000
Reserving 222k for U-Boot at: 81fc8000
Reserving 192k for malloc() at: 81f98000
Reserving 44 Bytes for Board Info at: 81f97fd4
Reserving 36 Bytes for Global Data at: 81f97fb0
Reserving 128k for boot params() at: 81f77fb0
Stack Pointer at: 81f77f98
Now running in RAM - U-Boot at: 81fc8000
id read 0x100000ff
flash size 8MB, sector count = 128
Flash:  8 MB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ag7100_enet_initialize...
Fetching MAC Address from 0x81fedb10
eth0: 00:22:cf:xx:xx:xx
dup 1 speed 100
eth0 up
eth0
====check reset button function====
### main_loop entered: bootdelay=4

### main_loop: bootcmd="bootm 0xbf050000"
Hit any key to stop autoboot:  0 
## Booting image at bf050000 ...
   Image Name:   MIPS OpenWrt Linux-2.6.32.25
   Created:      2010-11-20   4:30:32 UTC
   Image Type:   MIPS Linux Kernel Image (gzip compressed)
   Data Size:    1235039 Bytes =  1.2 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 33554432

Starting kernel ...

Linux version 2.6.32.25 (openwrt@ampere) (gcc version 4.3.3 (GCC) ) #1 Fri Nov 19 20:27:50 PST 2010
bootconsole [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR9132 rev 1, CPU:400.000 MHz, AHB:200.000 MHz, DDR:400.000 MHz
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00002000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200 board=MZK-W04NU
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000000
Readback ErrCtl register=00000000
Memory: 29304k/32768k available (2113k kernel code, 3464k reserved, 395k data, 152k init, 0k highmem)
SLUB: Genslabs=7, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:56
Calibrating delay loop... 266.24 BogoMIPS (lpj=1331200)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
MIPS: machine is Planex MZK-W04NU
bio: create slab <bio-0> at 0
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs Nov 19 2010 20:21:41 Installing. 
msgmni has been set to 57
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
Atheros AR71xx SPI Controller driver version 0.2.4
m25p80 spi0.0: m25p64 (8192 Kbytes)
Searching for RedBoot partition table in spi0.0 at offset 0x7e0000
Searching for RedBoot partition table in spi0.0 at offset 0x7f0000
No RedBoot partition table detected in spi0.0
spi0.0: no WRT160NL signature found
Creating 6 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "u-boot"
0x000000040000-0x000000050000 : "u-boot-env"
0x000000050000-0x0000001b0000 : "kernel"
0x0000001b0000-0x0000007e0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=3C0000, len=420000 
0x0000003c0000-0x0000007e0000 : "rootfs_data"
0x0000007e0000-0x000000800000 : "art"
0x000000050000-0x0000007e0000 : "firmware"
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth1: Atheros AG71xx at 0xba000000, irq 5
Atheros AR71xx hardware watchdog driver version 0.1.0
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
Freeing unused kernel memory: 152k freed
Please be patient, while OpenWrt loads ...
input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
Button Hotplug driver version 0.3.1
eth0: link up (100Mbps/Full duplex)
- preinit -
Registered led device: mzk-w04nu:green:status
Registered led device: mzk-w04nu:blue:wps
Registered led device: mzk-w04nu:green:wlan
Registered led device: mzk-w04nu:green:usb
Registered led device: mzk-w04nu:green:ap
Registered led device: mzk-w04nu:green:router
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
jffs2 not ready yet; using ramdisk
mini_fo: using base directory: /
mini_fo: using storage directory: /tmp/root
- init -
eth0: link down

Please press Enter to activate this console. eth0: link up (100Mbps/Full duplex)
device eth0 entered promiscuous mode
br-lan: port 1(eth0) entering forwarding state
Compat-wireless backport release: compat-wireless-2010-10-14-7-gab01eca
Backport based on wireless-testing.git master-2010-10-19
cfg80211: Calling CRDA to update world regulatory domain
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
cfg80211: World regulatory domain updated:
    (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
usbcore: registered new device driver usb
ieee80211 phy0: Atheros AR9100 MAC/BB Rev:0 AR2133 RF Rev:a1 mem=0xb80c0000, irq=2
cfg80211: Calling CRDA for country: CO
cfg80211: Regulatory domain changed to country: CO
    (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
    (5170000 KHz - 5250000 KHz @ 20000 KHz), (300 mBi, 1700 mBm)
    (5250000 KHz - 5330000 KHz @ 20000 KHz), (300 mBi, 2300 mBm)
    (5735000 KHz - 5835000 KHz @ 20000 KHz), (300 mBi, 3000 mBm)
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 24
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ar71xx-ehci ar71xx-ehci: Atheros AR91xx built-in EHCI controller
ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
nf_conntrack version 0.5.0 (460 buckets, 1840 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
ath_hal: module license 'Proprietary' taints kernel.
Disabling lock debugging due to kernel taint
ath_hal: 2009-05-08 (AR5210, AR5211, AR5212, AR5416, RF5111, RF5112, RF2413, RF5413, RF2133, RF2425, REGOPS_FUNC, XR)
ath_pci: trunk
wlan: trunk
wlan: mac acl policy registered
ath_rate_minstrel: Minstrel automatic rate control algorithm 1.2 (trunk)
ath_rate_minstrel: look around rate set to 10%
ath_rate_minstrel: EWMA rolloff level set to 75%
ath_rate_minstrel: max segment size in the mrr set to 6000 us
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
jffs2_build_filesystem(): unlocking the mtd device... done.
jffs2_build_filesystem(): erasing all blocks after the end marker... 
mini_fo: using base directory: /
mini_fo: using storage directory: /overlay

The discussion might have continued from here.