Raspberry Pico

From bibbleWiki
Jump to navigation Jump to search

Introduction

Set up Environment Variables

Here are ones I use. I believe the build system rely on PICO_SDK_PATH and PICO_TOOLCHAIN_PATH

# Set up base directory
export PICO_ROOT=/home/$USER/dev/pico
export PICO_SDK_PATH=$PICO_ROOT/pico-sdk
export PICO_TOOLCHAIN_PATH=$PICO_ROOT/gcc-arm-none-eabi-10-2020-q4-major/bin

Get the compiler

This is how I got started.
Unzip and get the latest compiler from https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads

I then extract it to $PICO_ROOT

Clone the SDK

Get the SDK

cd $PICO_ROOT
git clone --recurse-submodules https://github.com/raspberrypi/pico-sdk.git
git clone https://github.com/micro-ROS/micro_ros_raspberrypi_pico_sdk.git

Make the sample

It using CMake so we goto the source make a build directory and make. This should produce a file pico_micro_ros_example.uf2

cd $PICO_ROOT
cd micro_ros_raspberrypi_pico_sdk

mkdir build
cd build
cmake ..
make

Copy to device

So plug in the PICO holding down the boot button

cp pico_micro_ros_example.uf2 /media/$USER/RPI-RP2

Install the micro ros agent

sudo snap install micro-ros-agent
sudo snap set micro-ros-agent daemon=true