top of page

Adding MicroPython Firmware to Pico

Edited: Feb. 2024

Introduction

​

As we said in our first module, the Pico can be programmed with different programming languages, MicroPython being one of them. MicroPython is a full implementation of the Python 3 programming language that runs directly on embedded hardware like Raspberry Pi Pico.

​

To get started, we'll need Thonny. Thonny is an integrated development environment for Python that is designed for beginners. It supports different ways of stepping through the code, step-by-step expression evaluation, detailed visualization of the cell stack, and a mode for explaining the concepts of references and heap.

​

​​

What we'll learn

​

In this tutorial, we'll learn how to:

  • Download and configure the Thonny IDE.

  • Download and install the MicroPython firmware on our Raspberry Pi Pico board.

​

​

What we'll need

​

For this tutorial, we'll need the following:

  • A Raspberry Pi Pico or Pico W board.

  • Micro USB cable.

  • A PC or Mac to run Thonny IDE.

  • Internet connection.

Install Thonny

​

  • Install the latest version of Thony on your OS (Windows, macOS, and Linux)

  • Head to the Thonny website and download the Thonny version for your OS. (We'll be using a Windows PC for this tutorial.)

Screenshot (798).png

Thonny website

At this point, we assume you have successfully installed Thonny on your computer.


Open your newly installed Thonny IDE and you should see a similar screen to the one below:

thonny-editor.png

Thonny IDE launch screen

Adding MicroPython firmware to the Pico

​

If you have never used MicroPython on your Raspberry Pi Pico, you will need to add the MicroPython firmware. There are two ways we can do this:

  • The first way is by dragging and dropping a downloaded UF2 file onto the Pico board using our PC.

  • The second method is by downloading the file to our Pico through the Thonny IDE.​

​

1. Drag-and-Drop Method

​

A downloadable UF2 file has been made available to let you install MicroPython more easily, with the following steps below:​

MicroPython-640x360.gif

raspberrypi.org

Steps:

​

1. Using your PC, download the MicroPython UF2 file for Raspberry Pi Pico or Raspberry Pi Pico W.

​

2. Find the BOOTSEL button on your Raspberry Pi Pico. Press the BOOTSEL button and hold it while you connect the other end of the micro USB cable to your computer. Release the BOOTSEL button after your Pico is connected.

​

3. It will mount as a Mass Storage Device called RPI-RP2.

​

4. Drag and drop the previously downloaded MicroPython UF2 file from your downloads folder onto the RPI-RP2 volume. Your Pico will reboot. You are now running MicroPython on your Pico. 

​

5. Go back to your Thonny window, in the bottom right-hand corner, you will see the version of Python that you are currently using. Click on the Python version and choose 'MicroPython (Raspberry Pi Pico)'       

Screenshot (1203).png

Step 5

If the above steps are successful, subsequent times, you can just plug your Pico into your computer and it should automatically be ready for use.

2. Download firmware with Thonny IDE

​

Follow the steps below to download MicroPython firmware onto your Raspberry Pi Pico or Pico W:​

​

1. Open your Thonny IDE.

​

2. Press and hold the BOOTSEL button on your Pico, and connect your Pico to your PC.

​

3. Go to the bottom-right corner of your Thonny IDE screen (you should see the version of Python installed on your PC if any). Click on it and you should see a pop-up window:

Screenshot (799).png
Screenshot (801).png

Step 3

4. Since there is no firmware on your Pico, you should see options to install from. Click on Install MicroPython. You should get a bigger window to select the MicoPython version for your board of choice.

Screenshot (802).png

Step 4

5. Select the firmware variant according to the board you have plugged in, then click on Install (Your firmware should start downloading).

Screenshot (803).png

Step 5

6. When the download is complete, click on Close to exit the window. You now have MicroPython installed on your Pico!

Screenshot (806).png

Step 6

7. Click on the bottom-right corner of the Thonny browser once again: you should see MicoroPython as installed Python options to choose from.

Screenshot (807).png

Step 7

bottom of page