- PlatformIO CLI installed on the host.
- USB type C to USB type C cable to connect the peripheral (board) to the host (computer).
First find the port of the peripheral.
$ pio device listYou should see something like this:
/dev/cu.usbmodem1101
--------------------
Hardware ID: USB ...
Description: RaspberryPi PicoThen compile and upload the code to the peripheral.
$ pio run -t upload --upload-port /dev/tty.usbmodem101$ pio device monitor$ pio run -t cleanDownload the UF2 file from the official website.
Flash the UF2 file to the peripheral. Install rshell, then connect to the peripheral.
$ cd rp2040/micropython/src
$ rshell
$ cp main.py /pyboardThen reset the peripheral by pressing the reset button. Code should start running.
rshell is a remote MicroPython shell tool for accessing and managing files on the device.rshell represents your device’s flash storage as /pyboard. Use the special filename main.py to automatically execute your program on boot.
You can also use the REPL to interact with the device.
$ rshell
$ replOpen REPL with either screen or minicom.
$ screen /dev/tty.usbmodem101 115200
$ minicom -D /dev/tty.usbmodem101 -b 115200To exit screen, press Ctrl + A followed by K and then Y, or Ctrl + A followed by :quit.
- esp32-s3-wroom-1
$ esptool.py -p /dev/tty.usbmodem101 erase_flash
$ esptool.py -p /dev/tty.usbmodem101 write_flash -z 0 firmware.bin- rp2040
connect the board with the boot button pressed, then copy the UF2 file to the RPI-RP2 drive.