OpenWrt Forum Archive

Topic: unbrick using serial

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

All led of my Tp-link Wr-741nd v4 blink slowly forever when i power on it. I try to unbricck using serial. I open case, connect the USB to ttl successfully. LAN ip of computer is 192.168.0.5. I have tftpd32.exe running. Setevn command is unknow like this:

In:    serial
Out:   serial
Err:   serial
Net:   ag7240_enet_initialize...
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
: cfg1 0x5 cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
ag7240_phy_setup
eth0 up
: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0b:ad
athrs26_reg_init_lan
ATHRS26: resetting s26
ATHRS26: s26 reset done
ag7240_phy_setup
eth1 up
eth0, eth1
auto update firmware: is_auto_upload_firmware = 0!
Autobooting in 1 seconds
## Booting image at 9f020000 ...
   Uncompressing Kernel Image ... ERROR: LzmaDecode.c, 543

Decoding error = 1
LZMA ERROR 1 - must RESET

U-Boot 1.1.4 (Apr 10 2014 - 16:02:22)

AP121 (ar9330) U-boot

DRAM:  32 MB
led turning on for 1s...
id read 0x100000ff
flash size 4194304, sector count = 64
Flash:  4 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ag7240_enet_initialize...
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
: cfg1 0x5 cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
ag7240_phy_setup
eth0 up
: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0b:ad
athrs26_reg_init_lan
ATHRS26: resetting s26
ATHRS26: s26 reset done
ag7240_phy_setup
eth1 up
eth0, eth1
auto update firmware: is_auto_upload_firmware = 0!
Autobooting in 1 seconds
hornet> setevn ipaddr 192.168.0.1
Unknown command 'setevn' - try 'help'
hornet> setevn serverip 192.168.0.5
Unknown command 'setevn' - try 'help'
hornet>

How to make setevn command work?

(Last edited by phantanphu on 11 May 2015, 12:49)

Try setenv

Unknow command "setevn"
It seem i login as "hornet", not "ar7xxx" as usual.

There was an error:

 Uncompressing Kernel Image ... ERROR: LzmaDecode.c, 543

Decoding error = 1
LZMA ERROR 1 - must RESET

How to fix this error?

you have typo in "setenv" command

phantanphu wrote:

There was an error:

 Uncompressing Kernel Image ... ERROR: LzmaDecode.c, 543

Decoding error = 1
LZMA ERROR 1 - must RESET

How to fix this error?

Two things:

1)
You have a typo (not setevn but setenv) that is faulty in your recovery attempt. But that might be a minor side story...

2)
Your actual error about kernel image decoding (ERROR: LzmaDecode.c, 543, error 1) might be rather serious.
I and some other wndr3700 users ran into some unexplained boot errors two years ago. Finally the serial bootlog revealed lzmadecode line 547 error 1, so rather near your error... :-(   The reason was that if the "lzma dictionary" used in compressing the firmware is too big, the lzma decoding functionality in u-boot may break and may lead to error 1. The fix for wndr3700 was to limit dictionary size to 20 bits (1 MB) instead of default 23 bits ( 8MB). Developers included that in the Openwrt sources.
Story at https://dev.openwrt.org/ticket/12454#comment:12 and
https://forum.openwrt.org/viewtopic.php?id=40565

It is possible that your new firmware is hitting similar lzma decompressing bug. The only cures are to use a known good firmware or to recompile with smaller dictionary size.

When you try to recover (with setenv etc...), flash with a firmware that you know to be good.

EDIT:
you are not alone: https://forum.openwrt.org/viewtopic.php?id=53865

(Last edited by hnyman on 12 May 2015, 17:24)

You can also use "printenv" to see where the bootloader expects the TFTP server to be, then change your PC to match that.

The error means that the lzma decoder is unable to extract the firmware kernel-- the data is corrupt and you need to flash a new firmware.  Booting occurs by extracting the entire kernel from flash into RAM, lzma decompressing in the process, and then jumping to the extracted code in RAM where the kernel actually runs.  (In general nothing is executed direct from flash other than the very very first part of the bootloader which sets up the RAM chip and controller then copies the rest of the bootloader to RAM where it then runs)

Like hnyman said I would go to a "known good" firmware to rule out hardware problems, the obvious choice being TP-Link stock (which you may have to doctor up to flash directly).

(Last edited by mk24 on 13 May 2015, 00:32)

I make a typo mistake: "setenv" not "setevn". The Lzma error is no problem. I unbricked my router succecssfully. I think lzma error is no problem in serial console. Thanks for help. Solve lzma error is so far for my experrience. Sorry for poor English.

The discussion might have continued from here.