OpenOCD Init Failed

I’ve taken a look around the forums for this problem but just couldn’t get it sorted myself.

I’m very new to this kind of stuff, like started today kinda new, with the intent to do Manual Mesh Bed Leveling on my ender 3. I’ve downloaded Visual Studios Code, and installed the PlatformIO extension, as well as the Auto Build Marlin Extension.

I’ve currently got and SKR-Mini-v1.2 in my ender with Marlin 2.0bugfix already on it.

I’ve gotten all the files and everything from GitHub and followed along with some youtube videos, but where I get stuck where it seems everyone else I’ve seen flow right through is I get an [upload] error 1.

I’ll I’ve done up to this point is change the env to STM32F103RC_btt as per the recommendations. I hit build and everything come out fine but when I go to upload this is what comes up.

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/genericSTM32F103RC.html
PLATFORM: ST STM32 6.0.0 > STM32F103RC (48k RAM. 256k Flash)
HARDWARE: STM32F103RCT6 72MHz, 48KB RAM, 256KB Flash
DEBUG: Current (blackmagic) External (blackmagic, jlink, stlink)
PACKAGES:
 - framework-arduinoststm32-maple 1.10000.190819 (1.0.0)
 - tool-dfuutil 1.9.200310
 - tool-openocd 2.1000.190707 (10.0)
 - tool-stm32duino 1.0.2
 - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
Converting Marlin.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Looking for USBComposite_stm32f1 library in registry
Warning! Library `{'name': 'USBComposite_stm32f1', 'requirements': '==0.91'}` has not been found in PlatformIO Registry.
You can ignore this message, if `{'name': 'USBComposite_stm32f1', 'requirements': '==0.91'}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.
Found 38 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <LiquidCrystal>
|-- <TMCStepper> 0.6.2
|   |-- <SoftwareSerialM> 1.0.0
|-- <U8glib-HAL> 0.4.1
|   |-- <Wire> 1.0
|-- <Adafruit MAX31865 library> 1.0.3
|-- <LiquidTWI2>
|   |-- <Wire> 1.0
|-- <Arduino-L6470> 0.8.0
|-- <SailfishLCD>
|-- <SailfishRGB_LED>
|   |-- <Wire> 1.0
|-- <SlowSoftI2CMaster>
|-- <SoftwareSerialM> 1.0.0
|-- <STM32ADC> 1.0
|-- <USBComposite for STM32F1> 0.91
|-- <EEPROM>
|-- <Wire> 1.0
Building in release mode
Checking size .pio\build\STM32F103RC_btt\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  43.8% (used 21512 bytes from 49152 bytes)
Flash: [========  ]  85.0% (used 222716 bytes from 262144 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, dfu, jlink, serial, stlink
CURRENT: upload_protocol = stlink
Uploading .pio\build\STM32F103RC_btt\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

hla_swd
Error: open failed
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

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

Environment               Status    Duration
------------------------  --------  ------------
mega2560                  IGNORED
mega1280                  IGNORED
rambo                     IGNORED
FYSETC_F6_13              IGNORED
FYSETC_F6_14              IGNORED
sanguino644p              IGNORED
sanguino1284p             IGNORED
melzi                     IGNORED
melzi_optiboot            IGNORED
at90usb1286_cdc           IGNORED
at90usb1286_dfu           IGNORED
DUE                       IGNORED
DUE_USB                   IGNORED
DUE_debug                 IGNORED
LPC1768                   IGNORED
LPC1769                   IGNORED
STM32F103RC               IGNORED
STM32F103RC_fysetc        IGNORED
STM32F103RC_btt           FAILED    00:00:09.095
STM32F103RC_btt_USB       IGNORED
STM32F103RC_btt_512K      IGNORED
STM32F103RC_btt_512K_USB  IGNORED
STM32F103RE               IGNORED
STM32F103RE_btt           IGNORED
STM32F103RE_btt_USB       IGNORED
STM32F4                   IGNORED
STM32F7                   IGNORED
ARMED                     IGNORED
STM32F103VE_GTM32         IGNORED
STM32F103VE_longer        IGNORED
mks_robin_mini            IGNORED
mks_robin_nano            IGNORED
mks_robin                 IGNORED
mks_robin_pro             IGNORED
mks_robin_lite            IGNORED
mks_robin_lite3           IGNORED
jgaurora_a5s_a1           IGNORED
chitu_f103                IGNORED
STM32F401VE_STEVAL        IGNORED
FLYF407ZG                 IGNORED
FYSETC_S6                 IGNORED
STM32F407VE_black         IGNORED
BIGTREE_SKR_PRO           IGNORED
BIGTREE_GTR_V1_0          IGNORED
BIGTREE_BTT002            IGNORED
teensy31                  IGNORED
teensy35                  IGNORED
esp32                     IGNORED
linux_native              IGNORED
SAMD51_grandcentral_m4    IGNORED
rumba32_f446ve            IGNORED
rumba32_mks               IGNORED
include_tree              IGNORED
================================================================================== 1 failed, 0 succeeded in 00:00:09.095 ================================================================================== 
PS D:\3D printer Fixes\Marlin-2.0.x> echo "done" >C:\Users\nraud\AppData\Local\Temp\ipc
PS D:\3D printer Fixes\Marlin-2.0.x>

Hope someone can help out. Thanks in advance.

So how exactly have you connected your SKR-Mini-v1.2 to your PC? Or is the update procedure via an SD card?

Its connected via USB.

As the upload protocol, you have selected stlink. So you would need to have both the SKR mini board and an ST-Link debug probe connected via USB to your computer, and additionally a cable from the ST-Link probe to the SWD connector on the SKR mini board. Is this your setup?

When I read BIGTREETECH-SKR-mini-E3/firmware/V1.2 at master · bigtreetech/BIGTREETECH-SKR-mini-E3 · GitHub it says

After the compilation is successful, a firmware.bin file will be generated in the .pio\build\STM32F103RC_bigtree directory. We will copy this file to the TF card of the motherboard, and then reset the motherboard, so that the firmware is burned into the motherboard, the red led D10 will always blink in the burning, After the burning is completed, D10 stop blink, and the file name in the TF card will change from ‘firmware.bin’ to ‘FIRMWARE.CUR’

So have you tried that?

If you want to upload via USB then you have to either use an STLink or put the chip in USB bootloader mode to do a upload via upload_protocol = dfu (has to be selected in the platformio.ini environment). But the way I read it, it should be done via SD card.