Skip to content

Picotool reset only really works on Raspberry Pi Pico boards #2078

@jonathanperret

Description

@jonathanperret

How to reproduce

Tested on: Arduino IDE 2.3.2, arduino-pico 3.7.2, macOS 14.2 ARM.

  • Plug in any RP2040 board that is not a plain Raspberry Pi Pico, and select it in the boards menu (or, use a plain Raspberry Pi Pico board but select "Raspberry Pi Pico W" as the board).
  • In the Arduino IDE, create a Blink sketch.
  • Select the "Picotool" upload method.
  • Following the Picotools instructions in README, put the device in BOOTSEL mode manually, then do a first upload.

There's a first minor issue here (that is also present with a "Raspberry Pi Pico" board selected): the upload concludes successfully but the device does not reboot into application code. Un-plugging then re-plugging the device (without holding the BOOTSEL button) gets the LED blinking. I suspect this could be fixed by calling picotool load with the -x flag.

  • Without manually putting the device back into BOOTSEL, try to do a second upload.

With the "Raspberry Pi Pico" board selected, picotool correctly reboots the device into BOOTSEL mode, uploads the code and restarts the device.
If any other board was selected for the first upload, the second upload fails with the following error:

No accessible RP2040 devices in BOOTSEL mode were found.

Analysis

Looking at the devices on the USB bus (using e.g. lsusb), the programmed board is there, including the custom reset interface that picotool should be looking for. But the PID/VID combination is not what picotool expects, causing the device to be essentially invisible to picotool.

There appears to have been some effort put into supporting custom PID/VIDs in picotool: raspberrypi/picotool#83 but so far that has not been merged.

I guess this is mainly a picotool issue, but one issue for arduino-pico is that it advertises picotool support for all boards when it really only works for plain Raspberry Pi Pico.

A potential workaround would be to use the alternative method of rebooting to BOOTSEL mode that stdio_usb supports, which is to open (and close) the serial port at 1200 baud (e.g. stty -f /dev/tty.usbmodem1401 1200 on macOS) before invoking picotool. Apparently this is what Platform.IO does?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions