IDE 2.x suggestions

Ability to add command line options, including suppressing the optimization setting (for debugging, I don't want any optimization). Ability to add -D options.

I want to be able to get a source+code listing. I want to get a preprocessed-code listing. These are important (try explaining to a student why using a certain word causes a mysterious compilation error).

I'm not asking for a full-blown IDE, just the minimal features for simple development.

Hi @flounder

A separate tool named Arduino CLI provides more advanced capabilities like these. You can set build properties via the arduino-cli compile --build-property flag:

https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_compile/#options

Some demonstrations of how to use it are provided in the "examples" section of the documentation:

arduino-cli compile -b arduino:avr:uno --build-property "build.extra_flags=\"-DMY_DEFINE=\"hello world\"\"" /home/user/Arduino/MySketch

You might be interested in some related discussion here:

There is a Sketch > Optimize for Debugging menu option for this purpose. The exact behavior, including whether it does anything at all is up to the author of the platform of the board you are compiling for, as is the case with all compilation parameters.

You can see the flags it adds when compiling for a board of the "Arduino SAMD Boards (32-bits ARM Cortex-M0+)" platform here:

https://github.com/arduino/ArduinoCore-samd/blob/1.8.13/platform.txt#L38

compiler.optimization_flags.debug=-Og -g3

If by "preprocessed" you mean Arduino sketch preprocessing, you can get it from arduino-cli compile --preprocess.

Alternatively, you can see the .cpp file generated from the sketch after sketch preprocessing in the sketch subfolder of the temporary build folder.

If by "preprocessed" you mean the C++ preprocessor, you can see this by looking at the file in the preproc subfolder of the temporary build folder.

The path of the temporary build folder is shown in the verbose compilation output. For example, from this line of output:

"C:\\Users\\per\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\per\\AppData\\Local\\Temp\\arduino-sketch-5F56F5A11E5AD1C1C0AA709A99664C46/Associated2.ino.elf"

you can see the build folder is here:

C:\Users\per\AppData\Local\Temp\arduino-sketch-5F56F5A11E5AD1C1C0AA709A99664C46

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.