rp2040 config vscode env

rp2040
env
Author

dd21

Published

December 25, 2022

Abstract

using 2 pic pico to development

ide is vscode, tools with openOCD.

莓派作为调试器惊醒调试, ide 使用 vscode

Referance

getting-started-with-pico.pdf

ubuntu config pico env # pico_setup_linux

pico set up on arch linux and config picoprobe for debug, flash, as serial port….

git clone https://github.com/raspberrypi/pico-sdk.git –branch master cd pico-sdk git submodule update –init cd .. git clone https://github.com/raspberrypi/pico-examples.git –branch master

install toolChain

sudo pacman -Sy arm-none-eabi-newlib arm-none-eabi-gcc cmake base-devel

flash with another pico swd

pwd:

  • pico/openocd/tcl

excute:

  • sudo ../src/openocd -f interface/picoprobe.cfg -f target/rp2040.cfg -s tlc -c “program /home/dd21/Projects/github/pico/pico-examples/build/blink/blink.elf verify reset exit”

debug

1.start openOCD

  • sudo ../src/openocd -f interface/picoprobe.cfg -f target/rp2040.cfg

    2.start remot gdb debug

  • install gdb-multiarch

  • gdb-multiarch blink.elf

if you see guile2.2.so.1 no such file or dirtory

please install your need version

  • pcman -S guile2.2

then continue to excute above command

3.enter the gdb

  • target remote localhost:3333

config with vscode

使用 vscode 需要注意的点

  • pico_sk_path
  • openOCD 的调试器(我使用的是另外一块 pico)
  • 复制 vscode 调试器配置的时候注意使用 remote 的那个配置, swd 的我失败了
  • 修改 vscode 的 launch.json 中的gdbTarget我们使用的是localhost:3333 - 需要先加载文件sudo openocd -f interface/picoprobe.cfg -f target/rp2040.cfg -s xxxxxxx
  • xxx 所指的是 interface 的位置,如果安装了 openOCD, 则位置在/usr/bin/local/share/openocd/script/
  • local/ share 对应的还有一个 local/bin bin 中的都是可执行文件.
  • 其他的问题大概率是线没有连接好.
  • warning: 修改 runToMain 为”entryPoin”:“main”
  • error: cannot read svd file

create a pico project

cd pico-project-generator excute:

./pico_project.py --gui

if you see import _tkinter # If this fails your Python may not be configured for Tk means you need to install “Tk”

archLinux:

sudo pacman -S install tk

then excute command above you will see a gui like this