Skip to content

lpender3672/drone

Repository files navigation

drone

Drone project using a raspberry pi pico

Prerequisites

To install and set up cmake first have installed:

Installation

Ensure these are added to the PATH environment variable.
First install pico-sdk in the same directory as the project or elsewhere and set the PICO_SDK_PATH environment variable to the path of the pico-sdk directory. Also update the submodules to get some required build files

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

Then using Developer command prompt for VS2022 in the project directory run the following commands:

mkdir build
cd build
cmake -G “NMake Makefiles” ..

Then to build the project run, while still in the Developer command prompt for VS2022:

nmake

Visual Studio Code Setup

To set up in Visual Studio Code:

  • Ensure that the CMake Tools extension is installed.

In Cmake Extension settings:

  • Add item to CMake.configureEnvironment: PICO_SDK_PATH: (path to pico-sdk)
  • Add Cmake:Generator to: NMake Makefiles

Then set kit to GCC arm-none-eabi

Debug Setup with PicoProbe in Visual Studio Code

This took a while for me to set up so I will outline the requirements and steps to set up debugging with the PicoProbe in Visual Studio Code.

Requirements:

All the debug configurations are set up in .vscode/launch.json.

You will need to specify the path "cortex-debug.openocdPath" in .vscode/settings.json to the path of the openocd executable.
Then run the Pico Debug configuration in Visual Studio Code.

If the GDB times out, ensure that OpenOCD is being called in terminal. If GDB disconnects unexpectedly, ensure that OpenOCD has started correctly, found the PicoProbe interface, and detects a connected pi

When OpenOCD detects the PicoProbe the following message should appear in the terminal:

Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E6633861A34B8E2C

Otherwise check the PicoProbe firmware is installed correctly and the correct drivers are installed using Zadig (https://zadig.akeo.ie/)

If the PicoProbe detects a connected Pico the following message should appear in the terminal:

Info : [rp2040.core0] Cortex-M0+ r0p1 processor detected

If this message does not appear, ensure that the Pico is wired to the PicoProbe correctly and is powered on.

About

Drone project using a raspberry pi pico

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published