Unbricking Asus RTN10+ B1

Post new topic   Reply to topic    DD-WRT Forum Index -> Ralink SoC based Hardware
Goto page Previous  1, 2, 3  Next
Author Message
pilber
DD-WRT Novice


Joined: 27 Aug 2012
Posts: 18

PostPosted: Wed Dec 31, 2014 3:48    Post subject: Reply with quote
Shimbo I commented on UrJTAG libusb issues just to give hints to for you to test with zJTAG, although UrJTAG seems to support your segger probe experimentally http://www.urjtag.org/book/_compilation_and_installation.html - http://www.urjtag.org/book/_system_requirements.html

I found more related post about bootstrapping https://lists.openwrt.org/pipermail/openwrt-devel/2013-April/019612.html - http://www.8devices.com/community/viewtopic.php?f=1&t=310 and this interesting hardware mod http://blog.dword1511.info/?p=4017 link with translation: http://translate.google.com/translate?sl=zh-CN&tl=en&u=http://blog.dword1511.info/%3Fp%3D4017
Sponsor
dulluj
DD-WRT Novice


Joined: 24 Dec 2014
Posts: 7

PostPosted: Wed Jan 07, 2015 14:32    Post subject: Reply with quote
Hello all,
Finaly I am successfull to load the bootloader in my rt3052 based router.
and after that I loaded the openwrt on it, now every thing is working.
Thanks openwrt and DDwrt ppl.

-----my router Aztech HW550-3G, RT3052F,spansion s29GL064 Flash-----
I modified RT3052.cfg for detection of flash and CPU as well.
then loaded u-boot.bin to starting loaction of flash.
then when rebooted, I got serial console working.
then I loaded new uboot_64mb.bin from openwrt via TFTP
and
If you ppl need my modified RT3052.cfg let me Know.
Remember -I used Parallel Port DLC5 type self made cable.
Thanks again.
pilber
DD-WRT Novice


Joined: 27 Aug 2012
Posts: 18

PostPosted: Wed Jan 07, 2015 15:32    Post subject: Reply with quote
Congratulations Dulluj, please share the rt3052.cfg if you can. I didn't understand "ppl"

Regards.
dulluj
DD-WRT Novice


Joined: 24 Dec 2014
Posts: 7

PostPosted: Thu Jan 08, 2015 7:23    Post subject: Loading uboot.bin in RT3052F, spansion s29GL064 flash Reply with quote
Here is modified RT3052.cfg file I used to recover my corrupt boot.
You have to change it according to your flash type.

EDIT:Where is my attachment,I attached it, But I can not see it!!!
Code:

set  _CHIPNAME rt3052
set  _ENDIAN little
set _CPUTAPID 0x1305224F

#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
#interface ft2232
#ft2232_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H"
#ft2232_layout olimex-jtag
#ft2232_vid_pid 0x15ba 0x002a

if { [info exists PARPORTADDR] } {
   set _PARPORTADDR $PARPORTADDR
} else {
   set _PARPORTADDR 0
}

interface parport
parport_port $_PARPORTADDR
parport_cable dlc5

#jtag_speed
adapter_khz 500

adapter_nsrst_delay 100
jtag_ntrst_delay 100
echo on
# jtag scan chain
# format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag newtap $_CHIPNAME cpu -irlen 5  -ircapture 0x1 -irmask 0x3 -expected-id $_CPUTAPID

set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
target create $_TARGETNAME mips_m4k -endian $_ENDIAN -chain-position $_TARGETNAME

# flash size will be probed
set _FLASHNAME $_CHIPNAME.flash
# format flash bank name driver base size chip_width bus_width target
flash bank $_FLASHNAME cfi 0xBF000000 8388608 2 2 $_TARGETNAME

#flash bank $_FLASHNAME cfi 0x0 8388608 2 2 $_TARGETNAME

echo "allocating work area"
$_TARGETNAME configure -work-area-phys 0x80040000 -work-area-size 4096

