Arduino optimization setting flag & GUI for future arduino

  1. I am using Arduino 1.8.1 & made a code in it. Board it Atemga2560 R3

  2. I want to try 6 settings for arduino: a) Zero Optimization b) Default Optimization c) Minimum size Optimization d) Maximum speed Optimization e) Balanced f) custom

  3. What will be settings for this & where to change?

  4. I saw some links on internet, they say to go & change in text file in arduino installed files to do so. I prefer not to do this like this rather than some GUI option as in other IDE's available. Because a minor error while changing in text file can lead to some big problems.

  5. May I suggest in future arduino to have a small GUI like option in preferences to change optimization flags, that will be good option to have.

  6. Any important points is when you build the code, in default arduino optimization settings, warnings may not come, but if you change optimization level, certain warning may appear. I saw this personally in Keil IDE.

It might be easier for you to do experiments like this in your own build environmnent, rather than using the Arduino IDE.

  1. I am using Arduino 1.8.1 & made a code in it. Board it Atemga2560 R3

  2. I found platform.txt in C:\Program Files\Arduino\hardware\arduino\avr .

  3. Found three instances where -Os is mentioned: a) Line23: compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects b) Line24: compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections c) Line28: compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto

  4. I tried to experiment there by changinf these to a) No opt: -O0 b) default: -Os c) Minimum Size: -Os d) Maximum speed: -O3 e) balanced: -O2

  5. Please check if these are ok, & these are the only 3 instances where i need to change.

  6. Problem is I couldnt save the changes: a) If I do changes in notepad++, on saving it throws error, "Please check if this file is opened in another program" b) In wordpad, "Access to this file is denied" c) I tried restarting my computer same error. d) check if this file is read only but no. e) I am the only user in this system. Window 7 ultimate, 32 bit