DigiKey Coffee Cup Micropython on Raspberry Pico 2 or Raspberry Pico 2W

For those who are interested in creating “rapid” micropython applications in the Raspberry Pico 2 or the Raspberry Pico 2 W both available from DigiKey. in their evaluation boards,

image

image

and also as the RP2350 processors themselves where these can be customized in a PC Board in Kicad and submit the files it via DigiKey PCB Builder for many applications as needed. Here are the steps in Linux to be able to create micropython applications in these devices available from DigiKey. First install the appropiate micropython.uf2 file, if the Raspberry Pico 2 is the device then use this .uf2 file,

RPI_PICO2.uf2 (635 KB)

or if the Raspberry Pico 2 W is the device then use this .uf2 file,

RPI_PICO2W.uf2 (1.6 MB)

these micropython files can also be acquired via micropython website. First, download it to the device using the BOOTSEL button and using picotool like this for the Raspberry Pico 2,

digikey_coffee_cup# picotool load RPI_PICO2.uf2

or for the Raspberry Pico 2 W,

digikey_coffee_cup# picotool load RPI_PICO2W.uf2

as applicable. Now proceed to create a python virtual environment,

python3 -m venv venv

then activate it,

source venv/bin/activate

Now proceed with the following commands to install RSHELL once the python virtual environment is activated,

(venv) digikey_coffee_cup#  pip3 install rshell

Now navigate to the appropiate folder where the micropython files are to be downloaded into the Raspberry Pico 2. To download the micropython files to the Raspberry Pico 2, proceed with the following RSHELL command (If it shows as ttyACM1) to create an RSHELL connection from the host to the device,

(venv) digikey_coffee_cup#  rshell -p /dev/ttyACM1

	Using buffer-size of 32
	Connecting to /dev/ttyACM1 (buffer-size 32)...
	Trying to connect to REPL  connected
	Retrieving sysname ... rp2
	Testing if ubinascii.unhexlify exists ... Y
	Retrieving root directories ... 
	Setting time ... Sep 05, 2025 15:07:26
	Evaluating board_name ... pyboard
	Retrieving time epoch ... Jan 01, 1970
	Welcome to rshell. Use Control-D (or the exit command) to exit rshell.

(venv) digikey_coffee_cup# 

At this point we are connected via RSHELL to the device. At any moment to see what files are inside our Raspberry Pico 2, use this ls command (/pyboard is the default directory of the r-pico where the micropython files have to reside)

(venv) digikey_coffee_cup# ls /pyboard

This will list all the files if there are any inside the Raspberry Pico 2, In this case at the initial state, there are none but use this command at any moment to verify the files where uploaded properly. Now navigate to the micropython project (that is the folder where the micropython files reside in your computer) for example in this case,

(venv) digikey_coffee_cup# cd  /micropython_project

Proceed to copy the applicable micropython files as follows (in this case main.py) ,

(venv) digikey_coffee_cup@ micropython_project/  cp main.py  /pyboard

Many micropython projects have subdirectories where the main.py use them as micropython libraries as applicable. If there are subdirectories are present, (called subdirectory here as an example) inside the micropython project, copy them as follows as many times as needed,

(venv) digikey_coffee_cup@ micropython_project/  cp -r subdirectory /pyboard/

Finally verify there were copied as follows,

(venv) digikey_coffee_cup@ micropython_project/  ls /pyboard

This command should list all the files and subdirectories of the micropython project that were uploaded to the device. Once this is completed, proceed to restart the device either by power cycle or reset as applicable. Now we are ready to use the Raspberry Pico 2 or the Raspberry Pico 2 W available from DigiKey for many applications where “rapid” micropython development is needed. There are many many other micropython compatible embedded devices available from DigiKey such as the,

among many others available at DigiKey.. Have a nice day!

This article is available in spanish here.

Este artículo esta disponbie en español aqui.

1 Like