Support for TL-WR840N(ES) Ver 5.0 (EU)

Yep.

 ETH_STATE_ACTIVE!!
TFTP from server 192.168.0.66; our IP address is 192.168.0.2
Filename 'tp_recovery.bin'.
 
 TIMEOUT_COUNT=10,Load address: 0x80060000
Loading: T checksum bad
checksum bad
checksum bad
T Got ARP REPLY, set server/gtwy eth addr (00:e0:00:00:56:e2)
Got it
###############################################################checksum bad
##
         ##################checksum bad
###############################################
         #################################################################
         #######checksum bad
#######################Got ARP REQUEST, return our IP
checksum bad
###################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ######################################################Got ARP REQUEST, return our IP
###########
         #################################################################
         #################################################################
         #################################################################
         ############################
done
Bytes transferred = 8126464 (7c0000 hex)
NetBootFileXferSize= 007c0000
 
 Erase flash !!
From 0x20000 length 0x3C0000
............................................................
 
 Copy 0x80080000 to 0x00020000, count 0x3C0000....
............................................................
[05000C0D][05000C0C]
DDR Calibration DQS reg = 00008A8A
 
 
U-Boot 1.1.3 (May  3 2017 - 19:50:44)
 
Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb8000
******************************
Software System Reset Occurred
******************************
gpiomode2 05540554.
gpiomode2 00000000.
gpiomode2 05550555.
flash manufacture id: c8, device id 40 16
find flash: GD25Q32B
============================================
Ralink UBoot Version: 4.3.0.0
--------------------------------------------
ASIC 7628_MP (Port5<->None)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:May  3 2017  Time:19:50:44
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768
 
 ##### The CPU freq = 580 MHZ ####
 estimate memory size =64 Mbytes
RESET MT7628 PHY!!!!!!
continue to starting system.                                                                                                            0
disable switch phyport...
 
3: System Boot system code via Flash.(0xbc020000)
do_bootm:argc=2, addr=0xbc020000
## Booting image at bc020000 ...
   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 4.9.47 (robimarko@Builder-temp) (gcc version 5.4.0 (LEDE GCC 5.4.0 r4802-e01f5c3) ) #0 Tue Sep 5 09:54:37 2017
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7628AN ver:1 eco:2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[    0.000000] MIPS: machine is TP-Link TL-WR840N v5
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 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, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    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] Writing ErrCtl register=00077cc0
[    0.000000] Readback ErrCtl register=00077cc0
[    0.000000] Memory: 60440K/65536K available (3133K kernel code, 155K rwdata, 752K rodata, 176K init, 209K bss, 5096K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    0.000000] intc: using register map from devicetree
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource_probe: no matching clocksources found
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000011] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.007529] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.070051] pid_max: default: 32768 minimum: 301
[    0.074640] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.080984] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.094089] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.103583] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.109507] pinctrl core: initialized pinctrl subsystem
[    0.115190] NET: Registered protocol family 16
[    0.139477] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.145211] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.150747] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.159969] clocksource: Switched to clocksource MIPS
[    0.166023] NET: Registered protocol family 2
[    0.171164] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.177856] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.184041] TCP: Hash tables configured (established 1024 bind 1024)
[    0.190239] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.195839] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.202167] NET: Registered protocol family 1
[    0.209335] Crashlog allocated RAM at address 0x3f00000
[    0.215602] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.230128] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.235704] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.253983] io scheduler noop registered
[    0.257714] io scheduler deadline registered (default)
[    0.263490] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.270843] console [ttyS0] disabled
[    0.274283] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    0.283057] console [ttyS0] enabled
[    0.283057] console [ttyS0] enabled
[    0.290054] bootconsole [early0] disabled
[    0.290054] bootconsole [early0] disabled
[    0.299318] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    0.310054] m25p80 spi32766.0: using chunked io (size=32)
[    0.315546] m25p80 spi32766.0: gd25q32 (4096 Kbytes)
[    0.320631] 4 ofpart partitions found on MTD device spi32766.0
[    0.326546] Creating 4 MTD partitions on "spi32766.0":
[    0.331781] 0x000000000000-0x000000020000 : "boot"
[    0.338412] 0x000000020000-0x000000120000 : "firmware"
[    0.353191] 0x0000003e0000-0x0000003f0000 : "config"
[    0.359876] 0x0000003f0000-0x000000400000 : "radio"
[    0.367427] libphy: Fixed MDIO Bus: probed
[    0.381599] rt3050-esw 10110000.esw: link changed 0x00
[    0.388431] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.398129] NET: Registered protocol family 10
[    0.405581] NET: Registered protocol family 17
[    0.410226] 8021q: 802.1Q VLAN Support v1.8
[    0.417062] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.424724] Please append a correct "root=" boot option; here are the available partitions:
[    0.433215] 1f00             128 mtdblock0 [    0.437277]  (driver?)
[    0.439676] 1f01            1024 mtdblock1 [    0.443748]  (driver?)
[    0.446148] 1f02              64 mtdblock2 [    0.450220]  (driver?)
[    0.452621] 1f03              64 mtdblock3 [    0.456679]  (driver?)
[    0.459075] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.468391] Rebooting in 1 seconds..
[05000C0D][05000C0B]
DDR Calibration DQS reg = 0000898A

