---
title: "How to debug Surf5 project in VSCODE"
url: "https://maker.wiznet.io/jaden/projects/how-to-debug-surf5-project-in-vscode/"
markdown_url: "https://maker.wiznet.io/jaden/projects/how-to-debug-surf5-project-in-vscode/md"
type: "WCC: WIZnet Created Content"
author: "jaden kim"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "jaden kim"
published: "2024-01-22"
language: "en"
tags: ["surf5-contest-ref"]
likes: 2
views: 3154
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# How to debug Surf5 project in VSCODE

> How to debug Surf5 project in VSCODE

Original author: jaden kim

## Article

## Surf 5 Debugger

### How to debug Surf5 in VSCODE[​](https://docs.wiznet.io/Product/Open-Source-Hardware/surf5/getting-started/debugger-surf5#how-to-debug-surf5-in-vscode)

This guide is based on Surf5's default example, Loopback

## 1. Install Python

Install [Python](https://www.python.org/downloads/) 3.10 or later

## 2. Install pyocd

In a CMD command window, write the **python -m pip install -U pyocd** command to install pyocd.
(Depending on your PC environment, you may need to write the command **python3 -m pip install -U pyocd**).

![](https://docs.wiznet.io/img/osh/surf5/pyocd_install.png)

## 3. Check Debugger connection.

![](https://docs.wiznet.io/img/osh/surf5/pyocd_list.png)

You can check PC and Debugger connection using **pyocd list** command

## 4. Add W7500 in pyocd CMSIS-PACK

![](https://docs.wiznet.io/img/osh/surf5/Add_DFP1.png)

Make Directory named **WIZnet.W7500_DFP.1.0.0** in **W7500X-SURF5/tools**

![](https://docs.wiznet.io/img/osh/surf5/Add_DFP2.png)

Make Directory named **Flash** in **W7500X-SURF5/tools/WIZnet.W7500_DFP.1.0.0**

![](https://docs.wiznet.io/img/osh/surf5/Add_DFP3.png)
Download the W7500 Flash [file](https://docs.wiznet.io/img/products/w7500/overview/w7500_128_flm.zip) and copy in **W7500X-SURF5/tools/WIZnet.W7500_DFP.1.0.0/Flash**

![](https://docs.wiznet.io/img/osh/surf5/Add_DFP4.png)
Download the WIZnet.W7500_DFP.pdsc [file](https://docs.wiznet.io/img/osh/surf5/WIZnet.W7500_DFP.zip)and copy in **W7500X-SURF5/tools/WIZnet.W7500_DFP.1.0.0**

![](https://docs.wiznet.io/img/osh/surf5/Add_DFP5.png)
The WIZnet.W7500_DFP.pdsc file is an XML file that sets the device name and Core, Clock, and Memory areas.

![](https://docs.wiznet.io/img/osh/surf5/Add_DFP6.png)
Now you can see the W7500 added with the **pyocd list --targets** command.

## 5. Set GDB path and Excutable(.elf) path

[Download](https://docs.wiznet.io/img/osh/surf5/launch.zip) launch.jason and edit executable path and gdbpath

![](https://docs.wiznet.io/img/osh/surf5/Set_GDB_Path.png)

Set the executable path to the path of the .elf file you want to debug and the GDB path to the path of the ARM TOOL CHAIN you installed.

## 6. Install Cortex-Debug Extension

![](https://docs.wiznet.io/img/osh/surf5/Debug.png)

Install Cortex-Debug Extension in VSCODE

## 7. Run Debug

![](https://docs.wiznet.io/img/osh/surf5/Debug1.png)

You can click **Run and Debug** to enter debug mode.

![](https://docs.wiznet.io/img/osh/surf5/Debug2.png)

By clicking the play icon you can run the debug in debug mode.

![](https://docs.wiznet.io/img/osh/surf5/Debug3.png)

---

Source: https://maker.wiznet.io/jaden/projects/how-to-debug-surf5-project-in-vscode/
