arduino / arduino-ide

Arduino IDE 2.x
https://www.arduino.cc/en/software
GNU Affero General Public License v3.0
2.29k stars 389 forks source link

Support for Cortex-Debug svdfile available within a core #1920

Closed fpistm closed 8 months ago

fpistm commented 1 year ago

Describe the request

Hi,

Request is to be able to define the svd file to use for a variant without need to create manually a debug_custom.json and be able to use recipe to use relative path. Example: debug.server.cortex-debug.svd={runtime.platform.path}/system/SVD/{build.svdfile}

Maybe related to #435

We plan to add svd files to the core to ease debug.

Describe the current behavior

Currently, to get svd file added to the generated launch.json config file, it is required to add a debug_custom.json file with:

{
  "svdFile": "C:\\Users\\<username>\\AppData\\Local\\Arduino15\\packages\\STMicroelectronics\\hardware\\stm32\\2.5.0-dev\\system\\SVD\\STM32F411.svd"
}

but it requires to add it for each sketch and change it when board is changed. Moreover it is not possible to use recipe in the json, so if the svd files are provided within the core it is not possible to use: {build.system.path}/SVD/STM32F411.svd

Arduino IDE version

2.0.3

Operating system

N/A

Operating system version

all

Additional context

No response

Issue checklist

kittaakos commented 8 months ago

This should be possible with https://github.com/arduino/arduino-cli/commit/748fcf6228327a18dd896cd4edf38f96a2443510 starting from Arduino IDE 2.3.x. See the platform specification for more details: https://arduino.github.io/arduino-cli/latest/platform-specification/#debugger-configuration-directives

I am closing this issue as resolved. Please update the thread if you disagree or if some parts need to be updated.