Skip to content

Raspberry Pi RP2040 Template for fast and easy development structure

License

Notifications You must be signed in to change notification settings

mborko/pico-template

Repository files navigation

Raspberry Pi RP2040 Template

Raspberry Pi RP2040 Template for fast and easy development structure

Pico SDK

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

## Add pico-sdk Path to your environment
echo export PICO_SDK_PATH=$PWD >> ~/.bashrc

Packages

Debian based

apt update && apt install -y cmake make gcc g++ openssl libssl-dev cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib 

Arch

pacman -S arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib cmake autoconf git
yay -S picotool openocd-picoprobe

HomeBrew

brew install cmake
brew install gcc-arm-embedded

Programming

    1. get SDK
    2. cmake example
    3. flash it
    4. debug it
    5. be happy!

Programming examples on your Pico

First of all check the CMakeLists.txt File, if the desired subdirectories are included (e.g. add_subdirectory(blink)) and execute the following commands in this repository:

rm build -rf
mkdir build && cd build
cmake ..
make

Afterwards you can mount your Pico as described in Chapter 3.2.2 of "Getting Started with Raspberry Pi Pico" [1]. "Removing power from the board does not remove the code. When the board is reattached to power, the code you have just loaded will begin running again. If you want to upload new code to the board (and overwrite whatever was already on there), press and hold the BOOTSEL button when applying power to put the board into Mass Storage mode."

$ sudo dmesg | tail
[ 371.973555] sd 0:0:0:0: [sda] Attached SCSI removable disk
$ sudo mkdir -p /mnt/pico
$ sudo mount /dev/sda1 /mnt/pico
$ ls /mnt/pico/
INDEX.HTM INFO_UF2.TXT
$ sudo cp blink/blink.uf2 /mnt/pico
$ sudo sync

FreeRTOS Examples

The FreeRTOS Examples need the Kernel Sources, so don't forget to load the submodule with git submodule update --init in this repository. This will load the Kernel into freertos/FreeRTOS/FreeRTOS-Kernel.

Resources

  • "The official documentation for Raspberry Pi computers and microcontrollers" raspberrypi.com

Pico Datasheets

CMake

FreeRTOS

CAN

MQTT with Pico W

About

Raspberry Pi RP2040 Template for fast and easy development structure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published