Before attempting this further, the deployment of RP2040 SDK is required.
Here is the guide for doing that: https://hackaday.io/project/177166-rp2040-quick-setup-guide-for-win10-and-ft2232h
VSCode Logo in the picture courtesy of: https://www.reddit.com/r/vscode/comments/657x24/vscode_icon_with_a_transparent_center_because_the/
Build instructionsStep 1
https://hackaday.io/project/177166-rp2040-quick-setup-guide-for-win10-and-ft2232h
Step 2
On default, this launch.json generator inside doesn't point to the modified config files for FT2232H and the search directories are not included.
Going to about line 933, just replace this "v1" with this:
def generateProjectFiles(projectPath, projectName, sdkPath, projects):
oldCWD = os.getcwd()
os.chdir(projectPath)
for p in projects :
if p == 'vscode':
v1 = ('{\n'
' // Use IntelliSense to learn about possible attributes.\n'
' // Hover to view descriptions of existing attributes.\n'
' // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n'
' "version": "0.2.0",\n'
' "configurations": [\n'
' {\n'
' "name": "Pico Debug",\n'
' "cwd": "${workspaceRoot}",\n'
' "executable": "${command:cmake.launchTargetPath}",\n'
' "request": "launch",\n'
' "type": "cortex-debug",\n'
' "servertype": "openocd",\n'
' "gdbPath" : "arm-none-eabi-gdb",\n'
' "device": "RP2040",\n'
' "configFiles": [\n' + \
' "E:/openocd/tcl/interface/ftdi/ft232h-module-swd.cfg",\n' + \
' "E:/openocd/tcl/target/rp2040.cfg"\n' + \
' ],\n' + \
' "svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd",\n'
' "runToMain": true,\n'
' "searchDir": [\n' + \
' "E:/openocd/tcl"\n' + \
' ],\n'
' }\n'
' ]\n'
'}\n')
Note: Be sure to replace the drive letter with wherever you placed the OpenOCD and the RP2040 SDK. In this example it is at E drive.
Step 3
Build it by hitting F7! Once it's done, click on the "Debug button":
Step 4
That's it! You are debugging your own RP2040 program now using VSCode and FT2232H!
Comments
Please log in or sign up to comment.