Raspberry Pi Pico, Can't Load any Sketch

Hello

I just starting to use the Raspberry Pi Pico, traying with old sketches made for the Arduino boards, then suddenly I couldn't load any sketch any more, on the IDE Menu the Tools -> Port option was grayed down. I then went to google and try to find a solution, every thing I'd read was pointing to drivers. I thought that after delete every single device related to Raspberry Pi Pico on the Device Manager, and then plug the Pico into the USB port, Windows will load the drivers and configure the Pico by itself. Every thing wend smooth the OS recognize the Raspberry Pi Pico and configured it, or at least that was it say.

I notice on the Device Manager that before uploading the sketch, windows recognize the Pico as "USB Serial Device (COM3)"

But wend the IDE is uploading the sketch, windows opens the Pico MSD on file explorer, and shows a dialog message that is configuring Raspberry Pi Pico, then after It shows other entry with the Pico on (COM4)

and after a while the IDE shows this error

It sound logical that when the IDE is trying to upload the sketch to COM3 Windows is reconfiguring The Pico as COM4 and therefore the IDE will fail its attempt.

I try other PC and all that doesn't happens, the sketch uploads perfectly and every thing works just right. The Device Manager shows the "RP2 Boot" without a COM port. Below a picture of the Device Manager on other PC.

What I'm doing wrong?
Which is the right driver I should use?
How can I fix it?

I will greatly appreciate any help

Carlos

"If you find difficulty in uploading code, unplug the board from the USB port and plug it back in while holding down the BOOTSEL button on Raspberry Pi Pico."

Disclaimer: I don't know anything about the Pi Pico so not an attempt tp solve your problem. This is just an attempt to clarify some things.

That's your assumption :wink: For most boards (I guess the Pi Pico is not different), the IDE will reset a board to be able to upload to it. On boards like e.g. the Leonardo, this reset will change the com port. The IDE will look for that changed COM port and use that. I'm reasonably sure that the behaviour of the Pi Pico will be similar although it might look for something else that is the result of the reset.

You can observe the behaviour in more detail if you enable verbose output during upload under file -> preferences in the IDE. If I'm right about the reset for your Pi Pico, you will see a line indicating that the IDE issues a reset on COM3. The full output might reveal to you what actually goes wrong.

Is any IC of the board getting extremely hot? Hotter than usual?

Thank runaway_pancake for your advice.

But no, it doesn't work that way. It behave just the same. The question is: Why it don't works on a PC and do it in other? also, in the PC that doesn't work, used to work before?

Thank sterretje for showing me a new feature of the IDE.

I'd try it using COM3 and COM4, below one of the output:

The last 3 lines where printed when trying to open the terminal and changing the BPS rate.

Thank tepalia02

No. The temperature is quite normal.

I found that the drivers loaded on both PCs are different

This is the Driver loaded by the Working PC

and this other is the one loaded on the PC that doesn't' load the sketch

I think there is the problem, but I don't know how to fix it

After several hours working on the problem finally, I find a solution. At the end, I was able to load any .uf2 files and the Arduino IDE was able to upload sketches every time. Those are the steps I had follow to solve the problem:

Preparation:

Read “Resetting Flash Memory” on the “Raspberry Pi Documentation” and Download flash_nuke.uf2 from this link

Plug the Pico Bootsel pressed, If File Explorer does not open, you will not be able to load the flash_nuke.uf2 file into memory, do not worry, latter you will have the opportunity to do so, but if it does, just drag and drop this file into the RPI-RP2 volume and wait until the Pico’s onboard LED flashes 3 times.

Loading this file into the RaspberryPi Pico will clear the Flash Memory. After done, the Pico will always open the File Explorer with the RPI-RP2 volume when plugged, independently of the Bootsel button state. That behavior will remain until you upload an .uf2 file into memory, from then on, the Pico will work as usual.

Unplug the Pico.

Now we are going to delete some devices from the Device Manager, that way we will have a clean start, next time we plug the Pico, Windows will load the drivers to handle it.

Delete all Pico related devices on the Device Manager

Right click on Windows Start, and select Device Manager

On Device Manager
View-> Devices by container
View-> Show hidden devices

Delete Raspberry Pi Pico Devices

Solution Device Manager 1 RPi Pico Devices

Double click to open the container, and then you will see all the devices in that container, go into each Pico related container and delete devices one by one.

