[SOLVED] Help Flash upgrade for Tl wr840 v2

My tl-wr840v2 got 4 Mb flash. I flashed 16 Mb flash chip and tried replace the current one.
But for some reason, openwrt reboots with kernel panic but same openwrt works just fine in a 4 Mb flash chip.
Original Flash chip : w25q32CSIG
Tried New 16 Mb flash chips : W25Q128FVSG and GD25Q128CSIG. I have flashed new chips with external flash programmer tl866II. Original u-boot do not detect the 16 mb flash chips, so I hv also changed u-boot modified from pepe repository. But still same kernel panic and reboots. I hv tried boot in failsafe mode(f and enter), and flash again with openwrt, also tried with openwrt-sysupgrade file but same kernel panic...and reboots.
This routers wan port do not work(faulty), so I use first lan port as wan and router works just fine with openwrt in 4 Mb flash chip(no kernel panic).

Here is the boot log from serial console,

Booting image from 0x9F020000...                                                
                                                                                
   Vendor/image name:    OpenWrt r7847-03e5dcbf10                               
   Hardware ID:          0x8400002                                              
   Whole image size:     3.8 MB (3932160 bytes)                                 
   Kernel size:          1.2 MB (1255420 bytes)                                 
   Rootfs size:          2.1 MB (2178738 bytes)                                 
   Kernel load address:  0x80060000                                             
   Kernel entry point:   0x80060000                                             
                                                                                
   Header CRC...  skipped                                                       
   Data CRC...    skipped                                                       
                                                                                
Stopping network... OK!                                                         
Uncompressing Kernel... OK!                                                     
Starting kernel...                                                              
                                                                                
