Skip to content

Fix exec command#259

Open
diggit wants to merge 2 commits intosquare:masterfrom
diggit:fix_exec_command
Open

Fix exec command#259
diggit wants to merge 2 commits intosquare:masterfrom
diggit:fix_exec_command

Conversation

@diggit
Copy link
Contributor

@diggit diggit commented Feb 21, 2026

If exec_command is called before open, DLL opens connection to some probe it picks, which then causes issues when open is called afterwards.

resolves #254

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.
Copy link
Contributor

@hkpeprah hkpeprah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()

@diggit
Copy link
Contributor Author

diggit commented Feb 22, 2026

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.
I hit esc multiple times and then I see

API Error: API JLINK_ExecCommand function called before JLINKARM_Open()
API Error: API JLINK_ExecCommand function called before JLINKARM_Open()
fish: Job 1, './experiments.py' terminated by signal SIGSEGV (Address boundary error)

in the stdout.

Then I tried each exec_command from disable_dialog_boxes individually.
Do not cause error and following open works normally:

  • self.exec_command('SilentUpdateFW')
  • self.exec_command('SuppressInfoUpdateFW')
  • self.exec_command('SetBatchMode = 1')
  • self.exec_command("SuppressControlPanel")

Cause error (need probe opened, auto calls open when the probe is attached):

  • self.exec_command("HideDeviceSelection = 1")
  • self.exec_command("DisableInfoWinFlashDL")
  • self.exec_command("DisableInfoWinFlashBPs")

@hkpeprah
Copy link
Contributor

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.

@diggit
Copy link
Contributor Author

diggit commented Feb 22, 2026

My setup is mostly described on #254.
In summary:
OS: Archlinux (up to date)
J-Link 9.14a, 9.16, 9.20
Probe: J-Link Base compact 12.0

I would suspect the change of behavior in some recent dll.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't connect to the emulator

2 participants