How to change the Os to O3 compilation option?

Hi
I'm using an ESP32S3 Dev Module (N16R8), and I try to change the compilation options to speed up the execution.
With verbose option, I can see the -Os option:

Compiling sketch...
"C:\Users\fa125436\AppData\Local\Arduino15\packages\esp32\tools\esp-xs3\2302/bin/xtensa-esp32s3-elf-g++" -MMD -c "@C:\Users\fa125436\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-b6b4727c58\esp32s3/flags/cpp_flags" -w -Os -DF_CPU=240000000L -DARDUINO=10607 -DARDUINO_ESP32S3_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD="ESP32S3_DEV"" "-DARDUINO_VARIANT="esp32s3"" -DARDUINO_PARTITION_ "-DARDUINO_HOST_OS="windows"" "-DARDUINO_FQBN="esp32:esp32:esp32s3:UploadSpeed=921600,USBMode=hwcdc,CDCOnBoot=default,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,CPUFreq=240,FlashMode=qio,FlashSize=16M,PartitionScheme=custom,DebugLevel=none,PSRAM=opi,LoopCore=1,EventsCore=1,EraseFlash=none,JTAGAdapter=default,ZigbeeMode=default"" -DESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0 "@C:\Users\fa125436\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-b6b4727c58\esp32s3/flags/defines" "-IC:\Users\fa125436\Documents\Arduino\Aidge_export_CNN_CIFAR100" -iprefix "C:\Users\fa125436\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-b6b4727c58\esp32s3/include/" "@C:\Users\fa125436\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-b6b4727c58\esp32s3/flags/includes" "-IC:\Users\fa125436\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-b6b4727c58\esp32s3/qio_opi/include" "-IC:\Users\fa125436\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.4\cores\esp32" "-IC:\Users\fa125436\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.4\variants\esp32s3" "@C:\Users\fa125436\AppData\Local\Temp\arduino\sketches\C07E232AB10E5D3DA20C46F53E112267/build_opt.h" "@C:\Users\fa125436\AppData\Local\Temp\arduino\sketches\C07E232AB10E5D3DA20C46F53E112267/file_opts" "C:\Users\fa125436\AppData\Local\Temp\arduino\sketches\C07E232AB10E5D3DA20C46F53E112267\sketch\Aidge_export_CNN_CIFAR100.ino.cpp" -o "C:\Users\fa125436\AppData\Local\Temp\arduino\sketches\C07E232AB10E5D3DA20C46F53E112267\sketch\Aidge_export_CNN_CIFAR100.ino.cpp.o"

I'd like to use O3 option.
I tried to change the option in the platform.txt file that is present in my folder: Arduino15\packages\esp32\hardware\esp32\3.0.4 as follows:

# EXPERIMENTAL feature: optimization flags
#  - this is alpha and may be subject to change without notice
compiler.optimization_flags=-O3
compiler.optimization_flags.release=-O3
compiler.optimization_flags.debug=-Og -g3

But the option is unchanged in the compilation status.

I tried to change a little bit one of my source files to force the compiler to compile again and not reuse already compiled files, but I don't see any change.

How can I force the option?

IDE 2.x (at least 2.3.3) where the changes in platform.txt or boards.txt are not picked up.

  1. Close the IDE.
    • Delete the directory C:\Users\yourUsername\AppData\Roaming\arduino-ide.
    • It might be necesary to delete the content of the cache as well; C:\Users\yourUsername\AppData\Local\Temp\arduino.
  2. Restart the IDE.

If you're still using IDE 1.x, I'm not sure. Closing and starting the IDE again might do the trick.

Yes, the solution was to close and rerun the IDE. Thanks.

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