EJTAG Debrick Utility based on BrJTAG


1. Parallel port access conflict - Linux users should use "sudo rmmod lp" to get the line-printer (lp) driver kernel module to give up the parallel port. Because lp module claims exclusive access to the port and other programs won't be able to use it. You should also stop any daemon that could access parallel port in background such as lpd.

2. Bad soldering - One of the most common reasons that your jtag doesn't work is due to bad soldering, especially in making sure the header is soldered in properly. Check your work with a multimeter. Many routers have jtag holes in the pcb filled with solder. Many damage the pcb by trying to clean the holes. Be careful, use lots of flux, and solder wick to remove the solder from the board. Some soldering irons have a pcb tip that will fit right through the holes and can make the job easier.

3. Putting the connection on backward - Make sure you have the cable connected to the header properly and not upside down.

4. Interference - Electrical interference can cause a bad flash with zjtag. Even having your computer monitor too close can cause bad information and ruin the flash.

5. Cable too long - Similar to electrical interference. You want your cable to be about 6 inches (15,24 cm) in length.

6. JTAG interface activation - TRST pin on the router's JTAG port should be connected to VCC via a 100 ohm resistor. The cpu, when router starts, wants to see this pin as a low level and there is a pull-down resistor for that on the circuit board. Applying VCC to the TRST pin via resistor will notify the cpu that the jtag interface is activated. Some routers can manage without TRST pin in high state, others just refuse to work unless there is a high level on the TRST pin.

7. Watchdog - If your hardware has a watchdog, then you must ensure that it does not reset the CPU when the JTAG wants to halt it. If the watchdog resets the CPU you would typically get a "CPU not halted" type of error. If the CPU has an internal watchdog circuit, on some CPUs it is automatically "paused" when the JTAG halts the CPU. But on others, that doesn't happen, and you need to ensure the watchdog is disabled while doing JTAG debugging. If your circuit has a watchdog circuit that is external to the CPU, then typically you need to be able to disable it in some way (typically the hardware designer provides some sort of switch/jumper on the board to do so).

linux parport settings (only for parallel port type cable users)

       The first step to get the zJTAG running is to get the parallel port right. Usually parallel port support is compiled as a linux kernel module. The following script will detect the settings of the parport:  ppdiag
        Ran as root it will provide you usefull informations like:

S01: parport built as module
S02: parport0:
S02:    ADDR :0x378
S02:    IRQ  :7
S02:    DMA  :3
S03: no parport parameters
S10: ppdev built as module
S12: /dev/parport0 exists ...
S12: /dev/parport0 is readable ...
S12: /dev/parport0 is writable ...
successfull end ....



Sometimes, in order to get things to flash correctly, you have to use switches like the /noemw or /noreset. You can get a list of these switches by typeing zjtag /?

Redhawk0 has reported using these switches for Linksys units:

54G(S) V1-V6 and GL v1.X

zjtag -flash/erase:xxx /noemw /nocwd

54G V8.X, GS v7.X and all other 5354,4704 processor based units

zjtag -flash/erase:xxx /noreset


zjtag -flash/erase:xxx /noemw (Note: Only /noemw is required)

Redhawk has also stated:

the command line is dependent on the type processor you have.

5352 and earlier.

zjtag -erase:kernel /noemw /nocwd
zjtag -erase:nvram /noemw /nocwd

if it is 5354 and later

zjtag -erase:kernel /noreset
zjtag -erase:nvram /noreset



1. Sometimes the routers cpu chip gets "stuck". Try using

-erase:nvram /nodma

a few times followed by the proper command. This will sometimes release the router

2. If you want to run a jtag command continually, use BWs fine script saved as a batch file:

@echo off
zjtag -backup:wholeflash (or whatever command you want)
goto start

This is useful to keep jtag running while you flex the board or just to leave a problem router run overnight to punish it.