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

Windows10 pylink.JLink() fail #45

Open
murphyzhao opened this issue Dec 7, 2018 · 4 comments
Open

Windows10 pylink.JLink() fail #45

murphyzhao opened this issue Dec 7, 2018 · 4 comments

Comments

@murphyzhao
Copy link

murphyzhao commented Dec 7, 2018

Windows10 pylink.JLink() fail:

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    jlink = pylink.JLink()
  File "build\bdist.win-amd64\egg\pylink\jlink.py", line 249, in __init__
  File "build\bdist.win-amd64\egg\pylink\library.py", line 239, in __init__
  File "build\bdist.win-amd64\egg\pylink\library.py", line 277, in load_default
  File "build\bdist.win-amd64\egg\pylink\library.py", line 331, in load
  File "D:\env\tools\Python27\lib\ctypes\__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "D:\env\tools\Python27\lib\ctypes\__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 不是有效的 Win32 应用程序。

Have problem PYTHON ENV:

$ python
Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

No problem PYTHON ENV:

PS D:\Git\github\pylink> python
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
@MJBina
Copy link

MJBina commented Dec 18, 2018

I am having the same issue.
It appears to be an issue with 64-bit Python and 32-bit PyLink. Correct?

I am using SEGGER 6.40. I noticed that there is a 64-bit JLink .DLL JLink_x64.dll. Could this help?
I also noticed that SEGGER has a Beta version (v6.41a) of 64-Bit JLink (link below) Has anyone tried this?
https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPackBeta

Traceback (most recent call last):
  File "C:\projects\piranha\assembly_tester\dev\python\test_pylink.py", line 6, in <module>
    jlink = pylink.JLink()
  File "C:\Program Files\Python37\lib\site-packages\pylink\jlink.py", line 249, in __init__
    lib = library.Library()
  File "C:\Program Files\Python37\lib\site-packages\pylink\library.py", line 239, in __init__
    self.load_default()
  File "C:\Program Files\Python37\lib\site-packages\pylink\library.py", line 277, in load_default
    return self.load(path)
  File "C:\Program Files\Python37\lib\site-packages\pylink\library.py", line 331, in load
    self._lib = ctypes.cdll.LoadLibrary(tf.name)
  File "C:\Program Files\Python37\lib\ctypes\__init__.py", line 434, in LoadLibrary
    return self._dlltype(name)
  File "C:\Program Files\Python37\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

My Environment - has problem

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\>python
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

@hkpeprah
Copy link
Contributor

This is a known bug. I just merged in a PR #25, which should remedy this issue for you if you upgrade to 0.1.3 of the package.

@MJBina
Copy link

MJBina commented Dec 19, 2018

That has resolved the issue...
Thank you very much!

@murphyzhao
Copy link
Author

@hkpeprah Thanks

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

No branches or pull requests

3 participants