Upload Error 1 on pio with Raspberry pi pico

I try to upload my programm to an pico. Fresh out of the box, never used.
But i always get upload error 1 with no closer description.

What i have done:

-changed interface 1 driver to lib-usb 1.2.7.3
-updated vsc, platformio ect
-checked with a known working pico
-uploaded firmware one manually in BOOTSEL

I see the pico in the device manager as com-port.

VSC sees the com port and trys to reset it wich is succsesfull as it opens as storage drive but it wont upload and throws error one. I can grab the firmware.uf2 and copy it manually. This gives me a working programm and i can connect via serial console.
So why wont it upload by itself?

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower


lib_deps = 
	adafruit/Adafruit PCF8591@^1.0.4
	adafruit/Adafruit BusIO@^1.14.5
Processing pico (platform: https://github.com/maxgerhardt/platform-raspberrypi.git; board: pico; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/raspberrypi/pico.html
PLATFORM: Raspberry Pi RP2040 (1.10.0+sha.182d833) > Raspberry Pi Pico
HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, picoprobe, raspberrypi-swd)
PACKAGES:
 - framework-arduinopico @ 1.30600.0+sha.41b0686
 - tool-mklittlefs-rp2040-earlephilhower @ 5.100300.230216 (10.3.0)
 - tool-openocd-rp2040-earlephilhower @ 5.120300.230911 (12.3.0)
 - tool-rp2040tools @ 1.0.2
 - toolchain-rp2040-earlephilhower @ 5.120300.230911 (12.3.0)
Flash size: 2.00MB
Sketch size: 2.00MB
Filesystem size: 0.00MB
Maximium Sketch size: 2093056 EEPROM start: 0x101ff000 Filesystem start: 0x101ff000 Filesystem end: 0x101ff000
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 53 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit PCF8591 @ 1.0.4
|-- Adafruit BusIO @ 1.14.5
Building in release mode
Compiling .pio\build\pico\src\main.cpp.o
Linking .pio\build\pico\firmware.elf
Generating UF2 image
elf2uf2 ".pio\build\pico\firmware.elf" ".pio\build\pico\firmware.uf2"
Retrieving maximum program size .pio\build\pico\firmware.elf
Flash size: 2.00MB
Sketch size: 2.00MB
Filesystem size: 0.00MB
Maximium Sketch size: 2093056 EEPROM start: 0x101ff000 Filesystem start: 0x101ff000 Filesystem end: 0x101ff000
Checking size .pio\build\pico\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.1% (used 10664 bytes from 262144 bytes)
Flash: [          ]   3.0% (used 62888 bytes from 2093056 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, picoprobe, picotool, raspberrypi-swd
CURRENT: upload_protocol = picotool
Looking for upload port...
Auto-detected: COM7
Forcing reset using 1200bps open/close on port COM7
Uploading .pio\build\pico\firmware.elf
rp2040load 1.0.1 - compiled with go1.15.8
.....................
*** [upload] Error 1
============================================================= [FAILED] Took 17.47 seconds ===========================================

Use WinUSB instead in Zadig.

If i change to WinUSB it wont appear as serial port.
i have RP2 Boot as usb device and RP2 RPI USB Device as mass storage

EDIT: I used an older Version of zadig with an older WinUSB - one manual run and now it works. Why must it everytime be this comlicated?

Thank you for your help maxgerhardt!

1 Like

Thanks for your solution @blackfield3k Can’t believe how painful getting PlatformIO to talk to the RP2040 is. Final solution was…

  • Download Zadig 2.5
  • Hold BOOTSEL
  • Run Zadig and for RP2 Boot (Interface 1) install WinUSB driver
  • Build project in PlatformIO
  • Manually drag .pio/build/pico/firmware.uf2 to mounted Pico drive
  • You should now be able to upload to your Pico automatically and it only 6 completely undocumented steps to get there. Gotta love Windows drivers!

platformio.ini was…

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
1 Like

This was a huge headache- this fixed it for me. Thanks!