Building a Firmware for Raspberry Pi Pico (live edition)

Опубликовано: 22 Март 2025
на канале: Computer Knowledge Enthusiast
1,232
24

In tonights live broadcast (replayed), we learn how to build a UF2 firmware file for the Raspberry Pi Pico RP2040 Microcontroller board.

Using CMake, Make, the Pico-SDK, geany and a Raspberry Pi 400 (with Rasbian installed) we learn how to make a baremetal firmware project that runs directly on the Pi, removing the need for python interpreters and other libary's.

In this live I will test out instructions I previously wrote, and update them as I need to.

I also take the time to fix an error I introduced in a silly manner.

Please find all the instructions you need build your own firmware below:

-----------------------------------------------

sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi git

mkdir pico-firmware
cd pico-firmware
mkdir ledflash
cd ledflash

touch ledFlash.c
geany ledFlash.c

Source code ##

#include "pico/stdlib.h"

int main() {
const uint LED_PIN = 25;
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
while (true) {
gpio_put(LED_PIN, 1);
sleep_ms(250);
gpio_put(LED_PIN, 0);
sleep_ms(250);
}
}

End Source Code ##

git clone https://github.com/raspberrypi/pico-s...

cd pico-sdk
git submodule update --init
cd ..

cp pico-sdk/external/pico_sdk_import.cmake ./

touch CMakeLists.txt
geany CMakeLists.txt

Source Code ##

d

End Source Code ##

pwd
(get path)

export PICO_SDK_PATH={projet path}/pico-sdk

mkdir build
cd build
cmake ..
make flash_led