echo "allocation complete"
#Folloing code may not work, in that case you need to manually reset init
#and manually load your u-boot.bin at starting address (0x0) of flash (not RAM).
#starting Address of flash can be found in old dump of serial console  or at ddwrt forum/openwrt forum
$_TARGETNAME configure -event reset-init {
  #reset
  echo "halting the target!!!!!!!!!!!!!!!!!!!!!!!!!!!"
  halt
  echo "init SDRAM controller..........................@@@@@@@@@@@@@@@@@@@@"
  mww 0x10000300 0xd1825272
  mww 0x10000304 0xe0120300
  echo "Find flash..."
  flash probe 0
  echo "Load u-boot .."
  load_image uboot_aztc.bin 0x80000000 bin
# resume 0x80000000
}





By the way ppl means PEOPLE!
note: I used home made parallel port jtag(DLC5)
and latest OPENOCD for above job.
pilber
DD-WRT Novice


Joined: 27 Aug 2012
Posts: 18

PostPosted: Thu Jan 08, 2015 11:48    Post subject: Reply with quote
Thanks, apart from successfully rewriting bootloader, I would like to know if you by change did some other tests with openocd and what where your conclusions. I.e. if 0x80000000 address is equivalent to 0x0, if flash probe worked with 0xBF000000 and also on 0x1F000000, if you had to modify configuration registers, resuming/halting cpu
dulluj
DD-WRT Novice


Joined: 24 Dec 2014
Posts: 7

PostPosted: Fri Jan 09, 2015 16:43    Post subject: Reply with quote
Actually I don't remember, but from if halt cpu and reset cpu no problem.
just make sure that your flash is writable.
u have to disable write protect on flash first.
use openocd documentation.

few steps I remember is as below

1. connect target to parallel port

2. open 2 command prompt windows

3. type down your command in one window as follows
openocd -f new_rt3052.cfg -c "gdb_memory_map enable" -c "gdb_flash_program enable"

please note that "gdb_memory_map enable" -c "gdb_flash_program enable" in command is used for enabling flash write

(dont press Enter for now)

4. insert power to target system and immediately press enter to above command.

let the open ocd proceed when finished it will pause at some place and no activity will be there.

5. Now open second command prompt window and type following command and press Enter
telnet localhost 4444

6. try to find flash with command "flash probe 0" in telnet

7. if flash is ok then it will show details of flash.

(after this I tried to load uboot in memory and run from there... it runs but I can see nothing on my serial port....Actually I expected boot menu to appear and select tftp transfer ...but no serial output at all)

8.from bootconsole msg -- openwrt (hw550-3g) I found that start of adress of flash is.....0xBF000000



Set info->start[0]=BF000000

flash_protect ON: from 0xBF000000 to 0xBF02110F

flash_protect ON: from 0xBF030000 to 0xBF030FFF

============================================

Ralink UBoot Version: 3.6.0.0

--------------------------------------------

ASIC 3052_MP2 (Port5<->None)

DRAM component: 128 Mbits SDR

DRAM bus: 32 bit

Total memory: 32 MBytes

Flash component: NOR Flash

Date:Feb 28 2012 Time:23:11:29

============================================

icache: sets:256, ways:4, linesz:32 ,total:32768

dcache: sets:128, ways:4, linesz:32 ,total:16384


##### The CPU freq = 384 MHZ ####


I will find an if possible I will upload openocd log for full explanation.
dulluj
DD-WRT Novice


Joined: 24 Dec 2014
Posts: 7

PostPosted: Fri Jan 09, 2015 17:09    Post subject: Reply with quote
Lucky... I found the Telnet LOG.
please check smily point for further clarity.

[code]
Open On-Chip Debugger
> reset init
Very Happy
JTAG tap: rt3052.cpu tap/device found: 0x1305224f (mfg: 0x127, part: 0x3052, ver
: 0x1)
timed out while waiting for target halted
TARGET: rt3052.cpu - Not halted

in procedure 'reset'
Halt timed out, wake up GDB.
> reset halt
JTAG tap: rt3052.cpu tap/device found: 0x1305224f (mfg: 0x127, part: 0x3052, ver
: 0x1)
timed out while waiting for target halted
TARGET: rt3052.cpu - Not halted

