PlatformIO Community

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
debug_level: 1

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:

src_dir      = Marlin
boards_dir   = buildroot/share/PlatformIO/boards
default_envs = mks_robin_lite

default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
extra_scripts = pre:buildroot/share/PlatformIO/scripts/
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants
lib_deps =
  Adafruit NeoPixel@1.2.5

# Globally defined properties
# inherited by all environments
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.

Do you get the mentioned mksLite.bin file?

Because if you have, as you can see in the instructions from, 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.