Checksum bad apparently. (cause of the size probably)

It is bad due to size and the fact that mktplinkfw2.c does not have layout for 4MB flash devices and I have selected 8mb device in hope that it will work.
[ 0.417062] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 0.424724] Please append a correct "root=" boot option; here are the available partitions:
[ 0.433215] 1f00 128 mtdblock0 [ 0.437277] (driver?)
[ 0.439676] 1f01 1024 mtdblock1 [ 0.443748] (driver?)
[ 0.446148] 1f02 64 mtdblock2 [ 0.450220] (driver?)
[ 0.452621] 1f03 64 mtdblock3 [ 0.456679] (driver?)
[ 0.459075] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I have seen this error on other devices,it looks like it could be pretty much a lot of stuff.
Also my partition map is probably missing some partitions.

I will se what can be done,but we need developer that knows something.
My knowledge is really limited

Too bad - do you know one that we could contact for assistance? haha. Thanks!

Unfortunately not
Maybe @pepe2k can help us since he added support for v4

Hi Robert Marko,

It's great to see some work on this device. I tried your firmware however it does not work. Anything moved ahead?

No, I am busy working on CPE210 v2.
I have not tried anything new for this device

@pepe2k Hi Piotr! so, any pointers would be greatly appreciated based on the info above.

I went to basically all the outlets in my country including large wholesalers. TL-WR840N Ver 5.0 is all they have. Ver 4.0 is out the window.

(CPE210v2) I got a couple of these a few days ago. They work rather well. I wish there was a way for me to make WiFi go "everywhere" as opposed to so pinpointed. in Stock, you have to be almost in front of the thing to get good speeds. I want to permeate a 2 acre area with one or a couple of these, omnidirectioanlly . I saw yesterday's commit for the 25mhz, awesome! - Is it booting?

Wrong thread,but yes it boots and works normally

Whoops. sorry. I thought I was on the cpe210 one.

is there already a firmware for wr840n v5...

No, there isnt. And its sorely needed.

Here we go with cat mtd proc and partitions for V5

~ # cat /proc/cpuinfo
system type             : MT7628
processor               : 0
cpu model               : MIPS 24Kc V5.5
BogoMIPS                : 386.04
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
ASEs implemented        : mips16 dsp
shadow register sets    : 1
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

~ # cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00020000 00010000 "boot"
mtd1: 00100000 00010000 "kernel"
mtd2: 002c0000 00010000 "rootfs"
mtd3: 00010000 00010000 "config"
mtd4: 00010000 00010000 "radio"

~ # cat /proc/partitions
major minor  #blocks  name

  31        0        128 mtdblock0
  31        1       1024 mtdblock1
  31        2       2816 mtdblock2
  31        3         64 mtdblock3
  31        4         64 mtdblock4

Maybe with this data we can elicit the help of @pepe2k who gave us support or V4, or @robimarko who just ported CPE210V2 (awesome work by the way, tested, works perfect)

I would love to help, but I don't have access to 840N v5.
It is not easy or practical to attempt anything without having physical access.

Send me a private message with your address and I'll get you a router from Amazon in the next 24 hours thank you so very much for your willingness to assist us

Send me your address via private message and I will more than gladly send
you one over from Amazon in the next 24 hours

robimarko is our last hope

Received 840N v5 today and started working on it.
Currently, I am stuck on not being able to flash image on the router in order to test it.
It looks like the issue is in layout for 4MB devices, more precise lack of it.
I made one but there is an issue that when I try to TFTP flash image router gets hard bricked and only rewriting SPI flash with a dump that I made recovers it.
That really slows down any attempt to flash.
And without flashing I really cant to any further