Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Troubleshooting PyOCD Issues

Troubleshooting PyOCD Issues

ChaitanyaV_61
Employee
Employee
50 questions asked 25 likes received 25 sign-ins

This article addresses issues related to PyOCD encountered when debugging Mbed™ OS applications.

What is PyOCD?

 

PyOCD is an open-source Python library used for programming and debugging microcontrollers using CMSIS-DAP.

Support for Cypress targets was added in PyOCD release 0.16.1. Therefore, you must have PyOCD version 0.16.1 or later to debug targets manufactured by Cypress. The list of supported platforms can be found on Mbed OS Cypress Partner page.

Run the following command from a terminal window to determine the version of PyOCD installed:

  • pyocd –-version

Errors, Reasons and Solutions

 

You may note the following errors in the command output:

(1) Error: Unsupported board found 1901

Capture.JPG

Reason: Using versions older than 0.16.1 will result in the following error; any connection to the target using gdb will fail.

Solution: Upgrade to the latest stable version of PyOCD using the command:

    • pip install -U pyocd

(2) Error: Operation not supported or unimplemented on this platform

Capture.JPG

Reason: You may be using PyOCD version 0.17.0. This bug was fixed in the newer versions.

Solution: Upgrade to latest stable version of PyOCD.

(3) Error: AttributeError: 'CY8C6xxA' object has no attribute 'options'

pastedImage_14.png

Reason: PyOCD version 0.21.0 reportedly has a bug in the Cypress target scripts.

Workaround: Update the files target_CY8C6xx7.py and target_CY8C6xxA.py located in the Python installation directory at the path: C:\Python\Lib\site-packages\pyocd\target\builtin\

Make the following changes in line 221 and 223 in target_CY8C6xx7.py:

pastedImage_26.png

Make the following changes in line 412 and 414 in target_CY8C6xxA.py:

pastedImage_27.png

Solution: This issue is fixed in PyOCD version 0.22.0. Upgrade to this version or later. To upgrade to specific versions, use the following command

    • pip install pyocd==0.22.0

(4) Error: Error in services launch sequence Starting pyOCD GDB Server timed out.

pastedImage_23.png

Reason: The kit is not in DAPLink mode. PyOCD requires CMSIS-DAP support on the target, which is available on Cypress kits through DAPLink mode.

Solution: Use the firmware loader to upgrade KitProg3 to the latest version which supports DAPLink, and then switch the kit into DAPLink mode using the mode switch button.

 

Translation from Japanese: PyOCDの問題のトラブルシューティング - KBA228421 - Community Translated (JA)

Source: KBA228421

 

0 Likes
1886 Views