This project uses the Raspberry Pi Pico SDK with CMake and the ARM GCC toolchain.
Follow these steps to set up the build environment.
On Debian/Ubuntu:
sudo apt update
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential gitOn Fedora:
sudo dnf install cmake arm-none-eabi-gcc-cs arm-none-eabi-newlib make gitCheck installation:
arm-none-eabi-gcc --version
cmake --versionClone the SDK somewhere on your system (outside this repo):
git clone https://github.com/raspberrypi/pico-sdk.git ~/pico-sdkSet this variable so CMake can find the SDK:
export PICO_SDK_PATH=~/pico-sdkTo make it permanent (bash):
echo 'export PICO_SDK_PATH=~/pico-sdk' >> ~/.bashrc
source ~/.bashrcFrom the code/ directory:
mkdir build
cd build
cmake ..
make -j$(nproc)After building, the firmware file will be generated:
flight_computer.uf2- Hold the BOOTSEL button on the Pico
- Plug the Pico into USB
- Release BOOTSEL
- Copy the UF2 file:
cp flight_computer.uf2 /media/$USER/RPI-RP2/(The mount path may vary depending on your system.)
After the first build, you usually only need:
cd code/build
make -j$(nproc)If you change CMakeLists.txt, run:
cmake ..If something breaks, clean build:
cd code
rm -rf build
mkdir build
cd build
cmake ..
make -j$(nproc)This project uses the SD-card library no-OS-FatFS-SD-SDIO-SPI-RPi-Pico as a Git submodule.
Clone with submodules:
git clone --recurse-submodules <repo-url>If the repository was already cloned without submodules:
git submodule update --init --recursiveAfter pulling updates:
git pull --recurse-submodules
git submodule update --init --recursiveThis project uses:
no-OS-FatFS-SD-SDIO-SPI-RPi-Pico
in SDIO/PIO 4-bit mode.
The library contains a project-specific patch because the SD clock pin is routed differently on this board.
SD pin mapping:
SD_CMD -> GPIO18
SD_DAT0 -> GPIO19
SD_DAT1 -> GPIO20
SD_DAT2 -> GPIO21
SD_DAT3 -> GPIO22
SD_CLK -> GPIO25
The SDIO PIO configuration was modified with:
SDIO_CLK_PIN_D0_OFFSET = 6
The patched submodule commit must be available from the configured submodule remote.