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

Pyocd and Pyinstaller problem. #1733

Open
fabio-ric-silva opened this issue Oct 29, 2024 · 2 comments
Open

Pyocd and Pyinstaller problem. #1733

fabio-ric-silva opened this issue Oct 29, 2024 · 2 comments

Comments

@fabio-ric-silva
Copy link

fabio-ric-silva commented Oct 29, 2024

Solved!! The issue already was put below! Thank you so much!

Hello, there! I hope you all are doing great!

Dears.

I have created a simple graphical interface for selecting the hex file to be written to the target.
In this app, it has a button for testing if the CMSIS-DAP interface is present on the system.

If I execute the script from the python 3.13 (or whatever version) on the system (W10), it works very fine!
But when creating a *.exe from pyinstaller, the app is executed but doesn't find the CMSIS-DAP interface!

I have done hundreds of attempts including --hidden-imports, but, none worked!

Someone had the same problem and could find a solution?

Thanks in advance!

Copy link

sudoQF commented Oct 30, 2024

Hello fabio-ric-silva,
I encountered the same issue while working with python 3.10. To be able to do an executable with pyocd inside you need to manually collect entry point pyocd.probe and collect dynamic libs capstone an also collect some package paths:
datas_probe, hiddenimports_probe = collect_entry_point('pyocd.probe')
capstone_libs = collect_dynamic_libs("capstone")
pyocd_path = get_package_paths('pyocd')[1]
cmsis_path = get_package_paths('cmsis_pack_manager')[1]

added_files = [(pyocd_path, 'pyocd/.'), (cmsis_path, 'cmsis_pack_manager/.')] + datas_probe
hiddenimports = hiddenimports_probe
binaries = capstone_libs

And then when creating the Analysis class:
binaries=binaries,
datas=added_files,
hiddenimports=hiddenimports,

Hope it helps!

@fabio-ric-silva
Copy link
Author

Thank you for your attention! I will study very well your code for a better understanding!

Sincerely;

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

2 participants