Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detecting when the ST-Link or Target was disconnected #1151

Closed
gustavolaureano opened this issue Jun 6, 2021 · 4 comments
Closed

Detecting when the ST-Link or Target was disconnected #1151

gustavolaureano opened this issue Jun 6, 2021 · 4 comments

Comments

@gustavolaureano
Copy link
Contributor

Hi,

Is there a way to detect, after opening the ST-Link, when the target or the ST-Link was disconnected?

I am coding an application that requires periodic polling of the target's RAM, but also requires to detect when the target or the ST-Link was disconnected (or not yet connected) and reconnect (in hotplug) as soon as it finds the target / stlink again.

During some tests on Linux I could not get any error from stlink_read_mem32() or even stlink_status() when removing the target on the fly.. my solution was to always close and open the stlink when starting the next reading, which works without problems on Linux, but keeps giving me random "denied access" errors on Windows, something related to the libusb.

Thanks!

Gustavo

@Ant-ON
Copy link
Collaborator

Ant-ON commented Jun 6, 2021

@gustavolaureano, Hi!

I improved the command status check.
You can try:
https://github.com/Ant-ON/stlink/commits/connect_under_reset_rework

@Nightwalker-87
Copy link
Member

@gustavolaureano Have you had the chance to try in the meanwhile?

@gustavolaureano
Copy link
Contributor Author

@gustavolaureano Have you had the chance to try in the meanwhile?

Hi, unfortunately not yet, I will return to this project in the coming weeks, then I report back here :)

@Nightwalker-87
Copy link
Member

This issue is now closed due to inactivity.
Please also note that any version prior to v1.7.0 is unsupported according to our #Security Policy.
Should the problem persist, please retry with the latest version in the develop branch.
If this is the case, one should then open a new ticket.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants