Solve problem with debugging Linksys-wrt54gl with JTAG using

I am getting this output when I am issuing this command:

$ sudo openocd -f board/MyBuspirate.cfg -f board/linksys-wrt54gl.cfg

Open On-Chip Debugger 0.10.0+dev-00092-g77189db (2017-02-25-13:44)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

Warn : Adapter driver ‘buspirate’ did not declare which transports it allows; assuming legacy JTAG-only

Info : only one transport option; autoselect ‘jtag’

srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst

Info : Buspirate Interface ready!

Info : This adapter doesn’t support configurable speed

Info : JTAG tap: bcm5352e.cpu tap/device found: 0xe09a91ff (mfg: 0x0ff (), part: 0x09a9, ver: 0xe)

Warn : JTAG tap: bcm5352e.cpu UNEXPECTED: 0xe09a91ff (mfg: 0x0ff (), part: 0x09a9, ver: 0xe)

Error: JTAG tap: bcm5352e.cpu expected 1 of 1: 0x0535217f (mfg: 0x0bf (Broadcom), part: 0x5352, ver: 0x0)

Warn : Unexpected idcode after end of chain: 544 0x7fffffff

Warn : Unexpected idcode after end of chain: 576 0xfff82648

Error: double-check your JTAG setup (interface, speed, …)

Error: Trying to use configured scan chain anyway…

Error: bcm5352e.cpu: IR capture error; saw 0xfe not 0x1

Warn : Bypassing JTAG setup events due to errors

^CInfo : Shutting down buspirate.

Info : Buspirate switched to normal mode

where, board/MyBuspirate.cfg:

buspirate_port /dev/ttyUSB0

buspirate_vreg 0

buspirate_mode normal

buspirate_pullup 1

buspirate_speed normal

reset_config srst_only

and the board/linksys-wrt54gl.cfg:

Linksys WRT54GL v1.1

source [find target/bcm5352e.cfg]

set partition_list {

CFE { Bootloader 0x1c000000 0x00040000 }

firmware { “Kernel+rootfs” 0x1c040000 0x003b0000 }

nvram { “Config space” 0x1c3f0000 0x00010000 }

}

External 4MB NOR Flash (Intel TE28F320C3BD90 or similar)

set _FLASHNAME $_CHIPNAME.flash

flash bank $_FLASHNAME cfi 0x1c000000 0x00400000 2 2 $_TARGETNAME

and the source, target/bcm5352e.cfg , it refers to:

set _CHIPNAME bcm5352e

set _CPUID 0x0535217f

jtag newtap $_CHIPNAME cpu -irlen 8 -ircapture 0x1 -irmask 0x1f -expected-id $_CPUID

set _TARGETNAME $_CHIPNAME.cpu

target create $_TARGETNAME mips_m4k -endian little -chain-position $_TARGETNAME

gdb_memory_map disable

$_TARGETNAME configure -event gdb-attach {

reset

halt

}

I want to be able to Debug the JTAG tap: bcm5352e.cpu that i have defined using gdb. I am able to connect to the gdb server that openocd listens on, but looking at the registers, and instruction pointers etc. is saying garbage.

I am not sure, if the Bus Pirate is working as expected and it is in JTAG mode?? I assume yes, because in the output it says: Info : only one transport option; autoselect ‘jtag’.

Do you have any ideas about why i am getting the errors, the unexpected ID codes? And greatly appreciated for generally other points, tips and tricks?