in procedure 'reset'
Halt timed out, wake up GDB.
> halt Very Happy
target state: halted
target halted in MIPS32 mode due to debug-request, pc: 0x9f000380
> reset init
JTAG tap: rt3052.cpu tap/device found: 0x1305224f (mfg: 0x127, part: 0x3052, ver
: 0x1)
target state: halted
target halted in MIPS32 mode due to debug-request, pc: 0x9f000380
halting the target!!!!!!!!!!!!!!!!!!!!!!!!!!!
init SDRAM controller..........................@@@@@@@@@@@@@@@@@@@@
Find flash...
Flash Manufacturer/Device: 0x0001 0x227e
Flash Manufacturer/Device: 0x0001 0x227e
flash 'cfi' found at 0xbf000000
Load u-boot ..
135440 bytes written at address 0x80000000
downloaded 135440 bytes in 6.549418s (20.195 KiB/s)
> reset init Very Happy
JTAG tap: rt3052.cpu tap/device found: 0x1305224f (mfg: 0x127, part: 0x3052, ver
: 0x1)
target state: halted
target halted in MIPS32 mode due to debug-request, pc: 0x9f000380
halting the target!!!!!!!!!!!!!!!!!!!!!!!!!!!
init SDRAM controller..........................@@@@@@@@@@@@@@@@@@@@
Find flash...
Flash Manufacturer/Device: 0x0001 0x227e
flash 'cfi' found at 0xbf000000
Load u-boot ..
135440 bytes written at address 0x80000000
downloaded 135440 bytes in 7.070166s (18.708 KiB/s)
> flash protect 0 0 1 off
protect: cfi primary command set 2 unsupported
cleared protection for sectors 0 through 1 on flash bank 0
> flash erase_sector 0 0 1
erased sectors 0 through 1 on flash bank 0 in 0.210302s Very Happy
> flash write_bank 0 u-boot.bin 0x0
target state: halted
target halted in MIPS32 mode due to target-not-halted, pc: 0x80040108
target state: halted
target halted in MIPS32 mode due to target-not-halted, pc: 0x80040108
target state: halted
target halted in MIPS32 mode due to target-not-halted, pc: 0x80040108
target state: halted
.
.
.
.
.
..
.
.

Very Happy
wrote 135440 bytes from file u-boot.bin to flash bank 0 at offset 0x00000000 in
72.694527s (1.819 KiB/s)

> flash protect 0 0 1 on
protect: cfi primary command set 2 unsupported
set protection for sectors 0 through 1 on flash bank 0
> reset run
Very Happy
target state: halted
target halted in MIPS32 mode due to target-not-halted, pc: 0x80040108
> halt
> halt
>

Connection to host lost.
[code]

so I think flash is written at 0x0
and it worked too.
dulluj
DD-WRT Novice


Joined: 24 Dec 2014
Posts: 7

PostPosted: Fri Jan 09, 2015 17:19    Post subject: Reply with quote
pilber wrote:
Thanks, apart from successfully rewriting bootloader, I would like to know if you by change did some other tests with openocd and what where your conclusions. I.e. if 0x80000000 address is equivalent to 0x0, if flash probe worked with 0xBF000000 and also on 0x1F000000, if you had to modify configuration registers, resuming/halting cpu


1.As far as I know that 0x80000000 is RAM address and not Flash address.

2.sorry, I dint checked flash prob at 0x1F000000.

3. No config. register changes required to modify
if u enabling Flash write in GDB by using commands at start up of OPENOCD


Arrow openocd -f new_rt3052.cfg -c "gdb_memory_map enable" -c "gdb_flash_program enable"


By the way .. your router is still dead or else?
pilber
DD-WRT Novice


Joined: 27 Aug 2012
Posts: 18

PostPosted: Fri Jan 09, 2015 18:40    Post subject: Reply with quote
My router continues damaged. I think the problem is in the RAM Chip. I stored it with similar other routers until some new idea to test arise by chance or I bear up desoldering Ram chip and soldering another one if I get some flux like here http://www.dd-wrt.com/wiki/index.php/DIR-320_64_Mb_RAM_Upgrade or took it to somebody with better tools.

If you saved any interesting link and don't mind to share it I would take a look.

I only used telnet connection to OpenOCD, not GDB, what GDB front end did you use?

Thanks
dulluj
DD-WRT Novice


Joined: 24 Dec 2014
Posts: 7

PostPosted: Sun Jan 11, 2015 19:32    Post subject: Reply with quote
pilber wrote:
My router continues damaged. I think the problem is in the RAM Chip. I stored it with similar other routers until some new idea to test arise by chance or I bear up desoldering Ram chip and soldering another one if I get some flux like here http://www.dd-wrt.com/wiki/index.php/DIR-320_64_Mb_RAM_Upgrade or took it to somebody with better tools.

