NishanthMenon changed the topic of #openocd to: this is the place to discuss all things OpenOCD | Logs: https://libera.irclog.whitequark.org/openocd/
Hawk777 has quit [Quit: Leaving.]
akaWolf has quit [Ping timeout: 265 seconds]
tsal has quit [Ping timeout: 265 seconds]
tsal has joined #openocd
thinkfat has quit [Ping timeout: 246 seconds]
thinkfat has joined #openocd
diddly has quit [Ping timeout: 264 seconds]
nerozero has joined #openocd
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #openocd
kraiskil has joined #openocd
wingsorc__ has joined #openocd
kraiskil has quit [Ping timeout: 246 seconds]
wingsorc__ has quit [Remote host closed the connection]
wingsorc__ has joined #openocd
kraiskil has joined #openocd
kraiskil has quit [Ping timeout: 252 seconds]
nerozero has quit [Ping timeout: 265 seconds]
defiant has joined #openocd
sbach has quit [Read error: Connection reset by peer]
sbach has joined #openocd
defiant has quit [Quit: defiant]
shibboleth has joined #openocd
matsievskiysv has joined #openocd
matsievskiysv has quit [Client Quit]
matsievskiysv has joined #openocd
matsievskiysv has quit [Client Quit]
matsievskiysv has joined #openocd
matsievskiysv has quit [Quit: Client closed]
matsievskiysv has joined #openocd
shibboleth has quit [Quit: shibboleth]
<matsievskiysv> Hello!
<matsievskiysv> I'm trying to learn how to use OpenOCD and I have a problem creating a DAP for the stm32f1 using JTAG. I'm able to scan JTAG chain and can see my TAPs using the following code
<matsievskiysv> adapter driver ftdi
<matsievskiysv> ftdi vid_pid 0x0403 0x6010
<matsievskiysv> ```
<matsievskiysv> adapter speed 1000
<matsievskiysv> transport select jtag
<matsievskiysv> ftdi channel 0
<matsievskiysv> ftdi layout_init 0x20 0x2d
<matsievskiysv> # nTRST is connected to GPIOL1
<matsievskiysv> ftdi layout_signal nTRST -data 0x20 -input 0x20
<matsievskiysv> jtag newtap cortex cpu -irlen 4 -ircapture 0x1 -irmask 0x03 -expected-id 0x3ba00477
<matsievskiysv> # dap create cortex.dap -adiv5 -chain-position cortex.cpu
<matsievskiysv> jtag newtap stm32f1 bs -irlen 5 -ircapture 0x1 -irmask 0x03 -expected-id 0x16410041
<matsievskiysv> # dap create stm32f1.dap -adiv5 -chain-position stm32f1.bs
<matsievskiysv> init
<matsievskiysv> scan_chain
<matsievskiysv> ```
<matsievskiysv> but when I uncomment `dap create` commands in it I get error
<matsievskiysv> ```
<matsievskiysv> Error: 80 11 adi_v5_jtag.c:446 jtagdp_overrun_check(): Invalid ACK (4) in DAP response
<matsievskiysv> Debug: 81 11 adi_v5_jtag.c:651 jtagdp_transaction_endcheck(): jtag-dp: CTRL/STAT 0xffffffff
<matsievskiysv> Error: 82 11 adi_v5_jtag.c:662 jtagdp_transaction_endcheck(): JTAG-DP STICKY ERROR
<matsievskiysv> Debug: 83 11 adi_v5_jtag.c:664 jtagdp_transaction_endcheck(): JTAG-DP STICKY OVERRUN
<matsievskiysv> Debug: 84 11 command.c:544 run_command(): Command 'dap init' failed with error code -107
<matsievskiysv> ```
<matsievskiysv> The same error I get using supplied script
<matsievskiysv> ```
<matsievskiysv> adapter driver ftdi
<matsievskiysv> ftdi vid_pid 0x0403 0x6010
<matsievskiysv> adapter speed 1000
<matsievskiysv> transport select jtag
<matsievskiysv> ftdi channel 0
<matsievskiysv> ftdi layout_init 0x20 0x2d
<matsievskiysv> ftdi layout_signal nTRST -data 0x20 -input 0x20
<matsievskiysv> source [find "board/stm32f103c8_blue_pill.cfg"]
<matsievskiysv> init
<matsievskiysv> scan_chain
<matsievskiysv> ```
<PaulFertser> matsievskiysv: please do not ever paste more than 3 lines to a channel, use some pastebin.
<matsievskiysv> ok
<PaulFertser> matsievskiysv: why is that you're using a custom target config and not upstream?
<PaulFertser> matsievskiysv: probably the target is sleeping or remapping JTAG?
<matsievskiysv> I need to create a config for different chip and I've decided to practice on something well supported
<PaulFertser> matsievskiysv: do you have reset line connected?
<PaulFertser> srst
<matsievskiysv> yes, to GPIOL1
<matsievskiysv> no, there's no srst
<matsievskiysv> only trst
<PaulFertser> matsievskiysv: why can't you connect srst to target's reset?
<matsievskiysv> I think I could but I didn't need it when using SWD
<matsievskiysv> It is a simple stm32f1 board I've programmed with stlink
<matsievskiysv> Now I'm trying to connect to it with ftdi jtag
<PaulFertser> matsievskiysv: probably the firmware changes a pin that's essential for jtag but not for swd.
<PaulFertser> matsievskiysv: connect_assert_srst is good for cases like that.
<PaulFertser> matsievskiysv: alternatively, force UART bootloader with the BOOT0 pin.
<PaulFertser> JTAG is available in UART bootloader mode.
<matsievskiysv> I've connected srst, got the same result
<matsievskiysv> Does `layout_signal` have precedence over `layout_init`?
<matsievskiysv> I add lines `ftdi set_signal nTRST` with 0 and 1 after `init` and openocd still shows TAPs
<matsievskiysv> It shouldn't show them with reset pulled down, right?
<PaulFertser> matsievskiysv: did you enable "reset_config connect_assert_srst" ?
<PaulFertser> matsievskiysv: nTRST is handled automatically if enabled by reset_config.
<matsievskiysv> I've pasted the whole code above
<matsievskiysv> If it's not called by some function, then no
<PaulFertser> You need reset_config connect_assert_srst or you need BOOT0 in UART bootloader position to make sure JTAG is working.
<PaulFertser> I suggest you also pastebin full OpenOCD output with -d3.
urja has quit [Read error: Connection reset by peer]
<matsievskiysv> Snippet: https://gitlab.com/-/snippets/2416332
<PaulFertser> Can't see the snippet without JS, sorry.
<matsievskiysv> Setting boot mode to internal bootloader didn't help
<matsievskiysv> I think I'll try more stable version of openocd
<PaulFertser> matsievskiysv: I'd disconnect TRST and leave it floating.
<PaulFertser> Have to go now, hope you'll find the missing bit.
<matsievskiysv> I hope so too. Thanks!
urja has joined #openocd
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #openocd
matsievskiysv has quit [Quit: Leaving]
matsievskiysv has joined #openocd
matsievskiysv has quit [Read error: Connection reset by peer]
matsievskiysv has joined #openocd
matsievskiysv has quit [Ping timeout: 265 seconds]
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #openocd
Hawk777 has joined #openocd