pyOCD
pyOCD copied to clipboard
No Connected Debug Probes when running executable built with PyInstaller
I am using pyocd version 0.36 with Python 3.11 and have used PyInstaller to build an executable of a script that uses pyocd. My script includes the use of ConnectHelper to open a session with an STM32 board. When I run the script (.py file), the node is found and everything works correctly. However, when I run the built executable, I encounter the following error:
←[31mNo connected debug probes←[0m
Steps to Reproduce:
-
Write a Python script that uses pyocd to connect to an STM32 board.
-
Use PyInstaller to build an executable from this script.
-
Run the executable.
Expected Behavior:
The executable should successfully connect to the STM32 board, just as the script does when run directly with Python.
Actual Behavior:
The executable fails to find any connected debug probes and outputs the following error message:
←[31mNo connected debug probes←[0m
Additional Information:
- Python Version: 3.11
- pyocd Version: 0.36
- PyInstaller Command Used: pyinstaller --onefile my_script.py
- Operating System: [Windows 10]
Questions:
- Is there a known issue with pyocd and PyInstaller?
- Are there specific steps or configurations needed to ensure pyocd works in a PyInstaller-built executable?
- Could there be a missing dependency or path issue in the executable that isn't present when running the script directly?
Any help or guidance on resolving this issue would be greatly appreciated.
Thank you!