If you saved any interesting link and don't mind to share it I would take a look.

I only used telnet connection to OpenOCD, not GDB, what GDB front end did you use?

Thanks


Hi,
GDB is backend,

we only use telnet for all the commands.
I unbricked my router(Aztech-hw550-3g) with telnet only.
But i think in background openocd uses GDB.
As I told in my first post here that I am not an expert!
but managed to unbrick my router.

The funny thing is that my router was stricken by Thunderbolt. its 4ports out of total 5 Ethernet port was burnt out ie. found black smoked area in the pcb at Ethernet and wan port!!!!

only one port was operating and wifi was working so this router is no good value for me, but that was good opportunity for me to experiment all the thing I can!
while experimenting I accidentally bricked the it, cause not setting up tftp and trying to load u-boot!!!!!

but now its working with one port ethernet and wifi.


One more thing.
If you able initialize any thing in RAM by using

mww 0x10000300 0xd1825272
mww 0x10000304 0xe0120300

and
load_image uboot_xx.bin 0x80000000 bin

then your RAM may be ok.
silvio80
DD-WRT Novice


Joined: 19 Apr 2015
Posts: 4

PostPosted: Sun Apr 19, 2015 18:19    Post subject: Reply with quote
Hi,
a friend asked me to recover a router Aztech HW550-3G. I tried using the serial port but died. It seems to have skipped the bootloader. reading your post I procured openocd and cable dlc5 but I can not start it. Please, can you help me?
pilber
DD-WRT Novice


Joined: 27 Aug 2012
Posts: 18

PostPosted: Mon Apr 20, 2015 12:55    Post subject: Reply with quote
Hi, you shall provide more information, what responses/output did you get, have you read jtag wiki pages and or used jtag before?, have you make or buy the cable

You need a physical parallel port to use the xillink dlc5 parallel port. Do not use it with usb to parallel adapters.
silvio80
DD-WRT Novice


Joined: 19 Apr 2015
Posts: 4

PostPosted: Mon Apr 20, 2015 17:20    Post subject: Reply with quote
i make the cable. using openocd and the Rt3052 cfg file provided in this thread obtain error in recognising (0x1f instead of 0x10), but later i send a detailed response (at work at the moment). Obviously i used jtag or usb. First i attempt via serial but the sistem do nothing. I never used seriusly jtag
silvio80
DD-WRT Novice


Joined: 19 Apr 2015
Posts: 4

PostPosted: Mon Apr 20, 2015 21:50    Post subject: Reply with quote
I obtain this log:

Warn : Adapter driver 'parport' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
parport port = 0x0
adapter speed: 500 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
on
allocating work area
allocation complete
Warn : No parport port specified, using default '0x378' (LPT1)
Info : clock speed 500 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: rt3052.cpu: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Error writing unexpected address 0xffffffff
Error: Error writing unexpected address 0xffffffff
Error: Error writing unexpected address 0xffffffff
Error: Error writing unexpected address 0xffffffff
Error: Error writing unexpected address 0xffffffff
Error: Error writing unexpected address 0xffffffff
Error: Error writing unexpected address 0xffffffff
Error: Error writing unexpected address 0xffffffff
target state: halted
target halted in MIPS32 mode due to undefined, pc: 0x00000000
Error: Error writing unexpected address 0xffffffff
Error: Error writing unexpected address 0xffffffff
Error: Error writing unexpected address 0xffffffff
Error: Error writing unexpected address 0xffffffff
target state: halted

I suppose was uncorrectly connected.
Can you suggest me a valid, and possibly unexspensive Rolling Eyes, jtag usb interface?
The dlc5 cable homemade was unstable and ugly Embarassed
Thanks
silvio80
DD-WRT Novice


Joined: 19 Apr 2015
Posts: 4

PostPosted: Sat Apr 25, 2015 8:29    Post subject: Reply with quote
Ok
Made wiggler cable and boot recovered.
Now, what can i do to load linux image?
I connect serial port, switch on the router and push "2", but no way to load via tftp connection. Crying or Very sad
Help, thanks
Goto page Previous  1, 2, 3  Next Display posts from previous:    Page 2 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Ralink SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum