[Solved] HOW to install Bootloader with JTAG?

All about firmwares for routers. Support for RouterTech firmwares is here too.
riadhos
Novice
Novice
Posts: 25
Joined: Sat Sep 26, 2009 3:41 pm
Location: TUNIS

Re: [REQ] HOW to install Bootloader?

Post by riadhos » Tue Oct 06, 2009 6:53 pm

mstombs wrote:Well that just looks wrong the top "14" is in the wrong place

Image

Dil headers have plugs and sockets that crimp onto ribbon cables, the numbering there is not how that maps. Of course there could be a non-standard router mislabelled like that! I think you will find the rest of the details are the same - but your router seems to have the pins a mirror image - designed to fit the header from below?
hello,
could you give me the pins assosiation / shema of the cable u made,
for me 12 is not a gnd..
it seems to be
nTRST 1 2 GND
TDI 3 4 GND
TDO 5 6 GND
TMS 7 8 GND
TCK 9 10 GND
nSRST 11 12 n/a
n/a 13 14 Vcc

as in http://nuwiki.openwrt.org/oldwiki/OpenW ... JTAG_Cable
it runs with xilinx cable or wiggler???
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: [REQ] HOW to install Bootloader?

Post by mstombs » Tue Oct 06, 2009 7:51 pm

My cable for an Linksys ADSL2MUE is in here

viewtopic.php?p=15417#p15417

Yours is a mirror image.

Its not important about pin 12, you only need to connect up one of the GNDs on a short cable.

You can use either the "very poorman" approximation to a XILINX, or Wiggler - the difference is in the software you use at the other end
riadhos
Novice
Novice
Posts: 25
Joined: Sat Sep 26, 2009 3:41 pm
Location: TUNIS

Re: [REQ] HOW to install Bootloader?

Post by riadhos » Wed Oct 07, 2009 10:20 am

héllo
i tried this shemas attached; its like the one u done

triing to upload bootloader with ciclamb but gettig this error;
JTag info - Port: "LPT1:", Interface: "Xilinx"
CPU Chip:
- ID 00000000000000000001000000001111 (0x0000100F)
- Instruction Length set to 5
- TI AR7WRD TNETD7300GDU Rev 1 CPU
EJTAG
- IMPCODE: 0x41404000
- Version: 2.6
Issuing Processor / Peripheral Reset... Done!
Halting processor... failed!
Attachments
jtag14p.png
a.png
riadhos
Novice
Novice
Posts: 25
Joined: Sat Sep 26, 2009 3:41 pm
Location: TUNIS

Re: [REQ] HOW to install Bootloader?

Post by riadhos » Wed Oct 07, 2009 4:48 pm

finally after lot of retries with ciclamb it finished by answering and transmitting the bootloader

hereslogs

Code: Select all

JTag info - Port: "LPT1:", Interface: "Xilinx"
CPU Chip:
- ID 00000000000000000001000000001111 (0x0000100F)
- Instruction Length set to 5
- TI AR7WRD TNETD7300GDU Rev 1 CPU
EJTAG
- IMPCODE: 0x41404000
- Version: 2.6
Issuing Processor / Peripheral Reset... Done!
Halting processor... Done!
Clearing watchdog... Done!
Probing "Flash" at (Flash Window: 0x90000000)... Done!
- Vendor ID: 00000000000000000000000011000010 (0x000000C2)
- Device ID: 00000000000000000010001010101000 (0x000022A8)
- MX29LV320B 2Mx16 BotB (4MB)
- Window Start/Length         : 0x90000000 / 0x00400000
- BootLoader Area Start/Length: 0x90000000 / 0x00010000
- MTD3 Area Start/Length      : 0x90010000 / 0x00010000
- MTD0/1 Area Start/Length    : 0x90020000 / 0x003f0000
Erasing MTD01... Done!"
- Total blocks to erase: 62"
- Erasing block: 0x47 (addr = 0x903f0000)
Erase time: 00' 41.58"
Erasing MTD3... Done!"
- Total blocks to erase: 1"
- Erasing block: 0x09 (addr = 0x90010000)
Erase time: 00' 00.80"
Erasing PSPBOOT... Done!"
- Total blocks to erase: 8"
- Erasing block: 0x08 (addr = 0x9000e000)
Erase time: 00' 03.78"
Flash ADAM2-DSL-G604T.BIN to PSPBOOT... Stopped!
- Flashing block: 0x
Flashing time: 00' 01.88"
JTag info - Port: "LPT1:", Interface: "Xilinx"
CPU Chip:
- ID 00000000000000000001000000001111 (0x0000100F)
- Instruction Length set to 5
- TI AR7WRD TNETD7300GDU Rev 1 CPU
EJTAG
- IMPCODE: 0x41404000
- Version: 2.6
Issuing Processor / Peripheral Reset... Done!
Halting processor... Done!
Clearing watchdog... Done!
Probing "Flash" at (Flash Window: 0x90000000)... Done!
- Vendor ID: 00000000000000000000000011000010 (0x000000C2)
- Device ID: 00000000000000000010001010101000 (0x000022A8)
- MX29LV320B 2Mx16 BotB (4MB)
- Window Start/Length         : 0x90000000 / 0x00400000
- BootLoader Area Start/Length: 0x90000000 / 0x00010000
- MTD3 Area Start/Length      : 0x901f0000 / 0x00010000
- MTD0/1 Area Start/Length    : 0x90010000 / 0x003f0000
Erasing ADAM2... Done!"
- Total blocks to erase: 8"
- Erasing block: 0x08 (addr = 0x9000e000)
Erase time: 00' 04.00"
Flash ADAM2-DSL-G604T.BIN to ADAM2... Done!
- Flashing block: 0x
Flashing time: 22' 47.69"

but finally afrer loading it, i cant access with pctool to up the firmware any idea???
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: [REQ] HOW to install Bootloader?

Post by mstombs » Wed Oct 07, 2009 6:04 pm

Congratulations - the JTAG seems to work!

I was going to say - you seem to have to get the JTAG software command ready, power on the router and hit the RETURN key, I am not familiar with CICLAMAB, but it seems the window to stop the processor and get to the flash is short after power on.

Now - where did you get that bootloader? I doubt if a D-Link ADAM2 one is correct! You need the correct one for your flash/ram/switch.

The recent pspboot one posted by thechief in viewtopic.php?f=3&t=3016&p=41108#p41108 more likely to be a better fit!
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: [REQ] HOW to install Bootloader?

Post by thechief » Wed Oct 07, 2009 6:57 pm

You cannot just go flashing any bootloader that you may find! This is a typical example of a little knowledge being dangerous. :shock: You've flashed an Adam2 bootloader, thereby changing everything. I would be surprised if that Adam2 bootloader has not completely trashed your router's environment. You need a suitable psp bootloader, and you will then have a big job restoring the router's environment. Getting your wireless functionality back will also involve an interesting experience.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
riadhos
Novice
Novice
Posts: 25
Joined: Sat Sep 26, 2009 3:41 pm
Location: TUNIS

Re: [REQ] HOW to install Bootloader?

Post by riadhos » Wed Oct 07, 2009 8:40 pm

hi chief; i find all this interesting and the router costed me 3$ :) so its good for a experiments,

now, i copied the boot loader here viewtopic.php?f=3&t=3016&p=41108#p41108 using ciclamb

now router responding to pctool :: and gots an IP 169.254.87.1 !!
great

followed recommandation on the link below and all went good; env and ip,
i installed firmware "RouterTech_3.7.1B_1350A_20090912_2.91_AR7WRD_psbl" on the router but problem getting wifi running with this erro on the diag

