Conversation
If called before open, DLL opens connection to _some_ probe it picks which then causes issues when `open` is called afterwards. resolves square#254
I hope the one line change counts too.
hkpeprah
left a comment
There was a problem hiding this comment.
I'm not sure this is universally true. I believe it depends on the command being used. For example, I have no debugger attached and am able to do this:
import pylink
>>> jl = pylink.JLink()
>>> jl.disable_dialog_boxes()
|
If I revert back, detached J-Link and do... import pylink
import time
jl = pylink.JLink()
jl.disable_dialog_boxes()
time.sleep(1)...and nothing else. I get "probe selection" popup window. J-Link SW 9.20. in the stdout. Then I tried each
Cause error (need probe opened, auto calls
|
|
Could you provide some details about your setup? Is this on Windows, Linux or OSX? It could be possible that behaviour is changed in later versions of the SDK and/or that behaviour depends on some combination of command + platform + SDK version. |
|
My setup is mostly described on #254. I would suspect the change of behavior in some recent dll. |
|
Faced with the same problem as #254 when working with pyOCD (nRF52840-DK), I too had started to look into it (in short, pyOCD also calls @diggit, my findings seem to confirm yours (my OS is also Linux):
Although opening the emulator may not be required for all commands, I support this merge request (AFAICT). A question: is calling Thanks. |
|
@dottspina Thanks for the additional metric. @diggit , I've been thinking about how to approach this without making
What do you think? I think this would make the behaviour transparent to those who upgrade to newer SDK versions while preserving existing behaviour for those on older SDKs. |
|
That sounds good!
a) defer whole sequence (easiest to implement)
c) deduplicate calls of same functions and collapse complementary calls and defer
d) ? |
|
I wouldn't worry about de-duplicating the calls made. On Windows, some dialog boxes will open when you do |
With JLink DLL versions 9.14 and above, calling disable_dialog_boxes() before open() puts the pylink adapter into an inconsistent state. As a result pyOCD will fail to open the J-Link emulator, and possibly segfault. The approach here is to preserve the current behavior as much as possible, while allowing to develop/test/use pyOCD with current versions of the JLink DLL. See: - pyocd#1925 "Jlink V9.22 No emulator with serial number" - pyocd#1927 "probe: jlink: open emulator before issuing commands" - square/pylink#259 "Fix exec command"
If
exec_commandis called beforeopen, DLL opens connection to some probe it picks, which then causes issues whenopenis called afterwards.resolves #254