[    0.000000] Linux version 4.9.119 (akbar@gfx) (gcc version 7.3.0 (OpenWrt GC8
[    0.000000] bootconsole [early0] enabled                                     
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)                           
[    0.000000] SoC: Qualcomm Atheros QCA9533 ver 2 rev 0                        
[    0.000000] Determined physical RAM map:                                     
[    0.000000]  memory: 02000000 @ 00000000 (usable)                            
[    0.000000] Initrd not found or empty - disabling initrd                     
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.  
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32s
[    0.000000] Zone ranges:                                                     
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000001ffffff]           
[    0.000000] Movable zone start for each node                                 
[    0.000000] Early memory node ranges                                         
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000001ffffff]          
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff] 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pa8
[    0.000000] Kernel command line:  board=TL-WR840N-v2  console=ttyS0,115200 rd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)               
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)    
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)      
[    0.000000] Writing ErrCtl register=00000000                                 
[    0.000000] Readback ErrCtl register=00000000                                
[    0.000000] Memory: 27924K/32768K available (3105K kernel code, 154K rwdata,)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1       
[    0.000000] NR_IRQS:51                                                       
[    0.000000] Clocks: CPU:650.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.0z
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_s
[    0.000010] sched_clock: 32 bits at 325MHz, resolution 3ns, wraps every 6607s
[    0.008879] Calibrating delay loop... 432.53 BogoMIPS (lpj=2162688)          
[    0.071954] pid_max: default: 32768 minimum: 301                             
[    0.077311] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)      
[    0.084828] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) 
[    0.095773] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, ms
[    0.106997] futex hash table entries: 256 (order: -1, 3072 bytes)            
[    0.114547] NET: Registered protocol family 16                               
[    0.121137] MIPS: machine is TP-LINK TL-WR840N v2                            
[    0.601876] Can't analyze schedule() prologue at 80364e78                    
[    0.619766] clocksource: Switched to clocksource MIPS                        
[    0.626673] NET: Registered protocol family 2                                
[    0.632493] TCP established hash table entries: 1024 (order: 0, 4096 bytes)  
[    0.640478] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)         
[    0.647702] TCP: Hash tables configured (established 1024 bind 1024)         
[    0.655040] UDP hash table entries: 256 (order: 0, 4096 bytes)               
[    0.661721] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)          
[    0.669119] NET: Registered protocol family 1                                
[    0.678908] Crashlog allocated RAM at address 0x1f00000                      
[    0.686531] workingset: timestamp_bits=30 max_order=13 bucket_order=0        
[    0.700537] squashfs: version 4.0 (2009/01/31) Phillip Lougher               
[    0.707156] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORI.
[    0.728629] io scheduler noop registered                                     
[    0.733150] io scheduler deadline registered (default)                       
[    0.739291] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled         
[    0.746971] console [ttyS0] disabled                                         
[    0.771191] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 15A
[    0.781001] console [ttyS0] enabled                                          
[    0.781001] console [ttyS0] enabled                                          
[    0.788542] bootconsole [early0] disabled                                    
[    0.788542] bootconsole [early0] disabled                                    
[    0.801065] m25p80 spi0.0: found gd25q128, expected m25p80                   
[    0.809261] m25p80 spi0.0: gd25q128 (16384 Kbytes)                           
[    0.814611] 5 tp-link partitions found on MTD device spi0.0                  
[    0.820408] Creating 5 MTD partitions on "spi0.0":                           
[    0.825363] 0x000000000000-0x000000020000 : "u-boot"                         
[    0.832612] 0x000000020000-0x0000001529fc : "kernel"                         
[    0.840053] 0x0000001529fc-0x000000ff0000 : "rootfs"                         
[    0.846886] mtd: device 2 (rootfs) set to be root filesystem                 
[    0.852865] 1 squashfs-split partitions found on MTD device rootfs           
[    0.859259] 0x000000370000-0x000000ff0000 : "rootfs_data"                    
[    0.867143] 0x000000ff0000-0x000001000000 : "art"                            
[    0.874329] 0x000000020000-0x000000ff0000 : "firmware"                       
[    0.882963] libphy: Fixed MDIO Bus: probed                                   
[    0.911726] libphy: ag71xx_mdio: probed                                      
[    1.542334] ag71xx-mdio.1: Found an AR934X built-in switch                   
[    1.595684] eth0: Atheros AG71xx at 0xba000000, irq 5, mode:GMII             
[    2.232718] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd]
[    2.242947] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode:MII              
[    2.250913] NET: Registered protocol family 10                               
[    2.259561] NET: Registered protocol family 17                               
[    2.264412] 8021q: 802.1Q VLAN Support v1.8                                  
[    2.276187] VFS: Mounted root (squashfs filesystem) readonly on device 31:2. 
[    2.285028] Freeing unused kernel memory: 236K                               
[    2.289620] This architecture does not have kernel memory protection.        
[    2.539772] random: fast init done                                           
[    4.137417] init: Console is alive                                           
[    4.141287] init: - watchdog -                                               
[    4.940871] kmodloader: loading kernel modules from /etc/modules-boot.d/*    
[    5.157816] kmodloader: done loading kernel modules from /etc/modules-boot.d*
[    5.176509] init: - preinit -                                                
[    6.228094] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready               
[    6.257123] random: procd: uninitialized urandom read (4 bytes read)         
Press the [f] key and hit [enter] to enter failsafe mode                        
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level    
[    7.861891] eth0: link up (1000Mbps/Full duplex)                             
[    7.866703] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready          
[    9.970982] jffs2: notice: (369) jffs2_build_xattr_subsystem: complete build.
[    9.989203] mount_root: overlay filesystem has not been fully initialized yet
[   10.036008] mount_root: switching to jffs2 overlay                           
- config restore -                                                              
[   10.454328] urandom-seed: Seed file not found (/etc/urandom.seed)            
[   10.494467] eth0: link down                                                  
[   10.510814] procd: - early -                                                 
[   10.513912] procd: - watchdog -                                              
[   11.269845] procd: - watchdog -                                              
[   11.273424] procd: - ubus -                                                  
[   12.071002] random: ubusd: uninitialized urandom read (4 bytes read)         
[   12.078772] random: ubusd: uninitialized urandom read (4 bytes read)         
[   12.085913] random: ubusd: uninitialized urandom read (4 bytes read)         
[   12.093418] procd: - init -                                                  
Please press Enter to activate this console.                                    
[   12.772949] kmodloader: loading kernel modules from /etc/modules.d/*         
[   12.784186] ip6_tables: (C) 2000-2006 Netfilter Core Team                    
[   12.801526] Loading modules backported from Linux version wt-2017-11-01-0-gf0
[   12.809870] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d     
[   12.820002] ip_tables: (C) 2000-2006 Netfilter Core Team                     
[   12.833749] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)              
[   12.896972] xt_time: kernel timezone is -0000                                
[   12.961371] PPP generic driver version 2.4.2                                 
[   12.968373] NET: Registered protocol family 24                               
[   13.022581] Data bus error, epc == 8089f89c, ra == 8089f898                  
[   13.028356] Oops[#1]:                                                        
[   13.030707] CPU: 0 PID: 438 Comm: kmodloader Not tainted 4.9.119 #0          
[   13.037181] task: 81890a60 task.stack: 80fbc000                              
[   13.041852] $ 0   : 00000000 00000025 00000500 00014000                      
[   13.047290] $ 4   : b81143fc 000143fc 00014000 00000004                      
[   13.052719] $ 8   : 00000001 7c7c3c7c 7c7c7c7c 7c7c7c7c                      
[   13.058150] $12   : 7c7c3c7c 8045d910 00000000 7c7c7c3c                      
[   13.063579] $16   : 80de0010 00000018 00000000 00030000                      
[   13.069009] $20   : 00010000 00031018 00000004 000003ff                      
[   13.074439] $24   : 00000000 1fb7dfa9                                        
[   13.079869] $28   : 80fbc000 80fbda28 80fbda7c 8089f898                      
[   13.085299] Hi    : 00000003                                                 
[   13.088273] Lo    : 000000ff                                                 
[   13.091253] epc   : 8089f89c 0x8089f89c [ath9k_hw@80880000+0x51020]          
[   13.097725] ra    : 8089f898 0x8089f898 [ath9k_hw@80880000+0x51020]          
[   13.104187] Status: 1000f403 KERNEL EXL IE                                   
[   13.108534] Cause : 5080801c (ExcCode 07)                                    
[   13.112673] PrId  : 00019374 (MIPS 24Kc)                                     
[   13.116721] Modules linked in: ath9k(+) ath9k_common pppoe ppp_async ath9k_hg
[   13.175998] Process kmodloader (pid: 438, threadinfo=80fbc000, task=81890a60)
[   13.184611] Stack : 45ab5517 53047dbc e2789968 d319b434 96ac3c5d 27be66e4 000
[   13.193301]         80e19000 80de0010 80fbdb0c 00000004 808cc838 80de0434 004
[   13.201993]         80817b85 00000004 803d0000 80de0010 00000220 ffffffff 000
[   13.210683]         803d9488 80883c54 b8100000 00000000 00000000 00000000 000
[   13.219374]         80de0010 80de0038 00008000 00000001 80fbdb0c 00000004 809
[   13.228066]         ...                                                      
[   13.230602] Call Trace:[   13.232953] [<808a0000>] 0x808a0000 [ath9k_hw@8088]
[   13.239102] [<8089e6f4>] 0x8089e6f4 [ath9k_hw@80880000+0x51020]              
[   13.245221] [<8089ffb0>] 0x8089ffb0 [ath9k_hw@80880000+0x51020]              
[   13.251334] [<80883c54>] 0x80883c54 [ath9k_hw@80880000+0x51020]              
[   13.257461] [<8089303c>] 0x8089303c [ath9k_hw@80880000+0x51020]              
[   13.263572] [<80092708>] 0x80092708                                          
[   13.267179] [<80886380>] 0x80886380 [ath9k_hw@80880000+0x51020]              
[   13.273295] [<801c237c>] 0x801c237c                                          
[   13.276893] [<80108ff4>] 0x80108ff4                                          
[   13.280496] [<801c2258>] 0x801c2258                                          
[   13.284101] [<80092708>] 0x80092708                                          
[   13.287706] [<80802458>] 0x80802458 [ath9k@80800000+0x15d50]                 
[   13.293557] [<800ac1e0>] 0x800ac1e0                                          
[   13.297165] [<80900534>] 0x80900534 [mac80211@80900000+0x5fac0]              
[   13.303276] [<8080e258>] 0x8080e258 [ath9k@80800000+0x15d50]                 
[   13.309118] [<80162360>] 0x80162360                                          
[   13.312739] [<8021eec8>] 0x8021eec8                                          
[   13.316341] [<80164da8>] 0x80164da8                                          
[   13.319947] [<8021d558>] 0x8021d558                                          
[   13.323551] [<80360db8>] 0x80360db8                                          
[   13.327153] [<8021d69c>] 0x8021d69c                                          
[   13.330751] [<8021b80c>] 0x8021b80c                                          
[   13.334357] [<8021d618>] 0x8021d618                                          
[   13.337955] [<8021b8c4>] 0x8021b8c4                                          
[   13.341557] [<803610d0>] 0x803610d0                                          
[   13.345159] [<8021b710>] 0x8021b710                                          
[   13.348765] [<8021cbf8>] 0x8021cbf8                                          
[   13.352363] [<8009c80c>] 0x8009c80c                                          
[   13.355968] [<800918b8>] 0x800918b8                                          
[   13.359567] [<800a2f7c>] 0x800a2f7c                                          
[   13.363173] [<80816000>] 0x80816000 [ath9k@80800000+0x15d50]                 
[   13.369011] [<8021de08>] 0x8021de08                                          
[   13.372613] [<80091d74>] 0x80091d74                                          
[   13.376227] [<80816000>] 0x80816000 [ath9k@80800000+0x15d50]                 
[   13.382069] [<80816018>] 0x80816018 [ath9k@80800000+0x15d50]                 
[   13.387910] [<800609f4>] 0x800609f4                                          
[   13.391510] [<800a2d68>] 0x800a2d68                                          
[   13.395111] [<80091df8>] 0x80091df8                                          
[   13.398714] [<8008f7b0>] 0x8008f7b0                                          
[   13.402321] [<8008f2ac>] 0x8008f2ac                                          
[   13.405930] [<800d4c78>] 0x800d4c78                                          
[   13.409528] [<80103b1c>] 0x80103b1c                                          
[   13.413135] [<800c89b4>] 0x800c89b4                                          
[   13.416733] [<800c6b68>] 0x800c6b68                                          
[   13.420338] [<8010402c>] 0x8010402c                                          
[   13.423937] [<800c8ba4>] 0x800c8ba4                                          
[   13.427539] [<800c8c2c>] 0x800c8c2c                                          
[   13.431144] [<8006f20c>] 0x8006f20c                                          
[   13.434744] [<801c0a58>] 0x801c0a58                                          
[   13.438345]                                                                  
[   13.439881] Code: 0040f809  02002025  8e0201e0 <24030300> 1043001d  24030400 
[   13.450014]                                                                  
[   13.451665] ---[ end trace 861c3fcc143885c4 ]---                             
[   13.458227] Kernel panic - not syncing: Fatal exception                      
[   13.464601] Rebooting in 1 seconds..

Can anyone tell me why this is happening. The router is a Tl-wr840 V2.2 with QCA9533-BL3A SOC and 32 Mb of ram.

Before investing a lot of time in an obsolete router, you might want to consider that only 32 MB of RAM is going to be an operational issue as well, not to mention only having 100BASE-T Ethernet. Routers are available that support current wireless protocols with reasonable flash, RAM, and CPU power for US $20-40.

A quick check of the datasheets indicate that the original flash supports single, dual, and quad SPI, but the replacements only support dual and quad SPI. This may be related to the failure of the OpenWrt kernel and drivers to access the flash.

Edit: That the kernel is loading and starting suggests that the flash is being read by the kernel and that the problem may be elsewhere. Perhaps it is that once you start to try to read the overlay there are problems? Does the router boot and become operational in "failsafe" mode (when the overlay is not mounted)?

Yes, may be...But I hv just installed Orignal TP-Link firmware and It just works fine in the 16mb flash chip!!
But I cannot use it as wan port is bad and there is no option in tp link software to change wan port.

So, why the tp-link software works but not openwrt...??

Yes, It works fine in failsafe mode. Pls. see original post.

Nitpicking:

16Mb != 16mb != 16MB

16Mb = 16 Mega bit
16mb = 16 milli bit
16 MB = 16 Mega Byte = 128 Mega bit

Being precise avoids misunderstandings :slight_smile:

Wow, No solution only some comments not related!!

Anyway, I have solved it and I have made my worthless stupid little router now with a 16Mb flash and 64 Mb ram.
Probably It's the wrong question for this forum, should have posted in developers forum.

u-boot-reset-4-2

1 Like

How did you solve it?

Did it have to do with the overlay (if so, there was a related comment above)?

BTW...everyone can see the thread, and if necessary, you or someone could have moved it to the developer's section. IJS.

Hi,

It was actually my stupidity, I did not read the wiki entirely, .

If you copy 4 mb flash to higher mb flash chip art(atheros radio test) gets misplaced. So All I did is reflashed art from original backup copy via pepe2k u-boot. That's it , it's working great. In fact I can use 8 mb or 16 mb winbond or gd or whatever, all works. bsig, csig, fvsg ...hehe...

In fact writing this from that tiny router..

thanks for asking..

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.