Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlatformIO: upload to Adafruit Trinkey RP2040 QT errors out #1149

Closed
salfter opened this issue Jan 31, 2023 · 2 comments
Closed

PlatformIO: upload to Adafruit Trinkey RP2040 QT errors out #1149

salfter opened this issue Jan 31, 2023 · 2 comments
Labels
waiting for feedback Requires response from original poster

Comments

@salfter
Copy link

salfter commented Jan 31, 2023

Maybe I'm doing something wrong, but I've tried uploading both with and without holding in the BOOTSEL button and I keep getting an error. With BOOTSEL pressed, it usually fails like this:

Configuring upload protocol...
AVAILABLE: cmsis-dap, jlink, picoprobe, picotool, raspberrypi-swd
CURRENT: upload_protocol = picotool
Looking for upload port...
Error: Please specify `upload_port` for environment or use global `--upload-port` option.
For some development platforms it can be a USB flash drive (i.e. /media/<user>/<device name>)
*** [upload] Explicit exit, status 1

Without pressing BOOTSEL, I get this:

Configuring upload protocol...
AVAILABLE: cmsis-dap, jlink, picoprobe, picotool, raspberrypi-swd
CURRENT: upload_protocol = picotool
Looking for upload port...
Auto-detected: COM5
Forcing reset using 1200bps open/close on port COM5
Uploading .pio\build\pico\firmware.elf
rp2040load 1.0.1 - compiled with go1.15.8
.....................
*** [upload] Error 1

I can copy firmware.uf2 from .pio/build/pico/ onto the device and get my code running that way, so this isn't a showstopper, but it'd be nice to have the upload button working as it does for the other platforms I use.

Steps to duplicate

Create a new PlatformIO project for the Raspberry Pi Pico, and override the settings in platformio.ini as follows:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

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

The code I'm testing with is a mouse wiggler that I can change over to a mouse clicker, though I suppose a "blinky" program or anything known to work could be used for main.cpp:

#include <Arduino.h>
#include <Mouse.h>

void setup() {
  Mouse.begin();
}

void loop() {
  Mouse.move(-5,0,0);
  delay(1000);
  Mouse.move(5,0,0);
  delay(1000);
  // Mouse.click();
  // delay(30000);
}
@maxgerhardt
Copy link
Contributor

maxgerhardt commented Feb 2, 2023

I can copy firmware.uf2 from .pio/build/pico/ onto the device and get my code running that way,

That may have to be done initially, but starting from that, it should work through the reset-via-1200bps-touch.

DId you do the procedure where you plug the board in in BOOTSEL mode and use Zadig to load WinUSB or libusb-win32 drivers on the "RP2 Boot2 (Interface 1)" device like this says? Otherwise rp2040load won't be able to access the USB device..

@earlephilhower earlephilhower added the waiting for feedback Requires response from original poster label Feb 2, 2023
@salfter
Copy link
Author

salfter commented Feb 2, 2023

DId you do the procedure where you plug the board in in BOOTSEL mode and use Zadig to load WinUSB or libusb-win32 drivers on the "RP2 Boot2 (Interface 1)" deveice like platformio/platform-raspberrypi#2 (comment)? Otherwise rp2040load won't be able to access the USB device..

I didn't know about that, but then I usually do this sort of stuff under Linux, not Windows. Once I did that, programming behaved as expected. Thanks!

@salfter salfter closed this as completed Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Requires response from original poster
Projects
None yet
Development

No branches or pull requests

3 participants