How to Set Up Raspberry Pi Pico
Getting Started with Raspberry Pi Pico : Set Up Raspberry Pi Pico
Raspberry Pi Pico, the new breakout board for RP2040 microcontroller from Raspberry Pi foundation. In this tutorial, we are going to set up a Pico board for programming. Raspberry Pi Pico RP2040 microcontroller support both MicroPython and c/c++.
Raspberry Pi Pico can be programmed and reprogrammed in two ways either using the SWD (Serial Wire Debug Port) or we can use the USB mass storage device mode. For beginners using Raspberry Pi Pico, we recommend you use the USB mass storage device mode for programming. Simply drag and drop a file onto the Pico which appears as a mass storage device in your computer.
How to set up the Raspberry Pi Pico
Use the following steps to program Raspberry Pi Pico using USB mode
- Depower the Pico Board
Press and hold the BOOTSEL button on the Pico (Boot selection button) and then power the board by connecting to your computer using a micro USB cable. Release the BOOTSEL button once the drive RPI-RP2 appears on your computer
- Drag and drop the "UF2" file and drop it onto the USB mass storage device.
- The disk will now write that file to flash and restart the Pico Board , after this pico disappear from USB devices.
Based on which programming language you are choosing to program the Pico board, step 4 changes.
Getting Started with MicroPythonDownload UF2 File for Micropython
Getting Started with C/C++Download the Blink UF2
What is a UF2 file ?
UF2 is a file format designed by Microsoft that stands for USB Flashing Format. This format was designed for PXT
(also known as Microsoft MakeCode) and allows for programming boards over the Mass Storage Class (removable drive).
The BOOTSEL is short for boot selection, which switches Pico between two start-up modes when it is first turned on. The USB port can be used to access the USB bootloader (BOOTSEL mode) stored in the RP2040 boot ROM. The UF2 file contains the MicroPython firmware, this is a small file that contains MicroPython for Pico.
When we drag and drop the MicroPython firmware file onto Pico, the firmware is flashed onto its internal storage. Pico switches out of the special mode you put it in with the BOOTSEL button, flashes the new firmware, and then loads it - now your Pico is running MicroPython.
Note: The USB boot code is stored in ROM on RP2040, so can not be accidentally overwritten
The next blog post is about programming Raspberry Pi Pico. Stay tuned for more blogs and tutorials on Raspberry Pi Pico.