I get the following output:
Warn : target at91sam3X8E.cpu examination failed
embedded:startup.tcl:1070: Error: ** Unable to reset target **
in procedure ‘program’
in procedure ‘program_error’ called at file “embedded:startup.tcl”, line 1107
at file “embedded:startup.tcl”, line 1070
*** [upload] Error 1
Just for testing, when you remove the upload_flags again, and hold down the Reset button of the board, then press the Upload button in VSCode and only release the code shortly after the OpenOCD output appears (or the OpenOCD output appears to briefly halt), does uploading work then?
Since I don’t have a Arduino Due I can’t help further. Either someone else from the forum has an idea, or open an issue at Issues · platformio/platform-atmelsam · GitHub. Due to the war, an answer will take its time however.
Building .pio\build\due\firmware.bin
Configuring upload protocol…
AVAILABLE: atmel-ice, blackmagic, custom, jlink, sam-ba, stlink
CURRENT: upload_protocol = custom
Uploading .pio\build\due\firmware.bin
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:19)
Licensed under GNU GPL v2
For bug reports, read OpenOCD: Bug Reporting
at91sam3X8E
Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select ’.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 500 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.222587
Info : at91sam3X8E.cpu: Cortex-M3 r2p0 processor detected
Info : at91sam3X8E.cpu: target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for at91sam3X8E.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0010004c msp: 0x20001000
** Programming Started **
Info : sam3 auto-erases while programming (request ignored)
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
=========================================================== [SUCCESS] Took 12.04 seconds ===========================================================
I would be very greatful for your help.
Thanks and regards.
Building .pio\build\due\firmware.bin
Configuring upload protocol…
AVAILABLE: atmel-ice, blackmagic, jlink, sam-ba, stlink
CURRENT: upload_protocol = stlink
Uploading .pio\build\due\firmware.bin
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:19)
Licensed under GNU GPL v2
For bug reports, read OpenOCD: Bug Reporting
debug_level: 1
0x2ba01477
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0010004c msp: 0x20001000
** Programming Started **
Warn : no flash bank found for address 0x00000000
** Programming Finished **
** Verify Started **
Error: checksum mismatch - attempting binary compare
embedded:startup.tcl:1070: Error: ** Verify Failed **
in procedure ‘program’
in procedure ‘program_error’ called at file “embedded:startup.tcl”, line 1131
at file “embedded:startup.tcl”, line 1070
*** [upload] Error 1
C:\Users\Phillip>/Users/phillip/.platformio/packages/tool-openocd/bin/openocd -d2 -s /Users/phillip/.platformio/packages/tool-openocd/scripts -f interface/stlink.cfg -c “set CHIPNAME at91sam3X8E” -c “source [find target/at91sam3ax_8x.cfg]” -c “telnet_port disabled; program {/Users/phillip/Documents/PlatformIO/Projects/220310-081051-due/.pio/build/due/firmware.elf} verify reset; shutdown;”
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:19)
Licensed under GNU GPL v2
For bug reports, read OpenOCD: Bug Reporting
debug_level: 2
at91sam3X8E
Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select ’.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 500 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.221011
Info : at91sam3X8E.cpu: Cortex-M3 r2p0 processor detected
Info : at91sam3X8E.cpu: target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for at91sam3X8E.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0010004c msp: 0x20001000
** Programming Started **
Info : sam3 auto-erases while programming (request ignored)
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked