Step by step description for st-link debugging with arduino due

Hi,
I tried to debug an arduino due by the use of a st-link debugger. I think I connected the device corectly to the arduino and I update the ini. file in this way:

[env:due]
platform = atmelsam
board = due
framework = arduino
debug_tool = stlink
upload_protocol = stlink

But the debugging does not work.
My debugger was a ST_LINK V2 and I tried it with an China clone too.

Do anybody have a step by step manual, how to do the debugger working? Or a detailed video?

Thanks for your help!
Michael

Debugging a Due with a ST-Link V2 (original version) is directly referenced in

Please show the full current output of the “PIO Debug” task and your wiring between the due and the ST-Link V2.

After a few months, I tried again to debug on an Arduino Due. I think I followed all instructions correctly, but I’m not able to do any debugging.
I allways get following messages when I tried to upload the code:

What I see is, that the led on the stlink adapter never flashs - it is always off - the driver for the adapter is installed.

Do anybody have any idea what could be my problem?

Best regards
Michael

This is my platformio.ini file:

; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:due]
platform = atmelsam
board = due
framework = arduino
debug_tool = stlink
upload_protocol = stlink
; change microcontroller
;board_build.mcu = at91sam3x8e

Yeah, I see the problem. When the OpenOCD upload is used, it uses the .bin file in the command without setting the start address of flash, so it assumes it’s 0x0000000. But in reality, the start offset is 0x80000 instead.

You have to help out PlatformIO a bit by using this platformio.ini

[env:due]
platform = atmelsam
board = due
framework = arduino
debug_tool = stlink
upload_protocol = stlink
board_upload.offset_address = 0x80000

Yes, that was the issue and now it seems to work.
Thank You very much for your help!!!

best regards
Michael

I’ve tracked this issue in