openocd, buspirate and RZUSB (AT90USB1287)

Hacking multi-tool. Get one for $30, including worldwide shipping.

openocd, buspirate and RZUSB (AT90USB1287)

Postby rosenzhu » Thu Oct 12, 2017 12:02 am

I use buspirate to update the firmware of RZUSB stick (AT90USB1287), but it goes wrong. (Use buspirate v3.6 and update its firmware to v6.1, linux in parallels) The first time, I got:
Code: Select all
parallels@parallels-vm:~/Downloads$ sudo openocd -f openocd_bp.cfg
[sudo] password for parallels:
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read

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
adapter_nsrst_delay: 100
Info : Buspirate switched to FAST mode
Info : Buspirate Interface ready!
Info : This adapter doesn't support configurable speed
Info : JTAG tap: avr.cpu tap/device found: 0x4978203f (mfg: 0x01f (Atmel), part: 0x9782, ver: 0x4)
Error: avr.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : TAP avr.cpu does not have IDCODE
Info : TAP auto0.tap does not have IDCODE
Info : TAP auto1.tap does not have IDCODE
Info : TAP auto2.tap does not have IDCODE
Info : TAP auto3.tap does not have IDCODE
Info : TAP auto4.tap does not have IDCODE
Info : TAP auto5.tap does not have IDCODE
Info : TAP auto6.tap does not have IDCODE
Info : TAP auto7.tap does not have IDCODE
Info : TAP auto8.tap does not have IDCODE
Info : TAP auto9.tap does not have IDCODE
Info : TAP auto10.tap does not have IDCODE
Info : TAP auto11.tap does not have IDCODE
Info : TAP auto12.tap does not have IDCODE
Info : TAP auto13.tap does not have IDCODE
Info : TAP auto14.tap does not have IDCODE
Info : TAP auto15.tap does not have IDCODE
Info : TAP auto16.tap does not have IDCODE
Info : TAP auto17.tap does not have IDCODE
Info : TAP auto18.tap does not have IDCODE
Info : TAP auto19.tap does not have IDCODE
Warn : Unexpected idcode after end of chain: 21 0x00000000
Warn : Unexpected idcode after end of chain: 53 0x00000000
Warn : Unexpected idcode after end of chain: 85 0x00000000
Warn : Unexpected idcode after end of chain: 117 0x00000000
Warn : Unexpected idcode after end of chain: 149 0x00000000
Warn : Unexpected idcode after end of chain: 181 0x00000000
Warn : Unexpected idcode after end of chain: 213 0x00000000
Warn : Unexpected idcode after end of chain: 245 0x00000000
Warn : Unexpected idcode after end of chain: 277 0x00000000
Warn : Unexpected idcode after end of chain: 309 0x00000000
Warn : Unexpected idcode after end of chain: 341 0x00000000
Warn : Unexpected idcode after end of chain: 373 0x00000000
Warn : Unexpected idcode after end of chain: 405 0x00000000
Warn : Unexpected idcode after end of chain: 437 0x00000000
Warn : Unexpected idcode after end of chain: 469 0x00000000
Warn : Unexpected idcode after end of chain: 501 0x00000000
Warn : Unexpected idcode after end of chain: 533 0x00000000
Warn : Unexpected idcode after end of chain: 565 0x00000000
Warn : Unexpected idcode after end of chain: 597 0x00000000
Warn : Unexpected idcode after end of chain: 629 0x00000000
Error: double-check your JTAG setup (interface, speed, ...)
Error: Trying to use configured scan chain anyway...
Error: avr.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
verify Capture-IR is disabled
background polling: on
TAP: avr.cpu (enabled)
Info : device id = 0x00000000
Error: 0x0 is invalid Manufacturer for avr, 0x1F is expected
Error: 0x0 is not support for avr

Info : Shutting down buspirate.
Info : Buspirate switched to normal mode



