Black Magic Probe & Arduino Due can't debug or upload

Hi all,
I am having a lot of trouble trying to get BMP (HW: v2.1e, FW: v1.7.1) to work in PIO w/ the Arduino Due (genuine). Additional possibly useful information: Windows 10 (& Kubuntu 20.04 LTS, same error on both), VSCode (v1.59.1), PIO (Core v5.1.1, Home v3.3.4).

I have read the following threads and attempted to implement some of the things that seemed to have worked for other people with no success (the most promising looking to be Maxattax97’s in /4749).

Both this PlatformIO page and this BMP page seem to say that platformio.ini needs the following:

platform = atmelsam
board = due
framework = arduino
debug_tool = blackmagic
upload_protocol = blackmagic-jtag
upload_port = COMX
debug_port = COMX

where COMX is the BMP GDB server (as previously mentioned I did try using various additions to platformio.ini including MaxAttax97’s).

When trying to start the debugger, it hangs and results in this:
bmp1

and when just trying to upload the program, no debugging, it results in the same error and sometimes:

For reference, the program is just:

#include <Arduino.h>

int blinkLED = 13;
bool state = false;

void setup() {
  pinMode(blinkLED, OUTPUT);
}

void loop() {
  state = !state;
  digitalWrite(blinkLED, state);
  delay(500);
}

Thank you for your time.

Sadly I don’t have a BMP or an Arduino Due so I can only offer very generic advice:

  • on Windows, if a COM port higher than 9 is to be refernenced, it must be done so with a special “\.\COMx” syntax as e.g. seen in How to debug on Arduino mega 2560 - #2 by maxgerhardt. Adapt debug_port etc. accordingly if that is your case
  • is the firmware on the BMP up-to-date? Which version is it, for reference?
  • Are you able to connect to and flash the chip manually with GDB commands or some guide explaining how to use the BMP on the command line? What exact GDB commands are used to achieve that?

Hi Max,

  • Using COM port <9 (6 in my case for the GDB server port)
  • Yes, the firmware is up-to-date. I updated it to the most recent (v1.7.1).
  • I am able to connect in GDB (not not upload), but I have no experience with GDB and I am running into errors. I am asking in the 1BitSquared for some advice as well, will update here when able.