Skip to content

Compiler creating debug.cfg, debug_custom.json, and esp32.svd files in my sketch folder under version 2.0.6 #7647

Closed
@HomeSpan

Description

@HomeSpan

Board

Any board

Device Description

Occurs on all Espressif development boards

Hardware Configuration

Nothing

Version

other

IDE Name

Arduino 1.8.19

Operating System

MacOs 13.1

Flash frequency

80 MHz

PSRAM enabled

no

Upload speed

921600

Description

In the latest release (2.0.6), whenever you compile a sketch, the compiler is dropping three new files into the sketch folder: debug.cfg, debug_custom.json, and esp32.svd. These files have never appeared when compiling with version 2.0.5 or earlier. Is there a way of turning the automatic output of these files?

Sketch

Any sketch.

Debug Message

None

Other Steps to Reproduce

Compile any sketch with Arduino IDE 1.8.19 using the latest Arduino-ESP32 version 2.0.6 and the compiler drops three new files, presumably used for debugging/testing, in to the sketch folder.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Activity

svdrummer

svdrummer commented on Jan 1, 2023

@svdrummer

I have just been asking this question on the Arduino forum. I have started getting these files being added.
debug.cfg
debug_custom.json
esp32.svd

me-no-dev

me-no-dev commented on Jan 2, 2023

@me-no-dev
Member

they are required for JTAG debugging with Arduino IDE 2.0.3+

IeiuniumLux

IeiuniumLux commented on Jan 3, 2023

@IeiuniumLux

@me-no-dev, The above 3 files are also now generated with the classic Arduino 1.8.19 IDE during the uploading. Why does the former IDE now require those files too?

me-no-dev

me-no-dev commented on Jan 3, 2023

@me-no-dev
Member

@IeiuniumLux it does not, but we can not detect which version is the IDE in order to copy them only on the new one

HomeSpan

HomeSpan commented on Jan 3, 2023

@HomeSpan
Author

@me-no-dev, Can the output be an option that is selected from the tool menu, similar to setting the "Core Debug Level" or "Erase all Flash Before Sketch Upload"? Perhaps something like "Output JTAG files" where the default is "No" so that the files would never be output in version 1 of the Arduino IDE and would be optionally output in version 2?

Separately, is there anything in either "platform.txt" or "programmers.txt" that we can edit to disable the JTAG output?

me-no-dev

me-no-dev commented on Jan 3, 2023

@me-no-dev
Member

@HomeSpan I'm not sure if it's possible to be controlled by an option, but could be tried. You can remove those lines to disable copy to sketch folder

tobozo

tobozo commented on Jan 3, 2023

@tobozo
Contributor

does it have to be the sketch folder?

looks like an additional entry in .gitignore files will be required for the meantime

image

me-no-dev

me-no-dev commented on Jan 3, 2023

@me-no-dev
Member

@tobozo it has to be the sketch folder, because that is where the IDE is looking for debug_custom.json and is also the current folder for gdb/openocd (and where they can find the other files). Maybe this is a temporary thing and more flexibility will be added to the IDE in the future. I am looking into only doing it when debug is enabled also. I will add the files to gitignore in a bit.

tobozo

tobozo commented on Jan 3, 2023

@tobozo
Contributor

@me-no-dev I've edited the platform.txt as per your recommendation.

If suggesting a different place is possible, it would certainly make sense to find those debug files in the same folder as the ELF file (near the build.options.json), where some debug material already exists.

me-no-dev

me-no-dev commented on Jan 3, 2023

@me-no-dev
Member

@tobozo we have no control over that part or I would have used the build folder as well.
Anyway, I created this PR that adds gitignore and copies the files only if JTAG adapter is selected (or particular build variable is set to 1)

@IeiuniumLux @HomeSpan PTAL

self-assigned this
on Jan 3, 2023

20 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

IDE: Arduino IDEIssue relates to Arduino IDEPriority: High 🗻Issues with high priority which needs to be solved first.Status: Pending MergePull Request is ready to be merged

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Compiler creating debug.cfg, debug_custom.json, and esp32.svd files in my sketch folder under version 2.0.6 · Issue #7647 · espressif/arduino-esp32