platformio / platform-raspberrypi

Raspberry Pi: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/raspberrypi
Apache License 2.0
73 stars 96 forks source link

"OpenOCD init failed" when attempting to upload via picoprobe #40

Closed neilenns closed 1 year ago

neilenns commented 1 year ago

I'm trying to get the awesome debugging support introduced with #36 working but am struggling with even getting upload to work on Windows.

Here is how my platformio.ini is configured:

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0M
build_flags = 
    -fpermissive
monitor_speed = 115200
lib_deps = adafruit/Adafruit TCA8418@^1.0.1
debug_tool = picoprobe
upload_protocol = picoprobe
debug_init_break = tbreak loop

Whenever I attempt to upload from VSCode/PlatformIO I get the following:

CURRENT: upload_protocol = picoprobe
Uploading .pio\build\pico\firmware.elf
Open On-Chip Debugger 0.11.0-g610f137 (2022-02-11-13:57)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

adapter speed: 5000 kHz

adapter speed: 1000 kHz

in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

I've triple checked my wiring between the two boards and it appears to be correct. Any suggestions for what might be leading to this error?

neilenns commented 1 year ago

I tried updating my Raspberry Pi platform installation this morning to ensure it has the updated tools from #36. Unfortunately that didn't change anything and I still get the upload error.

Interestingly a friend has also tried this and it worked for them, so I'm at a loss for what the difference is :(

neilenns commented 1 year ago

Connected the target Pico directly to power via USB and it worked! I guess my board-to-board power wiring was wrong :(