Code: Select all

 
Sep 12 16:22:12 cfgmgr(ap): AP REPORT LOCK ACQUIRED 
Sep 12 16:22:12 cfgmgr(ap): wlan_handle_load_event - Acquired Lock 
Sep 12 16:22:12 cfgmgr(ap): Error getting mac from BootLoader enviroment for wlan0 
Sep 12 16:22:12 cfgmgr(ap): Using default mac address: 00:50:F1:12:12:10 
Sep 12 16:22:12 cfgmgr(ap): Use BootLoader command: 
Sep 12 16:22:12 cfgmgr(ap): 	setenv WLAN_HWADDR xx:xx:xx:xx:xx:xx 
Sep 12 16:22:12 cfgmgr(ap): to set mac address 
Sep 12 16:22:12 cfgmgr(ap): MAC address is : 00:50:f1:12:12:10 
Sep 12 16:22:13 cfgmgr(lanbridge0): Bridge Created: br0 
Sep 12 16:22:14 cfgmgr(lanbridge1): Bridge Created: br1 
Sep 12 16:22:16 cfgmgr(lanbridge2): Bridge Created: br2 
Sep 12 16:22:17 cfgmgr(lanbridge3): Bridge Created: br3 
Sep 12 16:22:18 cfgmgr(ap): WPA Authenticator Started 
Sep 12 16:22:18 cfgmgr(lanbridge0): Bridge Interface Added: eth0 
Sep 12 16:22:21 root: USB is disabled  
Sep 12 16:22:22 cfgmgr(sar): DSL Carrier is down 
Sep 12 16:22:22 cfgmgr(ap): EEPROM len 473 
Sep 12 16:22:22 cfgmgr(ap): ERROR: DIE ID Mismatch eeprom ID: 920158cc 60c61320 TNETW ID: 2001594b 1fd50d0a 
Sep 12 16:22:22 cfgmgr(ap): ERROR: Validate EEPROM Image failed 
Sep 12 16:22:22 cfgmgr(ap): Error: Failed to get a valid EEPROM Image. AP is DOWN 
Sep 12 16:22:22 cfgmgr(ap): NVS_TFTP_LOAD is enabled to download the correct EEPROM image                             during next boot.                             Set TFTP Server Address using IPA_SVR env variable 
Sep 12 16:22:22 cfgmgr(ap): Setting bootloader env NVS_TFTP_LOAD to 1 
Sep 12 16:22:22 cfgmgr(ap): AP Releasing Lock 

any idea; i already Tried WEB
tried ruc but needed AP to be enabled to provide right firmware, and just recommanded 4port psb


support needed;

thaaaaaaaanks
Attachments
diag cnet car-845 debricked.txt
(16.15 KiB) Downloaded 647 times
Ruc cnat-car-854.txt
(1.09 KiB) Downloaded 614 times
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: [REQ] HOW to install Bootloader?

Post by mstombs » Wed Oct 07, 2009 11:16 pm

WooHoo you are getting there!

First thing you must do is compare your current environment vars with the ones in the first post. You have a few missing - MAC addresses and "IPA_SVR" at least. Put these in, reboot and try running the RUC again, hopefully the log will give you the info to run the WEB if needed.
riadhos
Novice
Novice
Posts: 25
Joined: Sat Sep 26, 2009 3:41 pm
Location: TUNIS

Re: [REQ] HOW to install Bootloader?

Post by riadhos » Thu Oct 08, 2009 9:26 am

YEEEEEEEEEEES! its all OK WIFI TOO:

so lets wrap up:
starting: CNET CAR-854 router with nothing inside: no boot loader and no firmware

