6 years, 7 months ago.

Anybody using pyOCD on Rasbian/Raspberry Pi?

Hi, I have a K66 Freedom board which I want to reset via pyOCD. While my reset script works reliably from a Windows 10 machine, I have many problems if I use the same script from Linux. I use Rasbian and launch the script froma Raspberry Pi.

The script looks like this:

reset_board

from pyOCD.board import MbedBoard

import logging
logging.basicConfig(level=logging.INFO)

board = MbedBoard.chooseBoard(return_first=True)

target = board.target
target.reset()

and most of the times I get a reading error like the following one

output

root@raspberrypi:/home/pi/zambys# 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 0311000041114e4500453003b60f0030a6e1000097969900 read thread exited

Has anybody had these kinds of problemsn?

Cheers, zambys

Be the first to answer this question.