Launch debug template don't work with SAMD21 board with jlink and Arduino framework

Hi,

  1. I place a breakpoint in the first line of the Arduino setup() function.
  2. I launch debug with the PIO configuration. This starts debugging and stops in the _init function of the Arduino Core.
  3. I press continue button in the debug toolbar and the program never reach the breakpoint.

Because of this missfunction, I’ve made my own launch.json file. As you know, the PIO Core template overloads launch.json…
Then, I temporarily replace my own tpls files i the pio core to get my setup permanently.

Question :

  • is there an option to force the PIO Core to get tpls files (or vscode json configuration files) in the projects directory to the tpls PIO Core files ? If not, it will be a good solution to let users push them in a tpls dir in the project dir and use them if they exist.

Eric
The launch.json part of the working configuration :
{
“cwd”: “${workspaceRoot}”, “executable”: “c:/Users/eric/Documents/CloudUniversite/CoursTDTP/SAe1/Automatisation/SAe1_BaseAutomatisation_Correction_v2/.pio/build/mattairtech_samd21e18a/firmware.elf”,
“name”: “mattairtech_samd21e18a”,
“request”: “launch”,
“type”: “cortex-debug”,
“servertype”: “jlink”,
“serverpath”: “C:/VSCode/.platformio/packages/tool-jlink/JLinkGDBServerCL.exe”,
“armToolchainPath”: “C:/VSCode/.platformio/packages/toolchain-gccarmnoneeabi/bin/”,
“gdbPath”: “C:/VSCode/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gdb.exe”,
“configFiles”: [
“C:/VSCode/.platformio/packages/tool-openocd/scripts/board/atmel_samd21_xplained_pro.cfg”
],
“device”: “ATSAMD21E18A”,
“svdFile”: “C:/VSCode/.platformio/platforms/atmelsam/misc/svd/ATSAMD21E18A.svd”,
“runToMain”: false,
“preLaunchTask”: {
“type”: “PlatformIO”,
“task”: “Pre-Debug”
}
}

Problems with JLink + AT SAMD chips have been known for a long time (Problems starting debug session with jlink on feather M0). Does it work without any additional launch file if you press the restart button as indicated in this topic?

It works. Thank you Maximilian.
I’ve a lot of others problems, especially with UNC…
This will be the subject of my next post.