using pyOCD for resetting K66F board via Raspberry PI
See original GitHub issueHi, I want to do soem test automation on a K66 Freedom board and I woud like to use the pyOCD library to reset the board. I wrote the following pythoin script:
from pyOCD.board import MbedBoard
import logging
logging.basicConfig(level=logging.INFO)
board = MbedBoard.chooseBoard(return_first=True)
target = board.target
target.reset()
If I run the script from Windows 10 everything works nicely, but as soon as I am trying to use the script from a Raspberry Pi 3 (using Raspbian) I often have reading errorr like the following one
root@raspberrypi:/home/pi/zamb# python reset_board.py
Traceback (most recent call last):
File "reset_board.py", line 6, in <module>
board = MbedBoard.chooseBoard(return_first=True)
File "/usr/local/lib/python2.7/dist-packages/pyOCD/board/mbed_board.py", line 262, in chooseBoard
mbed.link.open()
File "/usr/local/lib/python2.7/dist-packages/pyOCD/pyDAPAccess/dap_access_cmsis_dap.py", line 430, in open
self._packet_count = self._protocol.dapInfo("PACKET_COUNT")
File "/usr/local/lib/python2.7/dist-packages/pyOCD/pyDAPAccess/cmsis_dap_core.py", line 91, in dapInfo
resp = self.interface.read()
File "/usr/local/lib/python2.7/dist-packages/pyOCD/pyDAPAccess/interface/pyusb_backend.py", line 202, in read
self.serial_number)
pyOCD.pyDAPAccess.dap_access_api.DeviceError: Device 0311000041114e45000d3003b60f0045a6e1000097969900 read thread exited
Does anybody have any hints on how to overcoem thsi problem?
Cheers, Zambs
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
using pyOCD for resetting K66F board via Raspberry PI #335
Hi, I want to do soem test automation on a K66 Freedom board and I woud like to use the pyOCD library to...
Read more >How to program boards with pyOCD - Tal Klinger - Medium
You're in the right place, this guide will walk you through on how use pyOCD, earse, flash and reset device. Once you'll control...
Read more >Anybody using pyOCD on Rasbian/Raspberry Pi? - Question
Hi, I have a K66 Freedom board which I want to reset via pyOCD. While my reset script works reliably from a Windows...
Read more >Debugging — PlatformIO latest documentation
PlatformIO Debugging Solution offers a unique debugging experience for productive embedded development. Using our multi-board and multi-architecture ...
Read more >Raspberry Pi and OpenOCD - Lean2
In previous blog posts I used an FTDI module and pure Python code to access the internals of an ARM CPU using the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @zambs76, I have had a similar experience with any board running on the Raspberry PI. I think it had USB stability issues.
Closing this issue as it seems to be a Raspberry Pi problem with USB. If encountered again, you might try passing
--daparg limit_packets=True
, which is also necessary when running under some VMs (notably VirtualBox under Windows).