question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

using pyOCD for resetting K66F board via Raspberry PI

See original GitHub issue

Hi, 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:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
c1728p9commented, Oct 10, 2017

Hi @zambs76, I have had a similar experience with any board running on the Raspberry PI. I think it had USB stability issues.

0reactions
flitcommented, Feb 2, 2019

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found