This OpenOCD terminal needs to be left open. So go ahead and open another terminal window and start gdb-multiarch
using
$ cd ~/pico/test/build
$ gdb-multiarch test.elf
Connect GDB to OpenOCD, and load the
test.elf binary into flash,
(gdb) target remote localhost:3333
(gdb) load
and then start it running,
(gdb) monitor reset init
(gdb) continue
8.2. Working in Visual Studio Code
If you want to work in Visual Studio Code rather than from the command line you can do that, see
Chapter 7 for
instructions on how to configure the environment and load your new project into the development environment to let
you write and build code.
If you want to also use Visual Studio Code to debug and load your code onto the Raspberry Pi Pico you’ll need to create
a
launch.json file for your project. The example launch-raspberrypi-swd.json in Chapter 7 should work. You need to copy it
into your project directory as
.vscode/launch.json.
8.3. Automating project creation
The pico project generator, automatically creates a "stub" project with all the necessary files to allow it to build. If you
want to make use of this you’ll need to go ahead and clone the project creation script from its Git repository,
$ git clone https://github.com/raspberrypi/pico-project-generator.git
It can then be run in graphical mode,
$ cd pico-project-generator
$ ./pico_project.py --gui
which will bring up a GUI interface allowing you to configure your project, see
Figure 12.
Getting started with Raspberry Pi Pico
8.2. Working in Visual Studio Code 33