Tools & SDK Setup
System Requirment
- OS: Ubuntu/Linux based os
- HDD/SDD: ~3GB
Install dependency
sudo apt-get update
sudo apt-get install git cmake automake autoconf pkg-config
sudo apt-get install libtool libftdi-dev libusb-1.0-0-dev minicom
sudo apt-get install build-essential gcc g++ gdb-multiarch
Download c/C++ SDK
Raspberry Pi Foundation already provided a script for Linux and Raspberry Pi OS, which automatically install prerequisites and download C/C++ SDK.
mkdir ~/pi_pico
cd ~/pi_pico
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk/
git submodule update --init
cd ..
git clone -b master https://github.com/raspberrypi/pico-examples.git
git clone -b master https://github.com/raspberrypi/pico-extras.git
git clone -b master https://github.com/raspberrypi/pico-playground.git
Download and setup toolchain
cd ~/pi_pico
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
tar -xf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
Download FreeRTOS
cd ~/pi_pico
git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git
cd FreeRTOS-Kernel
git submodule update --init --recursive
Add FreeRTOS to your application
export path
Better way to create a script in ~/pi_pico and source before compilation
ROOT_PATH=~/pi_pico
export PICO_SDK_PATH=$ROOT_PATH/pico-sdk
export PICO_EXAMPLES_PATH=$ROOT_PATH/pico-examples
export PICO_EXTRAS_PATH=$ROOT_PATH/pico-extras
export PICO_PLAYGROUND_PATH=$ROOT_PATH/pico-playground
export PICO_PLATFORM=rp2040
export PICO_TOOLCHAIN_PATH=$ROOT_PATH/gcc-arm-none-eabi-10.3-2021.10/bin
if [ ! -d $ROOT_PATH/FreeRTOS-Kernel ]; then
echo "FreeRTOS-Kernel is not present"
else
export FREERTOS_KERNEL_PATH=$ROOT_PATH/FreeRTOS-Kernel
fi
if [ ! -f $ROOT_PATH/picotool/build/picotool ]; then
echo picotool is not present
elif [[ $PATH != *"$ROOT_PATH/picotool/build"* ]]; then
export PATH=$PATH:$ROOT_PATH/picotool/build
fi
so, paste above script into a file called setenv.sh and source before compilation
source setenv.sh
Download and Setup Picotool
cd ~/pi_pico
git clone -b master https://github.com/raspberrypi/picotool.git
cd picotool
mkdir build
cd build
cmake ../
make
sudo make install
Download and Setup Picoprobe
cd ~/pi_pico
git clone -b master https://github.com/raspberrypi/picoprobe.git
cd picoprobe
mkdir build
cd build
cmake ../
make
Download and Setup Compiler OpenOCD
This tool will be used for debugging pico, if you don't want to debug then skip this step
cd ~/pi_pico
git clone https://github.com/raspberrypi/openocd.git --branch rp2040 --depth=1
cd openocd
./bootstrap
./configure --enable-picoprobe --enable-ftdi --enable-sysfsgpio --enable-bcm2835gpio
make
©2023-2024 rculock.com