Right click on every Pico device leaving "USB Composite Device" and “Volume” until the end. When Uninstalling "USB Composite Device" or “Volume” other devices in the container also disappear, we want to delete driver software if they exist, so, delete them as a final step.

If the Uninstall Device dialog windows show a check box (Delete the driver software for this device), mark it and Confirm by clicking on Uninstall, if not, just Confirm by clicking on Uninstall.

Example: in my case, from the picture above: Pico, RaspberryPi Pico, RP2 Boot.

Double click on Pico to open the container, and then you will see all the devices in that container.
Right click on "USB Serial Device (COM8)" and select "Uninstall device", if the Uninstall Device dialog windows show a check box, mark it and Confirm by clicking on Uninstall, if not just click on uninstall.

After deleting all Pico related Devices, go back into Action->Scan for hardware changes, to ensure no Containers related to Raspberry pi Pico still exist.

After clean up, we will upload a fresh copy of the Arduino Drivers.

Run Arduino IDE, go to Boards Manager, if you find “Arduino Mbed OS RP2040 Boards” installed, remove it, if not continue with next step.

Install “Arduino Mbed OS RP2040 Boards”.

Plug the Pico Bootsel pressed this time, wait until windows notification “Device ready ‘RP2Boot’ is set up and ready to go.”, If Windows open the File Explorer showing the RPI-RP2 (USB Mass Storage Device), it is a good time to reset the Pico Flash memory. Drag and Drop flash_nuke.uf2 file, as explained at the beginning.

Go back to Device Manager, select from the menu Action->Scan for hardware changes.

On the RP2 Boot container, right click the device that start with “RP2 Boot” and select properties. As showed below.

Solution RP2 Boot Properties

On the Properties window select the Driver tab, click on the “Update Driver” option
On the next window, select “Browse my computer for drivers”.

Write “C:\Windows\System32\drivers” on the location search path, mark the Include subfolders

Solution Search Path for Drivers

Click on “Let me pick from a list of available drives…”
At this point, you may have one of the following scenarios:
1- Select your device’s type from the list below.
2- Select the driver you want to install for this hardware.

Continued in next post:

In the first just double click over any of the options from the list, will bring you the second scenario, then, select “Nano RP2040 Connect Picoboot IF”, click next

Solution Select Picoboot Driver

Plug the Pico Bootsel released
Wait until windows notification “Device ready ‘RaspberryPi Pico’ is set up and ready to go.”

Solution Device is ready 'RaspberryPi Pico'

You can go into Windows Settings->Devices and see the Raspberry Pi Pico under Other devices
Unplug the Pico

Now you have fixed the problem

4 Likes

Thanks for the extensive feedback.

What a long, strange trip that must have been.

Saved the day!

1 Like

I followed all steps in order, but my pico always pops up a window's file explorer window and doesn't show a COM port in the devices manager. When I look in the devices manager, I see RP2 Boot under "Universal Serial Bus devices", but no COM port. I made sure to load the flash_nuke.uf2 file and updated the driver as specified, but it's not working.

Any ideas?

It seems this fix did the trick. However, the issue is that even though I have a COM port for the pico, when I plug in the device (while pressing BOOTSEL) and then try to upload a basic sketch, I get the following:

Sketch uses 89569 bytes (4%) of program storage space. Maximum is 2097152 bytes.
Global variables use 42824 bytes (15%) of dynamic memory, leaving 227512 bytes for local variables. Maximum is 270336 bytes.
.....................
An error occurred while uploading the sketch
Error while setting serial port parameters: 115,200 N 8 1

Am I doing something wrong? Here's the sketch:

void setup()
{
  Serial.begin(115200);
}

void loop()
{
  Serial.println("hi");
  delay(100);
}

I've experienced this problem too, and I've just made a forum account to contribute to this topic.
I've followed (twice) the detailed process indicated at post #9, yet the outcome was not as expected:

  1. Windows didn't show "Device is ready"
  2. IDE didn't show any connected board

At this point, I tried the suggestion https://forum.arduino.cc/t/raspberry-pi-pico-does-not-show-its-port-in-ide/850432: just try to upload your sketch.
In my case the sketch did upload straight away, and the window "Device is ready" finally appeared on the screen.

P.S. I'm new to Pico, and the system worked for a couple of day simply fine; first time the board stopped working I did check it was still working via Thonny with microPython by connecting to the same PC. This makes me doubting which tool and language i should use.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.