Friday, September 6, 2024

Raspberry Pi Pico2 with Arduino IDE Linux install

For an index to all my stories click this text

Just 2 weeks ago on August 23 I wrote about the new Raspberry Pi Pico2 that just arrived. For those in the blind: the Raspberry Pi Pico2 is the successor of the Pico, the first micro controller of the Raspberry Pi company. It is a serious challenger for the Arduino boards as it is dead-cheap and widely available. The advantages are obvious: more speed, more memory and more storage and the same footprint.

At the time I wrote that the only languages available where MicroPython / CircuitPython and the Raspberry Pico SDK. No Arduino IDE at that time. You can read that story here:
http://lucstechblog.blogspot.com/2024/08/first-look-at-raspberry-pi-pico2.html

Well as you know things in the electronics world go fast: really fast. And Earle F. Philhower, III managed to get the Pico2 working with the Arduino IDE. He is the one that got the Pico working with the Arduino IDE before the Arduino company managed it themselves. And now he did it again for the Pico2 !! Quite and achievement.

In a few steps I will show how to get the Pico working with the Arduino IDE.

Where to get the latest Arduino IDE.

You will need the latest Arduino IDE, meaning at least version 2.X. The previous versions (1.X) will not compile for the Raspberry Pi Pico2. So make sure you have the latest version. You can download it here:

https://www.arduino.cc/en/software

There are versions available for Windows, Linux and MacOS.
On Windows just download the .EXE file and click on it to install.

I abandoned Windows last year in favour of Linux (Kubuntu).
For Linux there is an AppImage available. However there was (at the time of this writing) a problem with that. Kubuntu just made an update from version 22 to version 24 (I skipped version 23). And the AppImage unfortunately does not work with this new version.

Fortunately there is also a FlatPack version available. And that works flawless. Here is the link: https://flathub.org/apps/cc.arduino.IDE2

At the top of the screen you will find an Install button. Just use that. If you did not install the FlatPack option in your Linux setup I advise you to do so. Here is the link on how to install Flatpack on your Linux environment: https://flatpak.org/setup/

Add the Raspberry Pi Pico boards.

The first step is to open the board manager and search for Pico.



We need the version: Raspberry Pi Pico/RP2040 by Earle F. Philhower, III
Next to the INSTALL button there is a drop-down menu in which you can chose what version you want to install. Always chose the latest version. At the time of this writing that is version 4.0.1. Starting at version 4.X there is support for the Pico2.


After a few seconds the Arduino IDE will show that the Pico boards are installed.

When I pressed the upload button with the empty sketch I got an error message. The program compiled flawless but there was an upload error.

I used the empty sketch for testing. A better choice would be to use the Circle sketch from the examples drop-down menu. This example makes your mouse draw a circle on your screen when you press the boot button.

So I decided to unplug the Pico2 from the USB cable and plug it in anew while pressing the boot button. Just like you do when you install MicroPython for the first time.
Well that did not work either.

The right way.

First look in the drop down menu for the Export Compiled Binary entry and click on that.

The empty sketch compiles and is saved to a folder. But which folder ????

Click on the drop-down menu entry called Show Sketch Folder.

The folder shows the .ino file (which is the source code) and a build folder. Click on that folder.

Inside the build folder there is another folder called rp2040.rp2040.rpipico2 Click on that folder.

And just look at that. There is an uf2 file. Just what we need for the Pico.

Now plug the Pico in again while pressing the boot button.

The Pico2 will show up as a new device in your file manager. Open that device in a new window.

Now drag the uf2 file to the Pico's window and copy it there.
The Pico's window will close and your done. The program will run immediately.

That's it
Till next time
Have Fortunately


Luc Volders