1Introduction
This application note provides a guide to how to use pyocd in Eclipse based on APM32 SDK.pyOCD is an open source Python package for programming and debugging Arm Cortex-M microcontrollers using a variety of supported USB debug probe types.It is fully cross-platform and supports Linux, macOS, and Windows.It has built in support for up to 70 popular MCUS.In addition, almost all Cortex-M devices on the market are supported by the use of CMSIS-DAP.pyOCD can also used as GDB Service with GDB debugging chip, supporting multiple probes, such as CMSIS-DAP v1(HID), CMSIS-DAP v2(WinUSB), and SEGGER J-Link.pyOCD allows users to use commands to: burn, erase, single step, stop, set breakpoints, run at full speed, lock the chip, read/write peripheral registers, read/write storage, and so on.
2 Install python
Down load link :https://www.python.org/
The screenshot below shows the download operation.
Figure 1.Download operation
Figure 2.python software
Note check “Add python.exe” to PATH, keep the rest as default.
3 Install pyOCD
Shortcut key:Window + R,enter cmd and then python, as shown in the following figure,
the contents of the red box are displayed to indicates that python can run properly.
Enter “exit()” to exit python, as shown in the following figure.
Enter”pip install –U pyocd” to intall pyOCD, as shown in the following figure.
Enter”pip install -U libusb” to intall libusb library, as shown in the following figure.
4 pyOCD basic command
Command “pyocd list ” to identify CMSIS-DAP, as shown in the following figure.
Command “pyocd list –targets –pack D:\Desktop\APM32F0xx_SDK_v1.7\Package\
Geehy.APM32F0xx_DFP.1.0.8.pack ” to look up the models supported by PACK package,
As shown in the following figure.
Note: the storage path of “Geehy.APM32F0xx_DFP.1.0.8.pack” that is stored in the APM32 SDK Package folder.
5 Use of pyOCD on Eclipse
APM32F030R8 is used as an example.
Prepare the following materials:
a、APM32F030R8 MINI Board
b、Geehy Link
c、APM32F0xx_SDK_v1.7
Configure the pyOCD environment on Eclipse,as shown in the following figure.
Add the storage path of pyocd.exe
Configure the pyOCD debug environment on Eclipse,as shown in the following figure.
Debug configuration
Note: –pack + the storage path of “Geehy.APM32F0xx_DFP.1.0.8.pack” that is stored in the APM32 SDK PackageFolder.
Debug successfully