RolfNoot has quit [Quit: Connection closed for inactivity]
diddly has quit [Ping timeout: 268 seconds]
diddly has joined #openocd
ayaka_ has joined #openocd
jybz has quit [Ping timeout: 256 seconds]
crabbedhaloablut has joined #openocd
ayaka_ has quit [Ping timeout: 268 seconds]
jybz has joined #openocd
tsal has quit [Ping timeout: 252 seconds]
tsal has joined #openocd
ayaka_ has joined #openocd
nerozero has joined #openocd
ayaka_ has quit [Ping timeout: 255 seconds]
ayaka_ has joined #openocd
zjason` is now known as zjason
gzlb has quit [Ping timeout: 264 seconds]
ayaka_ has quit [Ping timeout: 260 seconds]
ayaka_ has joined #openocd
gzlb has joined #openocd
MGF_Fabio has joined #openocd
Haohmaru has joined #openocd
slobodan has joined #openocd
Hawk777 has quit [Quit: Leaving.]
RolfNoot_ has quit [Remote host closed the connection]
RolfNoot has joined #openocd
<RolfNoot>
karlp: that makes sense, thank you. I will check more adapters, don't know why this one resets then. I thought JLink didn't reset even with srst_only connect_assert_srst
<PaulFertser>
RolfNoot: connect_assert_srst will surely reset the target on openocd startup unless your adapter is broken or SRST isn't connected.
<RolfNoot>
PaulFertser: could this behavior be overridden by the flash driver?
<PaulFertser>
RolfNoot: no
<RolfNoot>
okay, thanks will check
Haohmaru has quit [Remote host closed the connection]
Haohmaru has joined #openocd
shoragan has quit [Read error: Connection reset by peer]
a3f has quit [Read error: Connection reset by peer]
ayaka_ has quit [Ping timeout: 252 seconds]
olerem has quit [Read error: Connection reset by peer]
a3f has joined #openocd
shoragan has joined #openocd
olerem has joined #openocd
merethan has joined #openocd
<RolfNoot>
What's the typical accuracy of the adapter SRST signals (pulse width & delay)?
<karlp>
not high enough taht you should in any way rely on it :)
<karlp>
you can have "longer" and "shorter" but I don't think strict timing is something you should be counting on.
<RolfNoot>
I have this situation: PSoC6 has a dual core with AP closed on CM0+ (not standard) open on CM4. The chip can be asleep and neer reset. Then it wakes, CM0+ starts and need some 100 milliseconds before CM4 starts
<RolfNoot>
So it has to issue SRST and need at least say 400mS (not less, more is no problem)
<RolfNoot>
Before trying to attach
<RolfNoot>
Is it like 100mS inaccuracy or rather 500's?
<karlp>
I think you can specify with ms resolution, but actual will depend on adapaters. it's probably more like 10s of ms really, but I've not tried profiling it much.
<RolfNoot>
Yes, actually I see a minimum SRST delay of 60mS (when I set it to 1)
<RolfNoot>
And it adds about 10-20%
<RolfNoot>
This is for JLink
<RolfNoot>
But I guess it will be depending on USB / hubs as well. For now this looks quite okay
<RolfNoot>
Is there an option to assert reset only once at start of debugging? I see multiple SRST asserts. Also it probes the CPU first. This is cumbersome when the CPU is in sleep. I cannot assert SRST when the chip is not attached?
<PaulFertser>
By default OpenOCD assumes that the target is broken and debug doesn't work under reset. Unfortunately, that's way too common. To change it add "srst_nogate" to reset_config.
<RolfNoot>
but SRST has to deassert before trying to attach
<PaulFertser>
No, why?
<RolfNoot>
it won't attach under reset but it needs a SRST pulse to wake
<PaulFertser>
So your target is broken too?
<RolfNoot>
No, it's in sleep
<PaulFertser>
Then connect_assert_srst is what does the pulse and then deasserts and then tries to attach.
<PaulFertser>
In sleep is ok.
<PaulFertser>
Why can't it attach while reset is asserted?
<RolfNoot>
I am assuming that it can't. Because the chip is in reset
<RolfNoot>
not active when reset is assertted
<PaulFertser>
That contradicts Arm docs.
<RolfNoot>
Okay, then I might be wrong
<PaulFertser>
SRST shouldn't be affecting debug circuity.
<PaulFertser>
But many targets are broken and so it does one way or the other.
<RolfNoot>
it's a dual core with AP on CM0+, CM4 and Sys-AP
<RolfNoot>
So it might be that only SYS-AP is active under reset.
<RolfNoot>
Got it, PSoC6 doesn't support connect-under-reset
<RolfNoot>
So how can I wake the CPU from sleep (assert-deassert SRST) before attach?
Haohmaru has quit [Remote host closed the connection]
Haohmaru has joined #openocd
<PaulFertser>
RolfNoot: by using connect_assert_srst but not srst_nogate.
<borneoa___>
RolfNoot: there are two commands to specify the time delay during which SRST is asserted (low) and how long OpenOCD has to wait after the reset pulse before to try to talk with the target.
Haohmaru has quit [Quit: saionara]
<borneoa___>
adapter srst pulse_width 200
<borneoa___>
adapter srst delay 1100
<borneoa___>
Values taken by one existing target cfg
MGF_Fabio has quit [Ping timeout: 276 seconds]
nerozero has quit [Ping timeout: 268 seconds]
MGF_Fabio has joined #openocd
merethan has quit [Ping timeout: 256 seconds]
MGF_Fabio has quit [Ping timeout: 240 seconds]
<RolfNoot>
With AP disabled (SWDIO & SWDCLK floating), there's no SRST asserted (reset_config connect_assert_srst) on jlink
<PaulFertser>
RolfNoot: you need to add "srst_only" to reset config to have any srst action at all.
<RolfNoot>
borneoa___: yes, I measured timings of srst delay. They are quite okay
<RolfNoot>
PaulFertser: also not with srst_only
vampirefrog has quit [Remote host closed the connection]
vampirefrog has joined #openocd
<PaulFertser>
RolfNoot: if there's no target defined then OpenOCD doesn't touch SRST either
<RolfNoot>
There is a target but in sleep
<RolfNoot>
With SWDIO & SWDCLK floating
key2 has quit [Ping timeout: 245 seconds]
<PaulFertser>
RolfNoot: I mean target defined in the config
Steffanx has quit [Read error: Connection reset by peer]
<PaulFertser>
RolfNoot: please pastebin -d2 log
dnm has quit [Read error: Connection reset by peer]
key2 has joined #openocd
Steffanx has joined #openocd
nohit has quit [Read error: Connection reset by peer]
<RolfNoot>
PaulFertser: target is define. Okay
dnm has joined #openocd
nohit has joined #openocd
<RolfNoot>
Also: Warn : 'srst_nogate' reset_config option is required
russ has quit [Ping timeout: 245 seconds]
<PaulFertser>
RolfNoot: ah, hm, ok.
sugarbeet has quit [Ping timeout: 245 seconds]
bencoh has quit [Ping timeout: 245 seconds]
<RolfNoot>
Same with srst_nogate
<PaulFertser>
With srst_nogate it should certainly try to assert SRST
<PaulFertser>
But it should pull SRST low for sure.
<PaulFertser>
Using srst_nogate with a target that doesn't support it wouldn't work indeed.
<RolfNoot>
But it doesn't get high
sugarbeet has joined #openocd
<PaulFertser>
Yes, with srst_nogate the core is connected under reset kept low.
<RolfNoot>
I am triggering on rising edge, so I don't se a de-assert
<PaulFertser>
How do you ensure you're able to connect to the target if it e.g. remaps SWD pins very very early in its boot?
<RolfNoot>
PaulFertser: Than it's not able to connect. I have a Delay of 1000mS to prevent 'bricking'
<PaulFertser>
RolfNoot: and how the vendor expects you to recover if you didn't?
<RolfNoot>
PaulFertser: So there's at least a 1000mS window to connect
<RolfNoot>
PaulFertser: it's automatically put in boot code, the user had to deliberately remove it. If he does and put the device in sleep immediately, then there's no option to recover
<RolfNoot>
PaulFertser: 99% of the use cases, the device is put into sleep after sending data (IoT). The only issue is the device needs a short SRST pulse to wake and then attach in order to debug
zjason` has joined #openocd
<RolfNoot>
PaulFertser: But I guess the same is valid for any MCU which doesn't support connect-under-reset which goes into sleep mode
zjason has quit [Ping timeout: 252 seconds]
<PaulFertser>
RolfNoot: I mean how the MCU vendor suggests to recover if the firmware developer didn't add that 1 s delay?
russ has joined #openocd
<RolfNoot>
There's no option for the MCU vendor as well. We worked with Infineon (Cypress at the time) to implement a specific secure mode.
<RolfNoot>
What happens:
<RolfNoot>
PaulFertser: MCU starts with M0+ AP disable. After approx. 100mS M4 starts boot with AP enabled. Then a 1S delay is implemented in boot, next chip setup + user code (main) starts
<PaulFertser>
RolfNoot: guess you can define a custom Tcl proc that would be pulsing srst and then re-examine the target for cases like that.
<RolfNoot>
PaulFertser: we can use KitProg3, which has a SRTS assert implemented to do acquire in the so claaed 'testmode'
<RolfNoot>
PaulFertser: That would be great, where can I find more info on how to implement?
<PaulFertser>
RolfNoot: with "adapter assert srst" command
<RolfNoot>
PaulFertser: problem is that these commands needs to come after init
<PaulFertser>
And then probably "jtag arp_init"
<PaulFertser>
Right
<RolfNoot>
PaulFertser: it won't init without being able to see the CPU ig
<PaulFertser>
RolfNoot: you can add -defer-examine flag to the target
<RolfNoot>
PaulFertser: okay, let me see, will get into that
<RolfNoot>
PaulFertser: I still get Error: Error connecting DP: cannot read IDR after using -defer-examine
shibboleth has joined #openocd
<PaulFertser>
Ah damn that's SWD, and before all the targets that required special tricks like that were JTAG.
<PaulFertser>
RolfNoot: how about just starting openocd twice then, first time without target config with JTAG transport to just pulse SRST?
<RolfNoot>
PaulFertser: Maybe I can set mode to JTAG first, reset and then switch to SWD
<RolfNoot>
PaulFertser: Yes, can that be done in one single run of OpenOCD?
<PaulFertser>
RolfNoot: I'm afraid no. But I didn't look properly for years, probably borneoa___ can give a much better suggestion.
<RolfNoot>
PaulFertser: Otherwise it will be too critical for the 1 sec window after SRST
<PaulFertser>
1 sec should be plenty
<PaulFertser>
(I hope)
<RolfNoot>
PaulFertser: I read multiple questions on the internet about getting devices out of sleep before connecting. Would it be okay if I make an implementation?
<PaulFertser>
RolfNoot: I guess the implementation should be along the lines of allowing connect_assert_srst for the srst_gates_jtag case.
<PaulFertser>
So instead of giving the warning the SRST pulse would be emitted and then the connection attempted.
<RolfNoot>
PaulFertser: Okay, I will have a look.
bencoh has quit [Changing host]
bencoh has joined #openocd
Hawk777 has joined #openocd
tlwoerner has quit [Quit: Leaving]
tlwoerner has joined #openocd
<RolfNoot>
This is the first time I'm looking into this. So we have the following reset config options:
<RolfNoot>
swd_connect(..) in adi_v5_swd.c does the reset although there's no option to do a RESET_CNCT_AFTER_SRST
<RolfNoot>
Would it be an idea to add that option here?
shibboleth has quit [Quit: shibboleth]
<PaulFertser>
RolfNoot: I'd suggest to make a "best effort" version to handle RESET_CNCT_UNDER_SRST when RESET_SRST_NO_GATING isn't set.
<bencoh>
how comes overriding one of the tcl proc isn't enough?
Hammdist has joined #openocd
<PaulFertser>
bencoh: swd wants to examine the target right away after init. Not sure if there's an event that runs before that.
<PaulFertser>
But if there is, one should try it, agree.
<Hammdist>
hi all I'm having trouble connecting to a zybo board (zynq-7000) using openocd. I'm fiddling a bit with tcl files in an attempt to fix this myself but I just thought I'd give the heads up that things don't work out of the box on this target
<bencoh>
PaulFertser: I think one of the functions defined in src/target/startup.tcl should run first
<PaulFertser>
Hammdist: I suggest you use some pastebin to show the log with unaltered upstream configs.
<Hammdist>
specifically the tcl complains about not finding variable $zynq_pl.pld on line 50. as it's not variabled on the previous line I'm going to try just removing the '$'
<bencoh>
RolfNoot: if anything, I'd try overriding the init_board{} tcl func (empty by default)
<PaulFertser>
Hammdist: indeed
<RolfNoot>
@bencoh problem is the adapter AND the swd transport is initialized in the same command. Those have to be separated if one would like to solve it in tcl
<bencoh>
RolfNoot: which one are you using?
<RolfNoot>
bencoh: currently barely anything. just a minimal config to connect PSoC6 with SWD
<RolfNoot>
bencoh: the adapter (de)assert srst commands cannot be used before init, while init fails if the device isn't reset
<bencoh>
by "before init" you mean the init command?
<RolfNoot>
bencoh: yes. I currently have a simple solution as PaulFertser suggested
<Hammdist>
so I have just tested and I am able to connect with GDB without the '$'
<PaulFertser>
Hammdist: good to know. The config has typo and should be fixed.
<RolfNoot>
bencoh: I will propose this solution with a patch. It's actually quite simple to implement. I have the reset pulse working with delays accordingly, but now I run into another issue that PSoC6 won't attach with srst_only
MGF_Fabio has joined #openocd
<borneoa___>
RolfNoot: the command 'dap init' should be able to reconnect SWD after a reset. But the problem is that OpenOCD need to connect SWD after init, then reset and 'dap init' can be issued.