Where can I change the compiler optimization options of arduino nano 33 ble sense

Dear sir or madam,

I try to change the compiler options like -01 or -02. I already go to the platform.txt both for mbed. but I find they replace the options with one variable. The details are shown as below, do you know whereI can find the compliler.mbed.cflags?

compiler.c.flags=-c {compiler.warning_flags} -g3 -nostdlib “@{compiler.mbed.defines}” “@{compiler.mbed.cflags}” {compiler.mbed.arch.define} -MMD -mcpu={build.mcu} {build.float-abi} {build.fpu}

Thanks in advance

in the platform.txt or in the board.txt

Hi @haoliu0027.

The compiler.mbed.cflags property is defined in the board definition in the platform's boards.txt configuration file:

Note the @ in the "@{compiler.mbed.cflags}" argument. This syntax tells the GCC compiler to load a list of command line options from a text file at the provided path:

https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html#:~:text=some%20other%20language.-,%40file,-Read%20command-line

So if you want to change these options, then you actually need to modify the file at this path under the platform:

variants/ARDUINO_NANO33BLE/cflags.txt

(the build.variant.path property is predefined by the Arduino boards platform framework, providing the path to the board's core variant folder)

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