PlatformIO Community

Nucleo Board Upload issues

Greetings everyone,

I have an ST NUCLEO L053R8 which I’m trying to upload programs to; a couple of weeks ago I’ve been able to upload code to it without trouble. However today when I attempted to upload some test code, I got the following error:

Configuring upload protocol...
AVAILABLE: blackmagic, jlink, mbed, stlink
CURRENT: upload_protocol = stlink
Uploading .pio\build\nucleo_l053r8\firmware.elf
xPack OpenOCD, 64-bit Open On-Chip Debugger 0.10.0+dev (2019-07-17-11:28)
Licensed under GNU GPL v2
For bug reports, read
debug_level: 1

Error: init mode failed (unable to connect to the target)
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

*** [upload] Error 1
================================================================== [FAILED] Took 12.37 seconds ==================================================================

I’ve been looking at different posts from the community and other sites (specially github) with no results. The only difference is I upgraded the STM32 platform to its latest version. Any help would be deeply appreciated.



Things to try:

  • Ensure you have a fully configured USB cable (and not one with only two wires for charging)
  • Ensure the CN2 connector has both jumpers set to on (see image below)
  • Press the reset button and hold it until upload has started
  • Try if the ST-LINK utility can talk to your board. If so, erase the chip and try to upload with PlatformIO again