SonicWave
Posts: 22
Joined: Mon Mar 19, 2018 1:10 pm

Re: Use a FT232H-Chip to debug Pi 1 B+ via JTag + OpenOCD config

Mon Apr 16, 2018 6:20 pm

So "halt" does work, but "step" doesn't:

Code: Select all

[email protected]:~/Desktop/openocd$ openocd -f custom_configs/ft232h.cfg -f custom_configs/raspi.cfg 
Open On-Chip Debugger 0.10.0+dev-00391-gf00d9bb1 (2018-04-09-20:32)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
none separate
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
raspi.arm
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : JTAG tap: raspi.arm tap/device found: 0x07b7617f (mfg: 0x0bf (Broadcom), part: 0x7b76, ver: 0x0)
Info : found ARM1176
Info : raspi.arm: hardware has 6 breakpoints, 2 watchpoints
Warn : Scan chain 7 shifted out unexpected address
Warn : Scan chain 7 shifted out unexpected address
Warn : Scan chain 7 shifted out unexpected address
Warn : Scan chain 7 shifted out unexpected address
Info : Listening on port 3333 for gdb connections
Info : accepting 'telnet' connection on tcp/4444
target halted in ARM state due to debug-request, current mode: Undefined instruction
cpsr: 0x800001db pc: 0x00008014
Error: wDTR/rDTR inconsistent (DSCR 40006103)

Code: Select all

[email protected]:~/Desktop/raspberrypi/armjtag$ telnet localhost 4444
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> halt
target halted in ARM state due to debug-request, current mode: Undefined instruction
cpsr: 0x800001db pc: 0x00008014
> step
wDTR/rDTR inconsistent (DSCR 40006103)
I searched google for a while and found articles back from 2008. It looks like the same problem (halt is possible but step isn't, "Scan chain shifted out of unexpected address" - messages) occured several times in that year. But I guess they should have fixed it by now, especially because it works fine at your configuration, dwelch67.

It is quite disappointing that something which should work, doesn't work :(

So just to clarify: You are using a FT232H and not an FT2232h, right?

dwelch67
Posts: 944
Joined: Sat May 26, 2012 5:32 pm

Re: Use a FT232H-Chip to debug Pi 1 B+ via JTag + OpenOCD config

Thu Apr 19, 2018 12:32 am

Yep, FT232H most recently. Have used FT2232h have used FT4232h, jlink, all work just fine.

SonicWave
Posts: 22
Joined: Mon Mar 19, 2018 1:10 pm

Re: Use a FT232H-Chip to debug Pi 1 B+ via JTag + OpenOCD config

Sat Apr 21, 2018 9:59 am

Is it possible to use a ST-Link V2, which is capable of JTAG, instead of a FT232H? I used the stlink.cfg of openocd with this command:

Code: Select all

[email protected]:~/Desktop/openocd$ openocd -f tcl/interface/stlink.cfg -f custom_configs/raspi.cfg 
Open On-Chip Debugger 0.10.0+dev-00391-gf00d9bb1 (2018-04-09-20:32)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
none separate
custom_configs/raspi.cfg:26: Error: invalid subcommand "newtap raspi arm -irlen 5 -expected-id 0x07b7617F"
in procedure 'script' 
at file "embedded:startup.tcl", line 60
in procedure 'jtag' called at file "custom_configs/raspi.cfg", line 26
with:

raspi.cfg
# Broadcom 2835 on Raspberry Pi

telnet_port 4444

adapter_khz 1000


if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME raspi
}

reset_config none

if { [info exists CPU_TAPID ] } {
set _CPU_TAPID $CPU_TAPID
} else {
set _CPU_TAPID 0x07b7617F
}
jtag newtap $_CHIPNAME arm -irlen 5 -expected-id $_CPU_TAPID

set _TARGETNAME $_CHIPNAME.arm
target create $_TARGETNAME arm11 -chain-position $_TARGETNAME
stlink.cfg
interface hla
transport select hla_jtag
hla_layout stlink
hla_device_desc "ST-LINK"
hla_vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b
Any ideas?

dwelch67
Posts: 944
Joined: Sat May 26, 2012 5:32 pm

Re: Use a FT232H-Chip to debug Pi 1 B+ via JTag + OpenOCD config

Sun Apr 22, 2018 12:44 am

St-link is a two wire SWD, a sort of jtag transport, or basically not JTAG. Dont see how this could possibly work, you dont have the right signals.

dwelch67
Posts: 944
Joined: Sat May 26, 2012 5:32 pm

Re: Use a FT232H-Chip to debug Pi 1 B+ via JTag + OpenOCD config

Sun Apr 22, 2018 12:58 am

Reading back...I have no use for step so never tried (well it is been many many years). halt, load_image, resume, mdw, mww are basically all I need/use. With microcontrollers I use the flash commands if supported.

To get as far as you have gotten the jtag is working just fine, new hardware shouldnt change anything, a zillion bits have gone by just to get to that point. Would look into the software side of it. openocd is open source and ARM has documented the interface, you can look and see what is going on.

perhaps come in through gdb? or is gdb how you got there, try it without gdb, use the telnet interface instead.

David

dwelch67
Posts: 944
Joined: Sat May 26, 2012 5:32 pm

Re: Use a FT232H-Chip to debug Pi 1 B+ via JTag + OpenOCD config

Sun Apr 22, 2018 12:59 am

Are you not able to halt, load a program, and resume?

SonicWave
Posts: 22
Joined: Mon Mar 19, 2018 1:10 pm

Re: Use a FT232H-Chip to debug Pi 1 B+ via JTag + OpenOCD config

Sun Apr 22, 2018 7:24 am

or is gdb how you got there, try it without gdb, use the telnet interface instead.
It's the same error as I posted above.
Are you not able to halt, load a program, and resume?
Halt is possible, but uploading and resuming not.

I guess I will stick with the SD-card method then, I am tired of openOCD. Thanks for all the help though.

dwelch67
Posts: 944
Joined: Sat May 26, 2012 5:32 pm

Re: Use a FT232H-Chip to debug Pi 1 B+ via JTag + OpenOCD config

Sun Apr 22, 2018 11:57 pm

Why not use the ftdi board as a uart to access a bootloader? No reason to remove the sd card more than one more time. Only two wires to hook up rather than 5 or 6. No reason to do the sd card dance if you cant get jtag to work.

Return to “Bare metal, Assembly language”

Who is online

Users browsing this forum: No registered users and 4 guests