Skip to content

How to debug Surf5 project in VSCODE

How to debug Surf5 project in VSCODE

jaden

Published January 22, 2024

Original author: jaden kim · South Korea

How to debug Surf5 project in VSCODE

Project description

Surf 5 Debugger

How to debug Surf5 in VSCODE​

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

1. Install Python

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

2. Install pyocd


 

3. Check Debugger connection.

3. Check Debugger connection.


 

You can check PC and Debugger connection using pyocd list command

4. Add W7500 in pyocd CMSIS-PACK

4. Add W7500 in pyocd CMSIS-PACK


 

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

 

4. Add W7500 in pyocd CMSIS-PACK


 

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

 

4. Add W7500 in pyocd CMSIS-PACK
Download the W7500 Flash file and copy in W7500X-SURF5/tools/WIZnet.W7500_DFP.1.0.0/Flash

 

4. Add W7500 in pyocd CMSIS-PACK
Download the WIZnet.W7500_DFP.pdsc fileand copy in W7500X-SURF5/tools/WIZnet.W7500_DFP.1.0.0

 

4. Add W7500 in pyocd CMSIS-PACK
The WIZnet.W7500_DFP.pdsc file is an XML file that sets the device name and Core, Clock, and Memory areas.

 

4. Add W7500 in pyocd CMSIS-PACK
Now you can see the W7500 added with the pyocd list --targets command.

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

Download launch.jason and edit executable path and gdbpath

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


 

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

6. Install Cortex-Debug Extension


 

Install Cortex-Debug Extension in VSCODE

7. Run Debug

7. Run Debug



 

You can click Run and Debug to enter debug mode.

7. Run Debug



 

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

7. Run Debug

Comments

Comments