When I plug the RZUSB stick into the computer, the stick went really hot. So I tried to re-flash the RZUSB stick, but I got:
Code: Select all
parallels@parallels-vm:~/Downloads$ sudo openocd -f openocd_bp.cfg
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
   
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
adapter_nsrst_delay: 100
Info : Buspirate switched to FAST mode
Info : Buspirate Interface ready!
Info : This adapter doesn't support configurable speed
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: avr.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: avr.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
verify Capture-IR is disabled
background polling: on
TAP: avr.cpu (enabled)
Info : device id = 0x00000000
Error: 0x0 is invalid Manufacturer for avr, 0x1F is expected
Error: 0x0 is not support for avr

Info : Shutting down buspirate.
Info : Buspirate switched to normal mode


I search the problem on the Internet about 2 days, but I got nothing. Thanks a lot! The following is my script:

Code: Select all

set  _CHIPNAME avr
set  _ENDIAN little
set  _FIRMWARE_LOCATION /home/samuel/Downloads/killerbee/firmware/kb-rzusbstick-002.hex

interface buspirate

# buspirate port
buspirate_port /dev/ttyUSB0

buspirate_speed fast

reset_config srst_only
adapter_nsrst_delay 100

if { [info exists CPUTAPID ] } {
    set _CPUTAPID $CPUTAPID
} else {
    set _CPUTAPID 0x4978203f
}

jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME avr -endian $_ENDIAN -chain-position $_TARGETNAME

$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000  -work-area-size 16384 -work-area-backup 0
flash bank avr1.flash avr 0 0 0 0 $_TARGETNAME

telnet_port 4444
gdb_port 3333
tcl_port 6666
init
reset init
verify_ircapture disable
halt
wait_halt
poll
flash probe 0
flash write_image erase $_FIRMWARE_LOCATION
reset run
shutdown


I check the pins (TDO,TDI ,TMS,TCK) of RZUSB stick, they are short circuit. Before I update the firmware, such pins are open circuit. What should I do?
rosenzhu
Newbie
Newbie
 
Posts: 2
Joined: Wed Oct 11, 2017 11:37 pm

Re: openocd, buspirate and RZUSB (AT90USB1287)

Postby USBEprom » Thu Oct 12, 2017 1:55 pm

Hi rosenzhu.
Sadly I know nothig about RZUSB (AT90USB1287), but it seems to me really weird that after a firmware update the pins TDO,TDI ,TMS,TCK of RZUSB stick are short circuited among them or other signal.
I found this but I know nothing if it can be useful at you or not and maybe already you know it:

http://esver.free.fr/blog/?p=637

Since you wrote your stick becomes hot, has short circuits on some of its pins and it can not be recognized by the computer, then I guess it is broken.
Are you sure you did performed upgrade using the right pins and settings on the Bus Pirate?

Be seeing you.

U.Sb
USBEprom
Full Member
Full Member
 
Posts: 121
Joined: Wed Mar 14, 2012 4:09 pm

Re: openocd, buspirate and RZUSB (AT90USB1287)

Postby rosenzhu » Thu Oct 12, 2017 9:53 pm

USBEprom wrote:Hi rosenzhu.
Sadly I know nothig about RZUSB (AT90USB1287), but it seems to me really weird that after a firmware update the pins TDO,TDI ,TMS,TCK of RZUSB stick are short circuited among them or other signal.
I found this but I know nothing if it can be useful at you or not and maybe already you know it:


Since you wrote your stick becomes hot, has short circuits on some of its pins and it can not be recognized by the computer, then I guess it is broken.
Are you sure you did performed upgrade using the right pins and settings on the Bus Pirate?

Be seeing you.

U.Sb



Thanks for your reply!
I connect the pins just as same as the blog. the script I use is a little different to the blog.
I don't know if the difference affect the result.
rosenzhu
Newbie
Newbie
 
Posts: 2
Joined: Wed Oct 11, 2017 11:37 pm


Return to Bus Pirate Support