Error Open Failed Issue

Hey guys, new to Platform IO.

Trying to compile Marlin 2.0 and upload to an MKS Robin Lite v1.1. Using a Mac, current version, compiling within Visual Studio Code. Using PIO I can see the board, so USB connectivity is working, or at least its physically connected properly. Below is partial results from the Terminal.

For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

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

*** [upload] Error 1

Also, here’s what I think is the important stuff from platformio.ini:

[platformio]
src_dir      = Marlin
boards_dir   = buildroot/share/PlatformIO/boards
default_envs = mks_robin_lite

[common]
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants
lib_deps =
  U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip
  LiquidCrystal@1.3.4
  TMCStepper@>=0.5.2,<1.0.0
  Adafruit NeoPixel@1.2.5
  Adafruit_MAX31865=https://github.com/adafruit/Adafruit_MAX31865/archive/master.zip
  LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip
  Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/dev.zip
  SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip
  SailfishRGB_LED=https://github.com/mikeshub/SailfishRGB_LED/archive/master.zip
  SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip

# Globally defined properties
# inherited by all environments
[env]
framework   = arduino
build_flags = ${common.build_flags}
lib_deps    = ${common.lib_deps}

Any assistance you can provide would be greatly appreciated. Thank you.

I could be completely off track here, but are you sure you pressed the upload button, and not the debug one? I thought OpenOCD was used for debugging, not for uploading.

The MKSLite seems special as it does a firmware encryption with a static XOR key as a post-process step.

https://github.com/MarlinFirmware/Marlin/blob/2.0.x/buildroot/share/PlatformIO/scripts/mks_robin_lite.py

Do you get the mentioned mksLite.bin file?

Because if you have, as you can see in the instructions from MKS-Robin/MKS Robin Lite/firmware at master · makerbase-mks/MKS-Robin · GitHub, you just need to copy this file to an SD card to upgrade the firmware.

You don’t flash it to the board directly via the USB-UART. There’s a bootloader and the SD card mechanism.

1 Like

Thanks I’ll look into that. I have to figure out how to change the direction of the extruder through the firmware. Doing it through a console (using Octoprint) only lets me change the steps, but not the direction. And doing a negative on the steps just messes it up. Thanks for posting.