Raspberry Pico: The Simple Startup with PlatformIO

Prerequisites

  • Visual Studio Code
  • Git
apt install git
snap install --classic code

Wizio Pico Setup

Platform has been successfully installed
Platform Manager: Installing git+https://github.com/Wiz-IO/wizio-pico
git version 2.25.1
Platform Manager: wizio-pico @ 1.0.2+sha.7509f95 has been installed!
Tool Manager: Installing git+https://github.com/Wiz-IO/framework-wizio-pico.git
git version 2.25.1
Tool Manager: framework-wizio-pico @ 1.0.2+sha.9df3291 has been installed!
Tool Manager: Installing toolchain-gccarmnoneeabi @ =1.70201.0
Tool Manager: Warning! More than one package has been found by toolchain-gccarmnoneeabi @ =1.70201.0 requirements:
- platformio/toolchain-gccarmnoneeabi @ 1.50401.210106
- maxgerhardt/toolchain-gccarmnoneeabi @ 1.40903.0
Tool Manager: Please specify detailed REQUIREMENTS using package owner and version (showed above) to avoid name conflicts
Tool Manager: toolchain-gccarmnoneeabi @ 1.70201.0 has been installed!
Tool Manager: Installing git+https://github.com/Wiz-IO/tool-wizio-pico.git
git version 2.25.1
Tool Manager: tool-wizio-pico @ 1.0.0+sha.76bba42 has been installed!
The platform 'https://github.com/Wiz-IO/wizio-pico' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.
********************************************************************************
There is a new version 5.1.1 of PlatformIO available.
Please upgrade it via `PlatformIO IDE Menu: Upgrade PlatformIO`.
Changes: https://docs.platformio.org/en/latest/history.html
********************************************************************************

Create a Pico Project

.
├── include
│ ├── pico
│ │ └── config_autogen.h
│ └── README
├── lib
│ └── README
├── platformio.ini
├── README.md
├── src
│ └── main.c
└── test
└── README

Blinking LED Example

/* 
* ---------------------------------------
* Copyright (c) Sebastian Günther 2021 |
* |
* devcon@admantium.com |
* |
* SPDX-License-Identifier: BSD-3-Clause |
* ---------------------------------------
*/
#include <stdio.h>
#include <stdbool.h>
#include "pico/stdlib.h"
int LED_BUILTIN = 25;
int LED_GREEN = 15;
void setup() {
stdio_init_all();
gpio_init(LED_BUILTIN);
gpio_set_dir(LED_BUILTIN, GPIO_OUT);
gpio_init(LED_GREEN);
gpio_set_dir(LED_GREEN, GPIO_OUT);
}
void blink() {
gpio_put(LED_BUILTIN, 1);
gpio_put(LED_GREEN, 1);
sleep_ms(750);
gpio_put(LED_BUILTIN, 0);
gpio_put(LED_GREEN, 0);
sleep_ms(1050);
}
int main() {
setup();
printf("Hello World\n"); while (true) {
printf(".");
blink();
}
return 0;
}
[env:raspberry-pi-pico]
platform = wizio-pico
board = raspberry-pi-pico
framework = baremetal
upload_port = /media/devcon/RPI-RP2/ ; directory for mass-storage
monitor_port = /dev/ttyACM0 ; directory for usb-over-serial
monitor_speed = 115200
board_build.bynary_type = copy_to_ram
build_flags =
-D PICO_STDIO_USB ; enable stdio over USB
build_unflags = -D PICO_STDIO_UART
Processing raspberry-pi-pico (platform: wizio-pico; board: raspberry-pi-pico; framework: baremetal)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
<<<<<<<<<<<< WIZIO - RASPBERRY PI PICO 2021 Georgi Angelov >>>>>>>>>>>>
CONFIGURATION: https://docs.platformio.org/page/boards/wizio-pico/raspberry-pi-pico.html
PLATFORM: WizIO - Raspberry Pi Pico (1.0.2+sha.7509f95) > WizIO - Raspberry Pi Pico
HARDWARE: RP2040 48MHz, 256KB RAM, 2MB Flash
DEBUG: Current (UF2-MSD) On-board (UF2-MSD, picoprobe-OpenOCD)
PACKAGES:
- framework-wizio-pico 1.0.2+sha.9df3291
- tool-wizio-pico 1.0.0+sha.76bba42
- toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
SDK RASPBERRYPI PI PICO RP2040 ( PICO - SDK110 )
- OPTIMIZATION : -Os
- HEAP : 2048
- STACK : 2048
- BOOT : w25q080
- BINARY TYPE : default [ memmap_default.ld 0x10000000 ]
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 4 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
DONE
Checking size .pio/build/raspberry-pi-pico/APPLICATION.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 4.8% (used 12520 bytes from 262144 bytes)
Flash: [ ] 1.8% (used 37148 bytes from 2097152 bytes)
Configuring upload protocol...
AVAILABLE: UF2-MSD
CURRENT: upload_protocol = UF2-MSD
Uploading...
Converting to UF2
Start address: 0x10000000
FamilyID: 0xe48bff56
Output size: 81408 bytes
Wrote 81408 bytes to /home/devcon/Documents/PlatformIO/Projects/pico/.pio/build/raspberry-pi-pico/APPLICATION.uf2
==================== [SUCCESS] Took 2.06 seconds ====================

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store