This section is about the original Raspberry Pi Pico board. The "1" was added retroactively to the name as more boards were released and "Raspberry Pi Pico" became a generic name for the brand.
Has Serial wire debug debug pre-soldered. Why would you ever get one without unless you are a clueless newbie like Ciro Santilli?!?!
It is however possible to solder it yourself on Raspberry Pi Pico W.

Tagged

You can connect form an Ubuntu 22.04 host as:
screen /dev/ttyACM0 115200
When in screen, you can Ctrl + C to kill main.py, and then execution stops and you are left in a Python shell. From there:
but be aware of: Raspberry Pi Pico W freezes a few seconds after after screen disconnects from UART.
Then there are two appraoches:
The first/only way Ciro could find was with ampy: stackoverflow.com/questions/74150782/how-to-run-a-micropython-host-script-file-on-the-raspbery-pi-pico-from-the-host/74150783#74150783 That just worked and it worked perfectly!
pipx install adafruit-ampy
ampy --port /dev/ttyACM0 run blink.py
TODO: possible with rshell?
Install on Ubuntu 22.04:
python3 -m pip install --user adafruit-ampy
Ctrl + X. Documented by running help repl from the main shell.
Some generic Micropython examples most of which work on this board can be found at: Section "MicroPython example".
Pico W specific examples are under: rpi-pico-w/upython.
The examples can be run as described at Program Raspberry Pi Pico W with MicroPython.
Blink on-board LED. Note that they broke the LED hello world compatibility from non-W to W for God's sake!!!
The MicroPython code needs to be changed from the Raspberry Pi Pico 1, forums.raspberrypi.com/viewtopic.php?p=2016234#p2016234 comments:
Unlike the original Raspberry Pi Pico, the on-board LED on Pico W is not connected to a pin on RP2040, but instead to a GPIO pin on the wireless chip.
Any print() command ends up on the USB, and is shown on the computer via programs such as ampy get back.
However, you can also send data over actual UART.
We connect Pin 0 (TX), Pin 1 (RX) and Pin 2 (GND) to the DSD TECH, and the USB to the Ubuntu 25.04 host laptop.
Then on the host laptop I run:
screen /dev/ttyUSB0 9600
and a counter shows up there just fine!
The program continuously prints to the USB the value of the ADC on GPIO 26 once every 0.2 seconds.
The onboard LED is blinked as a heartbeat.
The hello world is with a potentiometer: extremes on GND and VCC pins of the Pi, and middle output on pin GIO26, then as you turn the knob, the uart value goes from about 0 to about 64k.
The 0 side is quite noisy and varies between 0 and 300 for some reason.
In Ciro's ASCII art circuit diagram notation:
RPI_PICO_W__gnd__gpio26__5v
            |    |       |
            |    |       |
            |    |       |
         P__1____2_______3
Ubuntu 22.04 build just worked, nice! Much feels much cleaner than the Micro Bit C setup:
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib

git clone https://github.com/raspberrypi/pico-sdk
cd pico-sdk
git checkout 2e6142b15b8a75c1227dd3edbe839193b2bf9041
cd ..

git clone https://github.com/raspberrypi/pico-examples
cd pico-examples
git checkout a7ad17156bf60842ee55c8f86cd39e9cd7427c1d
cd ..

export PICO_SDK_PATH="$(pwd)/pico-sdk"
cd pico-exampes
mkdir build
cd build
# Board selection.
# https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html also says you can give wifi ID and password here for W.
cmake -DPICO_BOARD=pico_w ..
make -j
Then we install the programs just like any other UF2 but plugging it in with BOOTSEL pressed and copying the UF2 over, e.g.:
cp pico_w/blink/picow_blink.uf2 /media/$USER/RPI-RP2/
Note that there is a separate example for the W and non W LED, for non-W it is:
cp blink/blink.uf2 /media/$USER/RPI-RP2/
Also tested the UART over USB example:
cp hello_world/usb/hello_usb.uf2 /media/$USER/RPI-RP2/
You can then see the UART messages with:
screen /dev/ttyACM0 115200
TODO understand the proper debug setup, and a flash setup that doesn't require us to plug out and replug the thing every two seconds. www.electronicshub.org/programming-raspberry-pi-pico-with-swd/ appears to describe it, with SWD to do both debug and flash. To do it, you seem need another board with GPIO, e.g. a Raspberry Pi, the laptop alone is not enough.

Articles by others on the same topic (0)

There are currently no matching articles.