1: build a Xilinx jtag cable (scheam posted in the post)
2: used CICLAMB to restore the PSB bootloader (from here viewtopic.php?f=3&t=3016&p=41108#p41108), Ciclamb using its JTAG utility: need to retry many times in order to get a response and to start the loading of the bootloader at same moment as powering the router:

3: once bootloader loader into the firmware user PCTOOL to set a firmware (same steps as here viewtopic.php?f=3&t=3016&p=41108#p41108 the router started with an IP 169.254.89.1 so need to make ur pc 169.254.89.2 and do same as mentioned by thechief in the link beyond and set env

4: once firmware uploadeD "RouterTech_3.7.1B_1350A_20090912_2.91_AR7WRD_psbl" router is Ok but no way to have wireless:

5: added WLAN_HWADDR 00:12:0E:8C:0D:58 using PCTOOL envirenement /upload;

6: used Wireless Envirenemen Builder WEB to correct the wlan

7 : Reladed and all is ok!!

al this took me more than a week as a newby neerly and 1 or 2 h /day

joint my JTAG CABLE USED (14 pins)
nice experience:
thank you RT staff
Attachments
SNC00493.jpg
SNC00494.jpg
SNC00495.jpg
Last edited by riadhos on Thu Oct 08, 2009 10:12 am, edited 1 time in total.
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: [REQ] HOW to install Bootloader?

Post by thechief » Thu Oct 08, 2009 9:42 am

:shock: Congratulations! :shock:
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: [REQ] HOW to install Bootloader?

Post by mstombs » Thu Oct 08, 2009 9:58 am

Well done!

The JTAG connections look a bit dodgy - but should not be needed again and can be cut-off neatly before closing the case. I fully understand the connection method - it is very tricky to clear all 14 holes to be able to fit a standard 14-way header with typical home tools.

The 169... ip address is a common bootloader default when the env config is trashed and recreated by the bootloader, it is designed to match windows APIPA range for ease of recovery.

Note to all - you should only need JTAG if the bootloader is corrupt. Normal failed firmware loads should not damage the bootloader, but it can be easily done from a command line, or using a software tool designed for a different router which 'upgrades' the bootloader for you (as in case above).

There is one other situation where JTAG is needed - when the bootloader fails to boot due to corrupt env vars (seen on ADSL2MUE with original Linksys firmware, and suspected on others) - then all that is needed is to clear the env + config mtd3 and then PC-Tool can be used to repair.
User avatar
Kieran
RouterTech Team
RouterTech Team
Posts: 2675
Joined: Fri Jan 20, 2006 11:30 am
Location: London
Contact:

Re: [Solved] HOW to install Bootloader with JTAG?

Post by Kieran » Sun Oct 11, 2009 10:44 am

Kudos for getting this working and for sharing it with the community :)

I have stuck this thread near the top of the firmware forum for the short term but would hope to turn this into a proper article on our site - would you (riadhos) object to us using your text and images for this guide? (with appropriate credit to you of course).
Kieran
"Indeed!"
Invaluable links: Forum Rules | Networking Guides | FAQ | Site Search | Forum Search <-- Use it or feel my wrath!
No support via PM, please ask your questions in the forum!
riadhos
Novice
Novice
Posts: 25
Joined: Sat Sep 26, 2009 3:41 pm
Location: TUNIS

Re: [Solved] HOW to install Bootloader with JTAG?

Post by riadhos » Sun Oct 11, 2009 10:33 pm

Kieran wrote:Kudos for getting this working and for sharing it with the community :)

I have stuck this thread near the top of the firmware forum for the short term but would hope to turn this into a proper article on our site - would you (riadhos) object to us using your text and images for this guide? (with appropriate credit to you of course).
hi,
it's all yours; I think it was to be toooo difficult to solve the problem without RT support :)
liquidsky
Newbie
Newbie
Posts: 1
Joined: Thu Dec 03, 2009 10:09 am
Location: Italy
Contact:

Re: [Solved] HOW to install Bootloader with JTAG?

Post by liquidsky » Thu Dec 03, 2009 10:52 am

Hello everybody!
I read your posts about the JTAG pinout.
On my DLink 300T & DLink 604T the JTAG pins are as in the photo (see in the red circle). I'm sorry for the "Electronic misunderstanding" , but if someone send to me the brand/model and the PCB JTAG pinout I may publish new versions of the circuit.
Very important, the cable connecting the JTAG Poorman MUST not exceed 15/20 centimeters, otherwise you get errors like "Halting Processor failed".

Sorry for my bad english... :oops:
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: [Solved] HOW to install Bootloader with JTAG?

Post by thechief » Thu Dec 03, 2009 12:25 pm

Some Dlink routers don't have JTAG pins - so you will need to do some soldering on them.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
Post Reply