Comments (7)
Should be available in the latest release. Thanks for the patch!
from pylink.
This is currently not work? open()
does take a serial_no
and ip_addr
parameter.
from pylink.
no, because to use this feature, the call to dll function JLINKARM_SelectIP
should be
JLINKARM_SelectIP('tunnel' + str(serial_no), 19020)
as the current API is
if ip_addr is not None:
addr, port = ip_addr.split(':')
if serial_no is None:
result = self._dll.JLINKARM_SelectIP(addr.encode(), int(port))
if result == 1:
raise errors.JLinkException('Could not connect to emulator at %s.' % ip_addr)
else:
# Note: No return code when selecting IP by serial number.
self._dll.JLINKARM_EMU_SelectIPBySN(int(serial_no))
executing JLink.open(self, ip_addr='tunnel', serial_no=123456789)
will crash in the split(':')
and JLink.open(self, ip_addr='tunnel:19020', serial_no=123456789)
will call JLINKARM_EMU_SelectIPBySN
instead of JLINKARM_SelectIP
.
from pylink.
Ah, okay. This sounds like the ip_addr
should be tunnel:123456789:19020
, and the split
is the issue. Seems like what we should be doing is:
addr, port = ip_addr.rsplit(':', 1)
>>> addr, port = 'tunnel:123456789:19020'.rsplit(':', 1)
>>> print(addr)
tunnel:123456789
>>> print(port)
19020
I'm open to a pull-request, otherwise I can put one up later in the week.
from pylink.
yes, it would work. but don't you think it would be less confusing to keep providing the serial number trough the serial_no
keyword argument?
from pylink.
It would. My hesitation is that we'd be treating tunnel
as a reserved keyword, such that we'd have something like:
addr, port = ip_addr.split(':')
if addr == 'tunnel' and serial_no:
addr += ':%s' % (serial_no)
# Connect here...
elif serial_no is None:
pass
else:
pass
from pylink.
looks good! a last question, should we raise a ValueError if the ip address is tunnel:1234
and the serial_no=None
? I guess it would make sense, as the serial number is a required argument in that case.
I would propose this:
if ip_addr is not None:
addr, port = ip_addr.split(':')
+ if addr == 'tunnel':
+ if serial_no is not None:
+ addr += ':' + str(serial_no)
+ serial_no = None
+ else:
+ raise AttributeError('connection trough tunnel requires a valid serial number.')
if serial_no is None:
...
from pylink.
Related Issues (20)
- RTT Autodetect works with J-Link RTT Viewer, but for pylink I have to explicitly provide the address HOT 1
- AttributeError: module 'pylink' has no attribute 'JLink'. HOT 9
- Loading library on Aarch64 fails because pylink attempts to load 32-bit library HOT 2
- pylink.errors.JLinkFlashException: Could not write target memory when trying to flash a .hex file. HOT 1
- Error when programming or erasing Kinetis microcontrollers HOT 3
- pylink.errors.JLinkException: Could not find supported CPU HOT 24
- pylink.JLink.rtt_read blocks indefinitely when no data is available? HOT 1
- Specify JLinkScript file HOT 1
- CORESIGHT_AddAP doesn't execute HOT 6
- Can support C-JTAG HOT 14
- Unlocking STM32L0 HOT 1
- custom ResetTarget function in pylink HOT 7
- Error "Failed to perform RAMCode-sided Prepare()" Fail "JLinkFlashException: Unspecified error." HOT 2
- rtt_write only working when I have JLink RTT viewer open HOT 8
- Downloading Firmware image to Cortex Fails HOT 2
- 1.2.0: Some tests are incompatible with Python 3.12 HOT 2
- Do I need to use jlink.connect before doing jlink.rtt_start? HOT 2
- Square: Thanks For Developing pylink (Not An Issue - Just Kudos) HOT 1
- REQ: Please Add Support For: Keil JLinkEFM8.dll HOT 3
- pylink.errors.JLinkException: Unspecified error - during connect() HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylink.