** OpenOCD init failed ** - MKS Robin Nano

Hello, having trouble with uploading Marlin 2 on a MKS Robin Nano board, keep getting this error?

xPack OpenOCD, 32-bit Open On-Chip Debugger 0.10.0+dev (2019-07-17-07:34)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
debug_level: 1

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

*** [upload] Error 1

How have you attached your debug probe (STLink v2?) to the target board? Is it powered? Which exact platformio.ini are you using (link)?

No, I don’t have a debug probe, Yes target board is powered and sorry don’t understand what you mean about what platformio.ini I’m using. Ising the platformio plugin on VisualStudio…if that helps at all?

The PlatformIO project you’re compling and attempting to upload, it has a platformio.ini. Where did you download the PIO project from? Have you made any modifications to the platformio.ini.

Well if you don’t have a debug probe connected to it then you can’t upload via it to the printer :sweat_smile:. Executing the “Upload” task in VSCode will attempt to use the configured upload method to upload the firmware to the board.

It seems like you’re just trying to upgrade your printer firmware, which is this environment. As you can see from the post-script it executes (here), it will create a Robin_nano.bin file in the build folder (.pio\build\<environment name>\Robin_nano.bin probably).

As you can see in your 3D printer’s user manual (Home · makerbase-mks/MKS-Robin-Nano-V1.X Wiki · GitHub), you need to

copy bin file to TF card, insert board and reset or repower on, update firmware.

With the generated Robin_nano.bin file.

I downloaded it via the VS extensions so its 1.10.0 according to that, and no I have made no modifications to it.

Why can I not upload it via USB? or change the upload method to USB?

Sorry, as you can tell I have no clue what I’m doing, doing, where would I add that post-script? As currently I just get a 140k firmware.bin file that dose nothing when put on the TF card.

Thank you for your time.

I don’t mean the VSCode extension, but the project you have imported, Marlin. From which repository did you download it?

The STM32F103VE chip being used on the board does have a built-in USB bootloader mode, but I would not use it in this case. The post-processing of the firmware file (relocation of the entire firmware a little bit back) indicates that there’s some bootloader on there, and you’d potentially overwrite if you uploaded it straight via the STM32 USB DFU method.

Using the DFU uplaod method requires you to put the BOOT0 and BOOT1 pins into the bootloader position and reset the board. Selecting the DFU upload method is done by setting upload_protocol = dfu (refer upload methods here). But again I wouldn’t do that.

It’s already added and the file should be generated, if the correct environment was selected in the platformio.ini. Can you search your Marlin folder for the Robin_nano.bin file?

Awwww sorry, I got it from the github

Thank you for taking the time to explain that :smiley:

Yes, after I hit build and it come out as successful I get a Robin_nano.bin file under builds, but putting it onto the SD card and booting just takes me into the previously installed MarkerBase build of Marlin 2.0.1 i put on this morning not the new one I’m struggling to workout :sweat_smile:

Slight progress seems like it needs to be named ‘ROBIN_NANO35.bin’ not ‘Robin_nano.bin’ got a loading bar this time, but then a blank screen, think I have to set up the TFT…